diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index c76e5c4c0bd..5576bc03fc7 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -52,7 +52,7 @@ class GroupsController < ApplicationController end def people - @users = group.users + @users = group.users.all end protected diff --git a/app/roles/account.rb b/app/roles/account.rb index b8c445a3d58..af5b7c88437 100644 --- a/app/roles/account.rb +++ b/app/roles/account.rb @@ -22,6 +22,10 @@ module Account projects_limit > my_own_projects.count end + def can_create_group? + is_admin? + end + def last_activity_project projects.first end diff --git a/app/views/dashboard/_groups.html.haml b/app/views/dashboard/_groups.html.haml index 146a49e616f..7c5e9f3fab0 100644 --- a/app/views/dashboard/_groups.html.haml +++ b/app/views/dashboard/_groups.html.haml @@ -3,6 +3,11 @@ Groups %small (#{groups.count}) + - if current_user.can_create_group? + %span.right + = link_to new_admin_group_path, class: "btn very_small info" do + %i.icon-plus + New Group %ul.unstyled - groups.each do |group| %li.wll diff --git a/app/views/groups/people.html.haml b/app/views/groups/people.html.haml index 4c1865a2d6d..258108089c3 100644 --- a/app/views/groups/people.html.haml +++ b/app/views/groups/people.html.haml @@ -2,7 +2,7 @@ %h5 People %small - (#{@users.count}) + (#{@users.size}) %ul.unstyled - @users.each do |user| %li.wll