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 menu_item :settings_display
def show def show
@options = {}
@options[:user_format] = User::USER_FORMATS_STRUCTURE.keys.map { |f| [User.current.name(f), f.to_s] }
render template: 'settings/_display' render template: 'settings/_display'
end end
end end

@ -45,9 +45,6 @@ class SettingsController < ApplicationController
end end
def show 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 @guessed_host = request.host_with_port.dup
@custom_style = CustomStyle.current || CustomStyle.new @custom_style = CustomStyle.current || CustomStyle.new

@ -66,7 +66,6 @@ module SettingsHelper
end end
end end
def setting_select(setting, choices, options = {}) def setting_select(setting, choices, options = {})
if blank_text = options.delete(:blank) if blank_text = options.delete(:blank)
choices = [[blank_text.is_a?(Symbol) ? I18n.t(blank_text) : blank_text, '']] + choices 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' icon: 'icon2 icon-enumerations'
menu.push :settings, menu.push :settings,
{ controller: '/settings/general', action: 'show' }, { controller: '/settings', action: 'show' },
caption: :label_system_settings, caption: :label_system_settings,
icon: 'icon2 icon-settings2' icon: 'icon2 icon-settings2'

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

Loading…
Cancel
Save