improves styles for admin officers views

This commit is contained in:
Alberto Garcia Cabeza
2016-12-14 18:13:33 +01:00
parent cbbc3ed1be
commit b290a776dd
5 changed files with 60 additions and 36 deletions

View File

@@ -1,26 +1,30 @@
<div class="small-12 column">
<table>
<tbody>
<tr>
<td>
<%= officer.name %>
</td>
<td>
<%= officer.email %>
</td>
<td class="text-right">
<% if officer.persisted? %>
<%= link_to t('admin.poll_officers.officer.delete'),
admin_poll_officer_path(officer),
method: :delete,
class: "button hollow alert" %>
<% else %>
<%= link_to t('admin.poll_officers.officer.add'),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
method: :post,
class: "button success" %>
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<table>
<thead>
<tr>
<th><%= t('admin.poll_officers.officer.name') %></th>
<th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<%= officer.name %>
</td>
<td>
<%= officer.email %>
</td>
<td class="text-right">
<% if officer.persisted? %>
<%= link_to t('admin.poll_officers.officer.delete'),
admin_poll_officer_path(officer),
method: :delete,
class: "button hollow alert" %>
<% else %>
<%= link_to t('admin.poll_officers.officer.add'),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
method: :post,
class: "button success" %>
<% end %>
</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,9 @@
<%= form_tag search_admin_officers_path, method: :get, remote: true do %>
<div class="input-group">
<%= text_field_tag :email, '',
placeholder: t("admin.poll_officers.search.email_placeholder") %>
<div class="input-group-button">
<%= submit_tag t("admin.poll_officers.search.search"), class: "button" %>
</div>
</div>
<% end %>

View File

@@ -1,21 +1,25 @@
<h2><%= t("admin.poll_officers.index.title") %></h2>
<div class="row">
<%= form_tag search_admin_officers_path, method: :get, remote: true do %>
<div class="small-12 medium-6 column">
<%= text_field_tag :email, '', placeholder: t('admin.poll_officers.search.email_placeholder') %>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.poll_officers.search.search'), class: 'button' %>
</div>
<% end %>
<div class="small-12 medium-6 column">
<%= render 'search' %>
</div>
</div>
<div id="search-result" class="row"></div>
<div id="search-result"></div>
<h3><%= page_entries_info @officers %></h3>
<h3>
<%= page_entries_info @officers, entry_name: t('admin.poll_officers.officer.entry_name') %>
</h3>
<table id="officers">
<thead>
<tr>
<th><%= t('admin.poll_officers.officer.name') %></th>
<th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
</tr>
</thead>
<tbody>
<% @officers.each do |officer| %>
<tr>
<td>
@@ -41,6 +45,7 @@
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @officers %>