From cef9bf600cc2946304fada34c7ab02ef12716fde Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 3 Feb 2017 12:34:34 +0100 Subject: [PATCH] shows question as title if poll has only one question --- app/views/polls/_poll_group.html.erb | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb index 20770014b..d9ffb1d33 100644 --- a/app/views/polls/_poll_group.html.erb +++ b/app/views/polls/_poll_group.html.erb @@ -3,18 +3,24 @@
<%= poll_dates(poll) %>
-

<%= link_to poll.name, poll %>

-
    + <% if poll.questions.count == 1 %> <% poll.questions.each do |question| %> -
  • <%= link_to question.title, question_path(question) %>
  • +

    <%= link_to question.title, question_path(question) %>

    <% end %> -
- <% if poll.geozones.any? %> -

- <%= t("polls.index.geozone_info") %> -

+ <% else %> +

<%= link_to poll.name, poll %>

+
    + <% poll.questions.each do |question| %> +
  • <%= link_to question.title, question_path(question) %>
  • + <% end %> +
<% end %> -
    + <% if poll.geozones.any? %> + + <%= t("polls.index.geozone_info") %> + + <% end %> +
      <% poll.geozones.each do |g| %>
    • <%= g.name %>
    • <% end %>