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: url('home-header-bg.jpg');
background-position: 50% 50%; background-position: 50% 50%;
background-size: cover; background-size: cover;
min-height: $line-height*20; height: $line-height*20;
&.results {
height: $line-height*8 !important;
}
h1 { h1 {
color: white; color: white;

View File

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

View File

@@ -1,4 +1,4 @@
<header> <header class="<%= header_css %>">
<section class="top-links"> <section class="top-links">
<div class="row"> <div class="row">
<div class="small-12 column"> <div class="small-12 column">
@@ -27,6 +27,7 @@
</nav> </nav>
</div> </div>
<% if home_page? %>
<div class="row"> <div class="row">
<div class="small-12 column text-center"> <div class="small-12 column text-center">
<h1>Estamos abriendo Madrid</h1> <h1>Estamos abriendo Madrid</h1>
@@ -34,4 +35,5 @@
<%= link_to 'Participa en los últimos debates e iniciativas', new_debate_path, :class => 'button radius' %> <%= link_to 'Participa en los últimos debates e iniciativas', new_debate_path, :class => 'button radius' %>
</div> </div>
</div> </div>
<% end %>
</header> </header>