improves styles for officing results table

This commit is contained in:
Alberto Garcia Cabeza
2017-02-02 17:08:00 +01:00
parent 3dd33c4247
commit 095545cd48
3 changed files with 32 additions and 16 deletions

View File

@@ -3,14 +3,24 @@
<% if @partial_results.present? %> <% if @partial_results.present? %>
<div class="callout primary"> <div class="callout primary">
<h3><%= @booth_assignment.booth.name %> - <%= l @partial_results.first.date, format: :long %></h3> <h3>
<%= @booth_assignment.booth.name %> - <%= l @partial_results.first.date, format: :long %>
</h3>
</div> </div>
<div class="row">
<div class="small-12 medium-9 column">
<% by_question = @partial_results.group_by(&:question_id) %> <% by_question = @partial_results.group_by(&:question_id) %>
<% @poll.questions.each do |question| %> <% @poll.questions.each do |question| %>
<h3><%= question.title %></h3> <h3><%= question.title %></h3>
<table> <table>
<thead>
<tr>
<th><%= t("officing.results.index.table_answer") %></th>
<th><%= t("officing.results.index.table_votes") %></th>
</tr>
</thead>
<tbody> <tbody>
<% question.valid_answers.each_with_index do |answer, i| %> <% question.valid_answers.each_with_index do |answer, i| %>
<% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %> <% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %>
@@ -23,6 +33,8 @@
</table> </table>
<% end %> <% end %>
</div>
</div>
<% else %> <% else %>
<div class="callout primary"> <div class="callout primary">
<%= t("officing.results.index.no_results") %> <%= t("officing.results.index.no_results") %>

View File

@@ -74,6 +74,8 @@ en:
index: index:
no_results: "No results" no_results: "No results"
results: Results results: Results
table_answer: Answer
table_votes: Votes
residence: residence:
flash: flash:
create: "Document verified with Census" create: "Document verified with Census"

View File

@@ -74,6 +74,8 @@ es:
index: index:
no_results: "No hay resultados" no_results: "No hay resultados"
results: "Resultados" results: "Resultados"
table_answer: Respuesta
table_votes: Votos
residence: residence:
flash: flash:
create: "Documento verificado con el Padrón" create: "Documento verificado con el Padrón"