Skip to content

Commit

Permalink
Added an option in plugin settings so that admin links can be hidden …
Browse files Browse the repository at this point in the history
…(closes #17)
  • Loading branch information
jbbarth committed Feb 20, 2010
1 parent 14cd79f commit fb04965
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/layouts/datacenter.html.erb
@@ -1,6 +1,6 @@
<% content_for :sidebar do %>
<div id="admin-menu">
<% if User.current.admin? %>
<% if User.current.admin? && !Setting[:plugin_datacenter_plugin][:hide_admin_links] %>
<h3><%=l(:label_administration)%></h3>
<ul>
<li><%= link_to l(:label_project_plural), {:controller => 'admin', :action => 'projects'}, :class => 'projects' %></li>
Expand Down
5 changes: 5 additions & 0 deletions app/views/settings/_redmine_datacenter.html.erb
Expand Up @@ -3,3 +3,8 @@
<%= hidden_field_tag 'settings[multiple_select]', 0 %>
<%= check_box_tag 'settings[multiple_select]', "1", Setting.datacenter_multiselect? %>
</p>
<p>
<label><%= l(:text_hide_admin_links_in_sidebar) %></label>
<%= check_box_tag 'settings[hide_admin_links]', 1,
Setting[:plugin_datacenter_plugin][:hide_admin_links] %>
</p>
2 changes: 2 additions & 0 deletions config/locales/en.yml
Expand Up @@ -41,3 +41,5 @@ en:
field_appli: Application
field_appli_instance_ids: Applications
field_server_ids: Servers

text_hide_admin_links_in_sidebar: Hide admin links in sidebar ?
2 changes: 2 additions & 0 deletions config/locales/fr.yml
Expand Up @@ -41,3 +41,5 @@ fr:
field_appli: Application
field_appli_instance_ids: Applications
field_server_ids: Serveurs

text_hide_admin_links_in_sidebar: Cacher les liens d'administration sur le côté ?
1 change: 1 addition & 0 deletions init.rb
Expand Up @@ -45,6 +45,7 @@

settings :default => {
'multiple_select' => "1", #false=checkboxes, true=multiple_select
'hide_admin_links' => false,
'domain' => ""
},
:partial => 'settings/redmine_datacenter'
Expand Down

0 comments on commit fb04965

Please sign in to comment.