displays welcome image only at home page

This commit is contained in:
rgarcia
2015-07-28 13:54:43 +02:00
parent 9c2a13d16d
commit 62be883bcc
3 changed files with 22 additions and 8 deletions

View File

@@ -56,7 +56,11 @@ header {
background: url('home-header-bg.jpg');
background-position: 50% 50%;
background-size: cover;
min-height: $line-height*20;
height: $line-height*20;
&.results {
height: $line-height*8 !important;
}
h1 {
color: white;

View File

@@ -8,4 +8,12 @@ module ApplicationHelper
return if debate.total_votes == 0
debate.send(vote).percent_of(debate.total_votes).to_s + "%"
end
def home_page?
request.fullpath == '/'
end
def header_css
home_page? ? '' : 'results'
end
end

View File

@@ -1,4 +1,4 @@
<header>
<header class="<%= header_css %>">
<section class="top-links">
<div class="row">
<div class="small-12 column">
@@ -27,11 +27,13 @@
</nav>
</div>
<div class="row">
<div class="small-12 column text-center">
<h1>Estamos abriendo Madrid</h1>
<h2>Para que todos los madrileños decidamos que ciudad queremos tener.</h2>
<%= link_to 'Participa en los últimos debates e iniciativas', new_debate_path, :class => 'button radius' %>
<% if home_page? %>
<div class="row">
<div class="small-12 column text-center">
<h1>Estamos abriendo Madrid</h1>
<h2>Para que todos los madrileños decidamos que ciudad queremos tener.</h2>
<%= link_to 'Participa en los últimos debates e iniciativas', new_debate_path, :class => 'button radius' %>
</div>
</div>
</div>
<% end %>
</header>