Refactor project creation. Added logout link to profile page
This commit is contained in:
parent
c7c1a97c2f
commit
232d61d598
19 changed files with 126 additions and 116 deletions
|
@ -1,12 +1,13 @@
|
|||
module NamespacesHelper
|
||||
def namespaces_options(selected = :current_user, scope = :default)
|
||||
groups = current_user.owned_groups.select {|n| n.type == 'Group'}
|
||||
if current_user.admin
|
||||
groups = Group.all
|
||||
users = Namespace.root
|
||||
else
|
||||
groups = current_user.owned_groups.select {|n| n.type == 'Group'}
|
||||
users = current_user.namespaces.reject {|n| n.type == 'Group'}
|
||||
end
|
||||
|
||||
users = if scope == :all
|
||||
Namespace.root
|
||||
else
|
||||
current_user.namespaces.reject {|n| n.type == 'Group'}
|
||||
end
|
||||
|
||||
global_opts = ["Global", [['/', Namespace.global_id]] ]
|
||||
group_opts = ["Groups", groups.map {|g| [g.human_name, g.id]} ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue