diff --git a/app/views/polls/index.html.erb b/app/views/polls/index.html.erb index 9b490f3e2..f606aaef9 100644 --- a/app/views/polls/index.html.erb +++ b/app/views/polls/index.html.erb @@ -15,30 +15,61 @@
-

<%= t("polls.index.no_geozone_restricted") %>

-

<%= t("polls.index.geozone_restricted") %>

- <% @polls.each do |poll| %> -
-
-
-
<%= poll_dates(poll) %>
-

<%= link_to poll.name, poll %>

-
    - <% poll.questions.each do |question| %> -
  • <%= link_to question.title, question_path(question) %>
  • - <% end %> -
-
    - <% poll.geozones.each do |g| %> -
  • <%= g.name %>
  • - <% end %> -
-
-
- <%= link_to t("polls.index.participate_button"), poll, class: "button" %> + <% polls_by_geozone_restriction = @polls.group_by(&:geozone_restricted) %> + + <% if polls_by_geozone_restriction[false].any? %> +

<%= t("polls.index.no_geozone_restricted") %>

+ + <% polls_by_geozone_restriction[false].each do |poll| %> +
+
+
+
<%= poll_dates(poll) %>
+

<%= link_to poll.name, poll %>

+
    + <% poll.questions.each do |question| %> +
  • <%= link_to question.title, question_path(question) %>
  • + <% end %> +
+
    + <% poll.geozones.each do |g| %> +
  • <%= g.name %>
  • + <% end %> +
+
+
+ <%= link_to t("polls.index.participate_button"), poll, class: "button" %> +
-
+ <% end %> + <% end %> + + <% if polls_by_geozone_restriction[true].any? %> +

<%= t("polls.index.geozone_restricted") %>

+ <% polls_by_geozone_restriction[true].each do |poll| %> +
+
+
+
<%= poll_dates(poll) %>
+

<%= link_to poll.name, poll %>

+
    + <% poll.questions.each do |question| %> +
  • <%= link_to question.title, question_path(question) %>
  • + <% end %> +
+
    + <% poll.geozones.each do |g| %> +
  • <%= g.name %>
  • + <% end %> +
+
+
+ <%= link_to t("polls.index.participate_button"), poll, class: "button" %> +
+
+
+ <% end %> <% end %> <%= paginate @polls %>