Unify Officing and Admin results views
Unify the code from app/views/officing/results/index.html.erb with app/views/admin/poll/results/_result.html.erb. This prepares the ground to extract a component in the next commit and avoid duplication.
This commit is contained in:
@@ -31,11 +31,11 @@
|
||||
<% @poll.questions.each do |question| %>
|
||||
<h3><%= question.title %></h3>
|
||||
|
||||
<table>
|
||||
<table class="margin">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("officing.results.index.table_answer") %></th>
|
||||
<th><%= t("officing.results.index.table_votes") %></th>
|
||||
<th><%= t("admin.results.result.table_answer") %></th>
|
||||
<th class="text-center"><%= t("admin.results.result.table_votes") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -43,7 +43,7 @@
|
||||
<% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %>
|
||||
<tr id="question_<%= question.id %>_<%= i %>_result">
|
||||
<td><%= option.title %></td>
|
||||
<td><%= by_answer[option.title].present? ? by_answer[option.title].first.amount : 0 %></td>
|
||||
<td class="text-center"><%= by_answer[option.title].present? ? by_answer[option.title].sum(&:amount) : 0 %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -57,8 +57,6 @@ en:
|
||||
index:
|
||||
no_results: "No results"
|
||||
results: Results
|
||||
table_answer: Answer
|
||||
table_votes: Votes
|
||||
table_whites: "Totally blank ballots"
|
||||
table_nulls: "Invalid ballots"
|
||||
table_total: "Valid ballots"
|
||||
|
||||
@@ -57,8 +57,6 @@ es:
|
||||
index:
|
||||
no_results: "No hay resultados"
|
||||
results: Resultados
|
||||
table_answer: Respuesta
|
||||
table_votes: Votos
|
||||
table_whites: "Papeletas totalmente en blanco"
|
||||
table_nulls: "Papeletas nulas"
|
||||
table_total: "Papeletas válidas"
|
||||
|
||||
Reference in New Issue
Block a user