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>
<table> <thead>
<tbody> <tr>
<tr> <th><%= t('admin.poll_officers.officer.name') %></th>
<td> <th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
<%= officer.name %> </tr>
</td> </thead>
<td> <tbody>
<%= officer.email %> <tr>
</td> <td>
<td class="text-right"> <%= officer.name %>
<% if officer.persisted? %> </td>
<%= link_to t('admin.poll_officers.officer.delete'), <td>
admin_poll_officer_path(officer), <%= officer.email %>
method: :delete, </td>
class: "button hollow alert" %> <td class="text-right">
<% else %> <% if officer.persisted? %>
<%= link_to t('admin.poll_officers.officer.add'),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id }, <%= link_to t('admin.poll_officers.officer.delete'),
method: :post, admin_poll_officer_path(officer),
class: "button success" %> method: :delete,
<% end %> class: "button hollow alert" %>
</td> <% else %>
</tr> <%= link_to t('admin.poll_officers.officer.add'),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
</tbody> method: :post,
</table> class: "button success" %>
</div> <% 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> <h2><%= t("admin.poll_officers.index.title") %></h2>
<div class="row"> <div class="row">
<%= form_tag search_admin_officers_path, method: :get, remote: true do %> <div class="small-12 medium-6 column">
<div class="small-12 medium-6 column"> <%= render 'search' %>
<%= text_field_tag :email, '', placeholder: t('admin.poll_officers.search.email_placeholder') %> </div>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.poll_officers.search.search'), class: 'button' %>
</div>
<% end %>
</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"> <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| %> <% @officers.each do |officer| %>
<tr> <tr>
<td> <td>
@@ -41,6 +45,7 @@
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</table> </table>
<%= paginate @officers %> <%= paginate @officers %>

View File

@@ -154,6 +154,9 @@ en:
officer: officer:
add: Add add: Add
delete: Delete delete: Delete
name: Name
email: Email
entry_name: officer
search: search:
email_placeholder: Search user by email email_placeholder: Search user by email
search: Search search: Search

View File

@@ -154,6 +154,9 @@ es:
officer: officer:
add: Añadir como Presidente de mesa add: Añadir como Presidente de mesa
delete: Borrar delete: Borrar
name: Nombre
email: Email
entry_name: presidente de mesa
search: search:
email_placeholder: Buscar usuario por email email_placeholder: Buscar usuario por email
search: Buscar search: Buscar