Skip to content
Snippets Groups Projects
Commit 685a124d authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

Merge branch 'manage-admin_curator'

parents ba0c77a1 0c7e8a74
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,23 @@ class Management::UsersController < ManagementController ...@@ -71,6 +71,23 @@ class Management::UsersController < ManagementController
end end
end end
def curators
@curators = Array.new
@users = User.includes(:roles).all
@users.all.each do |user|
@curators << user if user.roles[0].name == "curator"
end
end
def admins
@admins = Array.new
@users = User.includes(:roles).all
@users.all.each do |user|
@admins << user if user.roles[0].name == "admin"
end
end
private private
# Use callbacks to share common setup or constraints between actions. # Use callbacks to share common setup or constraints between actions.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
novo</a> novo</a>
<% if @admins.empty? %> <% if @admins.empty? %>
<BR><BR><h3>Não há adminstradores cadastrados</h3> <br /><br /><h3>Não há adminstradores cadastrados</h3>
<% else %> <% else %>
<div class="ls-box-filter"> <div class="ls-box-filter">
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
<a href="#" class="ls-btn-primary" aria-expanded="false" role="combobox">Cadastrar <a href="#" class="ls-btn-primary" aria-expanded="false" role="combobox">Cadastrar
novo</a> novo</a>
<% if @curators.empty? %> <% if @curators.empty? %>
<BR><BR><h3>Não há curadores cadastrados</h3> <br /><br /><h3>Não há curadores cadastrados</h3>
<% else %> <% else %>
<div class="ls-box-filter"> <div class="ls-box-filter">
...@@ -46,11 +45,12 @@ ...@@ -46,11 +45,12 @@
</thead> </thead>
<tbody> <tbody>
<% @curators.each do |c| %>
<tr> <% @curators.each do |c| %>
<td> <tr>
<a href="#"><%= c.name %></a> <td>
<span class="ls-tag hidden-xs"><%= c.roles[0].name %></span> <a href="#"><%= c.name %></a>
<span class="ls-tag hidden-xs"><%= c.roles[0].name %></span>
</td> </td>
<td class="ls-txt-center hidden-xs"> <td class="ls-txt-center hidden-xs">
<small class="ls-display-block"><b>Último acesso:</b> <%= c.current_sign_in_at.to_date %></small> <small class="ls-display-block"><b>Último acesso:</b> <%= c.current_sign_in_at.to_date %></small>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment