Commit ce1b742b1e61d8726078e0060ba52aa8b9985c1b
1 parent
26045d7a
Exists in
master
and in
4 other branches
Group: new link on dashboard if admin. Fixed people count
Showing
4 changed files
with
11 additions
and
2 deletions
Show diff stats
app/controllers/groups_controller.rb
app/roles/account.rb
@@ -22,6 +22,10 @@ module Account | @@ -22,6 +22,10 @@ module Account | ||
22 | projects_limit > my_own_projects.count | 22 | projects_limit > my_own_projects.count |
23 | end | 23 | end |
24 | 24 | ||
25 | + def can_create_group? | ||
26 | + is_admin? | ||
27 | + end | ||
28 | + | ||
25 | def last_activity_project | 29 | def last_activity_project |
26 | projects.first | 30 | projects.first |
27 | end | 31 | end |
app/views/dashboard/_groups.html.haml
@@ -3,6 +3,11 @@ | @@ -3,6 +3,11 @@ | ||
3 | Groups | 3 | Groups |
4 | %small | 4 | %small |
5 | (#{groups.count}) | 5 | (#{groups.count}) |
6 | + - if current_user.can_create_group? | ||
7 | + %span.right | ||
8 | + = link_to new_admin_group_path, class: "btn very_small info" do | ||
9 | + %i.icon-plus | ||
10 | + New Group | ||
6 | %ul.unstyled | 11 | %ul.unstyled |
7 | - groups.each do |group| | 12 | - groups.each do |group| |
8 | %li.wll | 13 | %li.wll |