diff options
author | randx <dmitriy.zaporozhets@gmail.com> | 2012-10-09 09:46:20 +0300 |
---|---|---|
committer | randx <dmitriy.zaporozhets@gmail.com> | 2012-10-09 09:46:20 +0300 |
commit | ce1b742b1e61d8726078e0060ba52aa8b9985c1b (patch) | |
tree | f0931e9d98601cd37d27d79873e46e7425eadaf4 | |
parent | 26045d7a2ce7f40becd179aa3b4222e2df8f5426 (diff) | |
download | gitlab-ce-ce1b742b1e61d8726078e0060ba52aa8b9985c1b.tar.gz |
Group: new link on dashboard if admin. Fixed people count
-rw-r--r-- | app/controllers/groups_controller.rb | 2 | ||||
-rw-r--r-- | app/roles/account.rb | 4 | ||||
-rw-r--r-- | app/views/dashboard/_groups.html.haml | 5 | ||||
-rw-r--r-- | app/views/groups/people.html.haml | 2 |
4 files changed, 11 insertions, 2 deletions
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 |