diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb new file mode 100644 index 000000000..42c55809c --- /dev/null +++ b/app/views/polls/_poll_group.html.erb @@ -0,0 +1,23 @@ +<%= 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" %> +
+
+
+<% end %> diff --git a/app/views/polls/index.html.erb b/app/views/polls/index.html.erb index f606aaef9..f0edcfbc7 100644 --- a/app/views/polls/index.html.erb +++ b/app/views/polls/index.html.erb @@ -19,57 +19,14 @@ <% 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 %> + <%# render "poll_group", polls: polls_by_geozone_restriction[false] %> + <%= render partial: 'poll_group', locals: {polls: polls_by_geozone_restriction[false]} %> <% 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 %> + <%# render "poll_group", polls: polls_by_geozone_restriction[true] %> + <%= render partial: 'poll_group', locals: {polls: polls_by_geozone_restriction[true]} %> <% end %> <%= paginate @polls %>