diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index db14797..70e0985 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1140,6 +1140,17 @@ module ApplicationHelper end end + def manage_communities + return if not user + administered_communities = user.communities.select {|c| c.admins.include? user} + if !administered_communities.empty? + communities_link = administered_communities.map do |community| + link_to(content_tag('strong', [_('Manage %s') % community.short_name(25)]), @environment.top_url + "/myprofile/#{community.identifier}", :class => "icon-menu-"+community.class.identification.underscore, :title => [_('Manage %s') % community.short_name]) + end + render :partial => 'shared/manage_communities', :locals => {:communities_link => communities_link} + end + end + def usermenu_logged_in pending_tasks_count = '' count = user ? Task.to(user).pending.count : -1 @@ -1151,6 +1162,7 @@ module ApplicationHelper render_environment_features(:usermenu) + link_to('' + _('Administration') + '', @environment.top_url + '/admin', :id => "controlpanel", :title => _("Configure the environment"), :class => 'admin-link', :style => 'display: none') + manage_enterprises.to_s + + manage_communities.to_s + link_to('' + _('Control panel') + '', @environment.top_url + '/myprofile/{login}', :id => "controlpanel", :title => _("Configure your personal account and content")) + pending_tasks_count + link_to('' + _('Logout') + '', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) diff --git a/app/views/shared/_manage_enterprises.rhtml b/app/views/shared/_manage_enterprises.rhtml index 5e4a895..a92fd13 100644 --- a/app/views/shared/_manage_enterprises.rhtml +++ b/app/views/shared/_manage_enterprises.rhtml @@ -1,8 +1,8 @@ -