changes button text depending of poll status

This commit is contained in:
Alberto Garcia Cabeza
2017-03-06 12:29:13 +01:00
parent 25a88e8747
commit bf3e301bb1
3 changed files with 13 additions and 1 deletions

View File

@@ -60,7 +60,15 @@
</ul>
</div>
<div class="small-12 medium-6 large-4 column end">
<%= link_to t("polls.index.participate_button"), poll, class: "button expanded" %>
<%= link_to poll, class: "button expanded" do %>
<% if poll.expired? %>
<%= t("polls.index.participate_button_expired") %>
<% elsif poll.incoming? %>
<%= t("polls.index.participate_button_incoming") %>
<% else %>
<%= t("polls.index.participate_button") %>
<% end %>
<% end %>
</div>
</div>
</div>