View and search users from admin panel
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
22
app/views/admin/users/_users.html.erb
Normal file
22
app/views/admin/users/_users.html.erb
Normal 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 %>
|
||||
16
app/views/admin/users/index.html.erb
Normal file
16
app/views/admin/users/index.html.erb
Normal 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>
|
||||
1
app/views/admin/users/index.js.erb
Normal file
1
app/views/admin/users/index.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#users").html("<%= j render 'users' %>");
|
||||
Reference in New Issue
Block a user