23 lines
791 B
Plaintext
23 lines
791 B
Plaintext
<div class="poll-question-answers">
|
|
<% if can? :answer, question %>
|
|
<% question.valid_answers.each do |answer| %>
|
|
<% if @answers_by_question_id[question.id] == answer %>
|
|
<span class="button answered" title="<%= t("poll_questions.show.voted", answer: answer)%>">
|
|
<%= answer %>
|
|
</span>
|
|
<% else %>
|
|
<%= link_to answer,
|
|
answer_question_path(question, answer: answer),
|
|
method: :post,
|
|
remote: true,
|
|
title: t("poll_questions.show.vote_answer", answer: answer),
|
|
class: "button secondary hollow" %>
|
|
<% end %>
|
|
<% end %>
|
|
<% else %>
|
|
<% question.valid_answers.each do |answer| %>
|
|
<span class="button secondary hollow disabled"><%= answer %></span>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|