View and search users from admin panel

This commit is contained in:
Amaia Castro
2017-05-27 17:11:57 +02:00
parent 29d994dd4a
commit b616210607
11 changed files with 119 additions and 1 deletions

View File

@@ -118,6 +118,10 @@
<li <%= "class=active" if controller_name == "managers" %>>
<%= link_to t('admin.menu.managers'), admin_managers_path %>
</li>
<li <%= 'class=active' if controller_name == 'users' %>>
<%= link_to t('admin.menu.users'), admin_users_path %>
</li>
</ul>
</li>

View File

@@ -0,0 +1,22 @@
<h3><%= page_entries_info @users %></h3>
<table>
<thead>
<tr>
<th><%= t('admin.users.fields.name') %></th>
<th><%= t('admin.users.fields.email') %></th>
<th><%= t('admin.users.fields.document_number') %></th>
<th><%= t('admin.users.fields.verification_level') %></th>
</tr>
</thead>
<% @users.each do |user| %>
<tr>
<td><%= user.name %></td>
<td><%= user.email %></td>
<td><%= user.document_number %></td>
<td><%= user.user_type %></td>
</tr>
<% end %>
</table>
<%= paginate @users %>

View File

@@ -0,0 +1,16 @@
<h2><%= t("admin.users.index.title") %></h2>
<div class="row">
<%= form_tag admin_users_path, method: :get, remote: true do %>
<div class="small-12 medium-6 column">
<%= text_field_tag :search, '', placeholder: t('admin.users.search.placeholder') %>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.users.search.search'), class: 'button' %>
</div>
<% end %>
</div>
<div id="users">
<%= render "users" %>
</div>

View File

@@ -0,0 +1 @@
$("#users").html("<%= j render 'users' %>");