Files
grecia/app/views/polls/index.html.erb
2018-07-30 17:55:56 +02:00

44 lines
1.5 KiB
Plaintext

<% provide :title do %><%= t("polls.index.title") %><% end %>
<% content_for :canonical do %>
<%= render "shared/canonical", href: polls_url %>
<% end %>
<%= render "shared/section_header", i18n_namespace: "polls.index.section_header", image: "polls" %>
<div class="row">
<div class="small-12 column">
<%= render 'shared/filter_subnav', i18n_namespace: "polls.index" %>
<% if @polls.any? %>
<% polls_by_geozone_restriction = @polls.group_by(&:geozone_restricted) %>
<% if polls_by_geozone_restriction[false].present? %>
<h3 class="section-title-divider">
<span><%= t("polls.index.no_geozone_restricted") %></span>
</h3>
<%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[false]} %>
<% end %>
<% if polls_by_geozone_restriction[true].present? %>
<h3 class="section-title-divider">
<span><%= t("polls.index.geozone_restricted") %></span>
</h3>
<%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[true]} %>
<% end %>
<%= paginate @polls %>
<% else %>
<div class="callout primary margin-top">
<%= t("polls.index.no_polls") %>
</div>
<% end %>
<div id="section_help" class="margin" data-magellan-target="section_help">
<p class="lead">
<strong><%= t("polls.index.section_footer.title") %></strong>
</p>
<p><%= t("polls.index.section_footer.description") %></p>
</div>
</div>
</div>