Add new admin menu node "Budgets" && remove Plugin configure link

pull/7444/head
Henriette Dinger 5 years ago
parent 21967f3099
commit 69cdbade42
  1. 8
      app/controllers/settings_controller.rb
  2. 2
      app/views/admin/plugins.html.erb
  3. 10
      config/initializers/menus.rb
  4. 5
      modules/costs/lib/open_project/costs/engine.rb

@ -33,9 +33,15 @@ class SettingsController < ApplicationController
before_action :require_admin
current_menu_item do |controller|
current_menu_item [:index, :edit] do
:settings
end
current_menu_item :plugin do |controller|
plugin = Redmine::Plugin.find(controller.params[:id])
plugin.settings[:menu_item] || :settings
rescue Redmine::PluginNotFound
:settings
end
def index

@ -36,7 +36,6 @@ See docs/COPYRIGHT.rdoc for more details.
<col>
<col>
<col>
<col>
</colgroup>
<tbody>
<% @plugins.each do |plugin| %>
@ -53,7 +52,6 @@ See docs/COPYRIGHT.rdoc for more details.
<%= h plugin.version %>
<% end %>
</td>
<td class="configure"><%= link_to(l(:button_configure), controller: '/settings', action: 'plugin', id: plugin.id) if plugin.configurable? %></td>
</tr>
<% end %>
</tbody>

@ -261,6 +261,16 @@ Redmine::MenuManager.map :admin_menu do |menu|
icon: 'icon2 icon-headset',
if: proc { OpenProject::Configuration.ee_manager_visible? }
menu.push :admin_costs,
{ controller: '/settings', action: 'plugin', id: :openproject_costs },
caption: :label_cost_object_plural,
icon: 'icon2 icon-budget'
menu.push :costs_setting,
{ controller: '/settings', action: 'plugin', id: :openproject_costs },
caption: :label_settings,
parent: :admin_costs
menu.push :admin_backlogs,
{ controller: '/settings', action: 'plugin', id: :openproject_backlogs },
caption: :label_backlogs,

@ -30,7 +30,8 @@ module OpenProject::Costs
bundled: true,
settings: {
default: { 'costs_currency' => 'EUR','costs_currency_format' => '%n %u' },
partial: 'settings/openproject_costs'
partial: 'settings/openproject_costs',
menu_item: :costs_setting
},
name: 'OpenProject Costs' do
@ -66,7 +67,7 @@ module OpenProject::Costs
menu :admin_menu,
:cost_types,
{ controller: '/cost_types', action: 'index' },
icon: 'icon2 icon-cost-types',
parent: :admin_costs,
caption: :label_cost_type_plural
menu :project_menu,

Loading…
Cancel
Save