Refactor project creation. Added logout link to profile page

This commit is contained in:
GitLab 2013-01-17 17:35:57 +02:00
parent c7c1a97c2f
commit 232d61d598
19 changed files with 126 additions and 116 deletions

View file

@ -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]} ]