replaces link on poll title if results or stats are enabled

This commit is contained in:
decabeza
2017-10-23 19:56:26 +02:00
parent f7dce94a45
commit da00ac947e

View File

@@ -19,11 +19,27 @@
<div class="dates"></div>
<% if poll.questions.count == 1 %>
<% poll.questions.each do |question| %>
<h4><%= link_to question.title, poll %></h4>
<h4>
<% 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 %>
</h4>
<%= poll_dates(poll) %>
<% end %>
<% else %>
<h4><%= link_to poll.name, poll %></h4>
<h4>
<% 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 %>
</h4>
<%= poll_dates(poll) %>
<ul class="margin-top">
<% poll.questions.each do |question| %>