From 2e0456b2ac1d8893a69830755fba17942bcbb6cd Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 26 May 2009 16:12:34 -0300 Subject: [PATCH] ActionItem1050: don't add links that do not apply --- app/views/layouts/application-ng.rhtml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index 0601e95..6a1af92 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -55,8 +55,12 @@
<% if logged_in? %> <%= _('Welcome, %s.') % link_to('' + user.identifier + '', user.url, :id => "homepage-link", :title => _('Go to your homepage')) %> - <%= link_to('' + _('Administration') + '', { :controller => 'admin_panel', :action => 'index' }, :id => "controlpanel", :title => _("Configure the environment")) %> - <%= link_to('' + _('Control panel') + '', user.admin_url, :id => "controlpanel", :title => _("Configure your personal account and content")) %> + <% if user.is_admin?(environment) %> + <%= link_to('' + _('Administration') + '', { :controller => 'admin_panel', :action => 'index' }, :id => "controlpanel", :title => _("Configure the environment")) %> + <% end %> + <% if (user.environment == environment) %> + <%= link_to('' + _('Control panel') + '', user.admin_url, :id => "controlpanel", :title => _("Configure your personal account and content")) if (user.environment == environment) %> + <% end %> <%= link_to('' + _('Logout') + '', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) %> <% else %> <%= _('%s or %s') % [thickbox_inline_popup_link('' + _('Login') + '', 'inlineLoginBox', :id => 'link_login', :help => _('Click here to enter your username and password and be recognized by the system.')), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %> -- libgit2 0.21.2