Skip to content
Snippets Groups Projects
Commit 0c7e8a74 authored by Alexandre Peres Arias's avatar Alexandre Peres Arias
Browse files

fix curators and admins management

parent 302cfa73
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,23 @@ class Management::UsersController < ManagementController
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
# Use callbacks to share common setup or constraints between actions.
......
......@@ -4,12 +4,8 @@
novo</a>
<% admins = Array.new %>
<% @users = User.includes(:roles).all%>
<% @users.all.each do |user|%>
<% admins << user if user.roles[0].name == "admin" %>
<% end %>
<% if admins[0].nil? %>
<% if @admins.empty? %>
<BR><BR><h3>Não há adminstradores cadastrados</h3>
<% else %>
......@@ -51,7 +47,7 @@
</thead>
<tbody>
<% admins.each do |c| %>
<% @admins.each do |c| %>
<tr>
<td>
<a href="#"><%= c.name %></a>
......
......@@ -4,12 +4,8 @@
novo</a>
<% curators = Array.new %>
<% @users = User.includes(:roles).all%>
<% @users.all.each do |user|%>
<% curators << user if user.roles[0].name == "curator" %>
<% end %>
<% if curators[0].nil? %>
<% if @curators.empty? %>
<BR><BR><h3>Não há curadores cadastrados</h3>
<% else %>
......@@ -51,7 +47,7 @@
</thead>
<tbody>
<% curators.each do |c| %>
<% @curators.each do |c| %>
<tr>
<td>
<a href="#"><%= c.name %></a>
......
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