Files
nairobi/app/views/polls/index.html.erb
Javi Martín 2aabf79fb4 Rename methods to add auto links to HTML
The name `safe_html_with_links` was confusing and could make you think
it takes care of making the HTML safe. So I've renamed it in a way that
makes it a bit more intuitive that it expects its input to be already
sanitized.

I've changed `text_with_links` as well so now the two method names
complement each other.
2019-10-08 18:46:20 +02:00

56 lines
1.8 KiB
Plaintext

<% provide :title do %><%= t("polls.index.title") %><% end %>
<%= render_custom_partial "meta_description" %>
<% content_for :canonical do %>
<%= render "shared/canonical", href: polls_url %>
<% end %>
<%= render_custom_partial "social_meta_tags" %>
<%= render "shared/section_header", i18n_namespace: "polls.index.section_header", image: "polls" %>
<div class="row">
<div class="small-12 column">
<% if show_polls_description? %>
<div class="polls-description">
<%= auto_link_already_sanitized_html WYSIWYGSanitizer.new.sanitize(@active_poll.description) %>
</div>
<% end %>
<%= 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 "poll_group", 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 "poll_group", 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>
<%= render_custom_partial "footer" %>
</div>
</div>
</div>