Files
grecia/app/components/polls/results/question_component.html.erb
Javi Martín 5fa6db2226 Rename HTML attributes referencing poll options
Since now poll question answers have been renamed to poll question
options, using HTML IDs, classes and data attributes named `answer` was
confusing.
2024-06-13 19:13:05 +02:00

26 lines
820 B
Plaintext

<h3 id="<%= question.title.parameterize %>"><%= question.title %></h3>
<table id="question_<%= question.id %>_results_table">
<thead>
<tr>
<%- question.question_options.each do |option| %>
<th scope="col" class="<%= option_styles(option) %>">
<% if most_voted_option?(option) %>
<span class="show-for-sr"><%= t("polls.show.results.most_voted_answer") %></span>
<% end %>
<%= option.title %>
</th>
<% end %>
</tr>
</thead>
<tbody>
<tr>
<%- question.question_options.each do |option| %>
<td id="option_<%= option.id %>_result" class="<%= option_styles(option) %>">
<%= option.total_votes %>
(<%= option.total_votes_percentage.round(2) %>%)
</td>
<% end %>
</tr>
</tbody>
</table>