Moves banner to a partial and includes it on debates index
This commit is contained in:
@@ -22,6 +22,7 @@ class DebatesController < ApplicationController
|
||||
|
||||
def index_customization
|
||||
@featured_debates = @debates.featured
|
||||
@proposal_ballots = Proposal.successfull.sort_by_confidence_score
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -29,7 +29,11 @@
|
||||
<%= render "shared/banner" %>
|
||||
<% end %>
|
||||
|
||||
<% unless @tag_filter || @search_terms || !has_featured? %>
|
||||
<% if @proposal_ballots.present? %>
|
||||
<%= render "proposals/proposal_ballots_banner" %>
|
||||
<% end %>
|
||||
|
||||
<% unless @tag_filter || @search_terms || !has_featured? || @proposal_ballots.present? %>
|
||||
<%= render "featured_debates" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
9
app/views/proposals/_proposal_ballots_banner.html.erb
Normal file
9
app/views/proposals/_proposal_ballots_banner.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div id="next-voting" class="row featured-proposals-ballot-banner">
|
||||
<%= link_to proposal_ballots_path do %>
|
||||
<div class="small-12 column padding">
|
||||
<div class="icon-successfull"></div>
|
||||
<h2><%= t("proposal_ballots.featured_title") %></h2>
|
||||
<p><%= t("proposal_ballots.info") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -32,15 +32,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if @proposal_ballots.present? %>
|
||||
<div id="next-voting" class="row featured-proposals-ballot-banner">
|
||||
<%= link_to proposal_ballots_path do %>
|
||||
<div class="small-12 column padding">
|
||||
<div class="icon-successfull"></div>
|
||||
<h2><%= t("proposal_ballots.featured_title") %></h2>
|
||||
<p><%= t("proposal_ballots.info") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render "proposal_ballots_banner" %>
|
||||
<% elsif @featured_proposals.present? %>
|
||||
<div id="featured-proposals" class="row featured-proposals">
|
||||
<div class="small-12 column">
|
||||
|
||||
@@ -376,7 +376,7 @@ en:
|
||||
title: "Votings"
|
||||
description_html: "The proposals that have reached the <strong>required supports <em>(%{supports})</em></strong> will be voted."
|
||||
date_title: "Dates of participation"
|
||||
date: "November 21 to November 27, 2016"
|
||||
date: "Soon we'll announce the date of vote these proposals."
|
||||
successfull: "This proposal has reached the required supports and will be voted in the %{voting}."
|
||||
voting: "next voting"
|
||||
featured_title: "#VotingProposal"
|
||||
|
||||
@@ -376,7 +376,7 @@ es:
|
||||
title: "Votaciones"
|
||||
description_html: "Las propuestas que han alcanzado el <strong>número de apoyos necesarios <em>(%{supports})</em></strong> pasarán a votación."
|
||||
date_title: "Fechas de participación"
|
||||
date: "Del 21 de noviembre al 27 de noviembre de 2016"
|
||||
date: "En breve anunciaremos la fecha de votación de estas propuestas."
|
||||
successfull: "Esta propuesta ha alcanzado los apoyos necesarios y pasará a la %{voting}."
|
||||
voting: "próxima votación"
|
||||
featured_title: "#VotaUnaPropuesta"
|
||||
|
||||
Reference in New Issue
Block a user