improves tables layout on admin polls show views

This commit is contained in:
Alberto Garcia Cabeza
2017-02-09 19:03:06 +01:00
parent ff0013e60c
commit f7971a3c9f
5 changed files with 49 additions and 35 deletions

View File

@@ -5,11 +5,11 @@
<%= t("admin.polls.show.no_booths") %>
</div>
<% else %>
<table id="assigned_booths_list" class="margin">
<table id="assigned_booths_list" class="fixed margin">
<thead>
<th><%= t("admin.polls.show.table_name") %></th>
<th><%= t("admin.polls.show.table_location") %></th>
<th class="text-center"><%= t("admin.polls.show.table_assignment") %></th>
<th class="text-right"><%= t("admin.polls.show.table_assignment") %></th>
</thead>
<tbody>
<% @poll.booth_assignments.each do |booth_assignment| %>
@@ -22,7 +22,7 @@
<td>
<%= booth_assignment.booth.location %>
</td>
<td class="text-center">
<td class="text-right">
<%= link_to t("admin.polls.show.remove_booth"),
admin_booth_assignment_path(booth_assignment),
method: :delete,

View File

@@ -5,10 +5,11 @@
<%= t("admin.polls.show.no_officers") %>
</div>
<% else %>
<table class="margin">
<table class="fixed margin">
<thead>
<th><%= t("admin.polls.show.table_name") %></th>
<th><%= t("admin.polls.show.table_email") %></th>
<th class="text-right"><%= t("admin.actions.actions") %></th>
</thead>
<tbody>
<% @poll.officers.each do |officer| %>
@@ -21,6 +22,11 @@
<td>
<%= officer.email %>
</td>
<td class="text-right">
<%= link_to t("admin.polls.show.edit_officer_assignments"),
admin_officer_assignments_path(officer: officer, poll: @poll),
class: "button hollow" %>
</td>
</tr>
<% end %>
</tbody>

View File

@@ -5,11 +5,11 @@
<%= t('admin.polls.show.no_questions') %>
</div>
<% else %>
<table class="margin">
<table class="fixed margin">
<thead>
<tr>
<th><%= t('admin.polls.show.table_title') %></th>
<th class="text-center"><%= t('admin.polls.show.table_assignment') %></th>
<th class="text-right"><%= t('admin.polls.show.table_assignment') %></th>
</tr>
</thead>
<% @poll.questions.each do |question| %>
@@ -19,7 +19,7 @@
<%= link_to question.title, admin_question_path(question) %>
</strong>
</td>
<td class="text-center">
<td class="text-right">
<%= link_to t('admin.polls.show.remove_question'),
remove_question_admin_poll_path(poll_id: @poll.id, question_id: question.id),
class: "button hollow alert",

View File

@@ -5,7 +5,7 @@
<%= t("admin.polls.show.no_recounts") %>
</div>
<% else %>
<table class="margin">
<table class="fixed margin">
<thead>
<th><%= t("admin.polls.show.table_booth_name") %></th>
<th class="text-center"><%= t("admin.polls.show.table_recounts") %></th>
@@ -19,16 +19,20 @@
<%= link_to booth_assignment.booth.name, admin_poll_booth_assignment_path(@poll, booth_assignment, anchor: 'tab-recounts') %>
</strong>
</td>
<% if booth_assignment.recounts.any? %>
<td class="text-center"><%= booth_assignment.recounts.to_a.sum(&:count) %></td>
<% else %>
<td class="text-center"> - </td>
<% end %>
<% if booth_assignment.final_recounts.any? %>
<td class="text-center"><strong><%= booth_assignment.final_recounts.to_a.sum(&:count) %></strong></td>
<% else %>
<td class="text-center"> - </td>
<% end %>
<td class="text-center">
<% if booth_assignment.recounts.any? %>
<%= booth_assignment.recounts.to_a.sum(&:count) %>
<% else %>
<span>-</span>
<% end %>
</td>
<td class="text-center">
<% if booth_assignment.final_recounts.any? %>
<strong><%= booth_assignment.final_recounts.to_a.sum(&:count) %></strong>
<% else %>
<span>-</span>
<% end %>
</td>
</tr>
<% end %>
</tbody>