Group: new link on dashboard if admin. Fixed people count
This commit is contained in:
parent
26045d7a2c
commit
ce1b742b1e
|
@ -52,7 +52,7 @@ class GroupsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def people
|
def people
|
||||||
@users = group.users
|
@users = group.users.all
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -22,6 +22,10 @@ module Account
|
||||||
projects_limit > my_own_projects.count
|
projects_limit > my_own_projects.count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def can_create_group?
|
||||||
|
is_admin?
|
||||||
|
end
|
||||||
|
|
||||||
def last_activity_project
|
def last_activity_project
|
||||||
projects.first
|
projects.first
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
Groups
|
Groups
|
||||||
%small
|
%small
|
||||||
(#{groups.count})
|
(#{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
|
%ul.unstyled
|
||||||
- groups.each do |group|
|
- groups.each do |group|
|
||||||
%li.wll
|
%li.wll
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%h5
|
%h5
|
||||||
People
|
People
|
||||||
%small
|
%small
|
||||||
(#{@users.count})
|
(#{@users.size})
|
||||||
%ul.unstyled
|
%ul.unstyled
|
||||||
- @users.each do |user|
|
- @users.each do |user|
|
||||||
%li.wll
|
%li.wll
|
||||||
|
|
Loading…
Reference in a new issue