Fix display page and incorrect paths

pull/8520/head
Inga Mai 4 years ago
parent 1afc6782f7
commit 7779ca7a04
  1. 3
      app/controllers/settings/display_controller.rb
  2. 3
      app/controllers/settings_controller.rb
  3. 1
      app/helpers/settings_helper.rb
  4. 2
      config/initializers/menus.rb
  5. 4
      config/routes.rb

@ -31,6 +31,9 @@ class Settings::DisplayController < SettingsController
menu_item :settings_display
def show
@options = {}
@options[:user_format] = User::USER_FORMATS_STRUCTURE.keys.map { |f| [User.current.name(f), f.to_s] }
render template: 'settings/_display'
end
end

@ -45,9 +45,6 @@ class SettingsController < ApplicationController
end
def show
@options = {}
@options[:user_format] = User::USER_FORMATS_STRUCTURE.keys.map { |f| [User.current.name(f), f.to_s] }
@guessed_host = request.host_with_port.dup
@custom_style = CustomStyle.current || CustomStyle.new

@ -66,7 +66,6 @@ module SettingsHelper
end
end
def setting_select(setting, choices, options = {})
if blank_text = options.delete(:blank)
choices = [[blank_text.is_a?(Symbol) ? I18n.t(blank_text) : blank_text, '']] + choices

@ -217,7 +217,7 @@ Redmine::MenuManager.map :admin_menu do |menu|
icon: 'icon2 icon-enumerations'
menu.push :settings,
{ controller: '/settings/general', action: 'show' },
{ controller: '/settings', action: 'show' },
caption: :label_system_settings,
icon: 'icon2 icon-settings2'

@ -394,11 +394,11 @@ OpenProject::Application.routes.draw do
resource :mail_notifications, only: %i[show update]
end
get "settings", controller: "settings/general", action: 'show', as: "settings"
resource :settings, only: %i(update show) do
SettingsHelper.system_settings_tabs.each do |tab|
get "settings/#{tab[:name]}", controller: "settings/#{tab[:name]}", action: 'show', as: "settings_#{tab[:name]}"
get "#{tab[:name]}", controller: "settings/#{tab[:name]}", action: 'show', as: "settings_#{tab[:name]}"
end
get "settings", controller: "settings/general", action: 'show', as: "settings"
# We should fix this crappy routing (split up and rename controller methods)
collection do

Loading…
Cancel
Save