From da00ac947e38e926b26aacd4e8909ccf57f042de Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 23 Oct 2017 19:56:26 +0200 Subject: [PATCH] replaces link on poll title if results or stats are enabled --- app/views/polls/_poll_group.html.erb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb index 529e9a99e..9d83d5233 100644 --- a/app/views/polls/_poll_group.html.erb +++ b/app/views/polls/_poll_group.html.erb @@ -19,11 +19,27 @@
<% if poll.questions.count == 1 %> <% poll.questions.each do |question| %> -

<%= link_to question.title, poll %>

+

+ <% if poll.results_enabled? %> + <%= link_to question.title, poll_results_path(poll) %> + <% elsif poll.stats_enabled? %> + <%= link_to question.title, poll_stats_path(poll) %> + <% else %> + <%= link_to question.title, poll %> + <% end %> +

<%= poll_dates(poll) %> <% end %> <% else %> -

<%= link_to poll.name, poll %>

+

+ <% if poll.results_enabled? %> + <%= link_to poll.name, poll_results_path(poll) %> + <% elsif poll.stats_enabled? %> + <%= link_to poll.name, poll_stats_path(poll) %> + <% else %> + <%= link_to poll.name, poll %> + <% end %> +

<%= poll_dates(poll) %>