From aadcfd8668e01a8f56c196f800a288b8c1e73cb5 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 12 Apr 2016 14:33:37 +0200 Subject: [PATCH] Split manage into separate files. --- .../app/controllers/_manage/branding.coffee | 12 ++++ .../app/controllers/_manage/import.coffee | 13 ++++ .../app/controllers/_manage/security.coffee | 15 ++++ .../app/controllers/_manage/system.coffee | 16 +++++ .../app/controllers/_manage/ticket.coffee | 13 ++++ .../app/controllers/settings.coffee | 69 ------------------- 6 files changed, 69 insertions(+), 69 deletions(-) create mode 100644 app/assets/javascripts/app/controllers/_manage/branding.coffee create mode 100644 app/assets/javascripts/app/controllers/_manage/import.coffee create mode 100644 app/assets/javascripts/app/controllers/_manage/security.coffee create mode 100644 app/assets/javascripts/app/controllers/_manage/system.coffee create mode 100644 app/assets/javascripts/app/controllers/_manage/ticket.coffee delete mode 100644 app/assets/javascripts/app/controllers/settings.coffee diff --git a/app/assets/javascripts/app/controllers/_manage/branding.coffee b/app/assets/javascripts/app/controllers/_manage/branding.coffee new file mode 100644 index 000000000..e92a9b06c --- /dev/null +++ b/app/assets/javascripts/app/controllers/_manage/branding.coffee @@ -0,0 +1,12 @@ +class Branding extends App.ControllerTabs + header: 'Branding' + constructor: -> + super + return if !@authenticate(false, 'Admin') + @title 'Branding', true + @tabs = [ + { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'System::Branding' } } + ] + @render() + +App.Config.set('SettingBranding', { prio: 1200, parent: '#settings', name: 'Branding', target: '#settings/branding', controller: Branding, role: ['Admin'] }, 'NavBarAdmin') diff --git a/app/assets/javascripts/app/controllers/_manage/import.coffee b/app/assets/javascripts/app/controllers/_manage/import.coffee new file mode 100644 index 000000000..afe42c73f --- /dev/null +++ b/app/assets/javascripts/app/controllers/_manage/import.coffee @@ -0,0 +1,13 @@ +class Import extends App.ControllerTabs + header: 'Import' + constructor: -> + super + return if !@authenticate(false, 'Admin') + @title 'Import', true + @tabs = [ + { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'Import::Base' } } + { name: 'OTRS', 'target': 'otrs', controller: App.SettingsArea, params: { area: 'Import::OTRS' } } + ] + @render() + +App.Config.set('SettingImport', { prio: 1800, parent: '#settings', name: 'Import', target: '#settings/import', controller: Import, role: ['Admin'] }, 'NavBarAdmin') diff --git a/app/assets/javascripts/app/controllers/_manage/security.coffee b/app/assets/javascripts/app/controllers/_manage/security.coffee new file mode 100644 index 000000000..2465c92d9 --- /dev/null +++ b/app/assets/javascripts/app/controllers/_manage/security.coffee @@ -0,0 +1,15 @@ +class Security extends App.ControllerTabs + header: 'Security' + constructor: -> + super + return if !@authenticate(false, 'Admin') + @title 'Security', true + @tabs = [ + { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'Security::Base' } } +# { name: 'Authentication', 'target': 'auth', controller: App.SettingsArea, params: { area: 'Security::Authentication' } } + { name: 'Password', 'target': 'password', controller: App.SettingsArea, params: { area: 'Security::Password' } } + { name: 'Third-Party Applications', 'target': 'third_party_auth', controller: App.SettingsArea, params: { area: 'Security::ThirdPartyAuthentication' } } + ] + @render() + +App.Config.set('SettingSecurity', { prio: 1600, parent: '#settings', name: 'Security', target: '#settings/security', controller: Security, role: ['Admin'] }, 'NavBarAdmin') diff --git a/app/assets/javascripts/app/controllers/_manage/system.coffee b/app/assets/javascripts/app/controllers/_manage/system.coffee new file mode 100644 index 000000000..8ce48de3c --- /dev/null +++ b/app/assets/javascripts/app/controllers/_manage/system.coffee @@ -0,0 +1,16 @@ +class System extends App.ControllerTabs + header: 'System' + constructor: -> + super + return if !@authenticate(false, 'Admin') + @title 'System', true + @tabs = [] + if !App.Config.get('system_online_service') + @tabs.push { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'System::Base' } } + @tabs.push { name: 'Services', 'target': 'services', controller: App.SettingsArea, params: { area: 'System::Services' } } + if !App.Config.get('system_online_service') + @tabs.push { name: 'Storage', 'target': 'storage', controller: App.SettingsArea, params: { area: 'System::Storage' } } + @tabs.push { name: 'Frontend', 'target': 'ui', controller: App.SettingsArea, params: { area: 'System::UI' } } + @render() + +App.Config.set('SettingSystem', { prio: 1400, parent: '#settings', name: 'System', target: '#settings/system', controller: System, role: ['Admin'] }, 'NavBarAdmin') diff --git a/app/assets/javascripts/app/controllers/_manage/ticket.coffee b/app/assets/javascripts/app/controllers/_manage/ticket.coffee new file mode 100644 index 000000000..0b00cd808 --- /dev/null +++ b/app/assets/javascripts/app/controllers/_manage/ticket.coffee @@ -0,0 +1,13 @@ +class Ticket extends App.ControllerTabs + header: 'Ticket' + constructor: -> + super + return if !@authenticate(false, 'Admin') + @title 'Ticket', true + @tabs = [ + { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'Ticket::Base' } } + { name: 'Number', 'target': 'number', controller: App.SettingsArea, params: { area: 'Ticket::Number' } } + ] + @render() + +App.Config.set('SettingTicket', { prio: 1700, parent: '#settings', name: 'Ticket', target: '#settings/ticket', controller: Ticket, role: ['Admin'] }, 'NavBarAdmin') diff --git a/app/assets/javascripts/app/controllers/settings.coffee b/app/assets/javascripts/app/controllers/settings.coffee deleted file mode 100644 index 27c4eea27..000000000 --- a/app/assets/javascripts/app/controllers/settings.coffee +++ /dev/null @@ -1,69 +0,0 @@ -class Branding extends App.ControllerTabs - header: 'Branding' - constructor: -> - super - return if !@authenticate(false, 'Admin') - @title 'Branding', true - @tabs = [ - { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'System::Branding' } } - ] - @render() - -class System extends App.ControllerTabs - header: 'System' - constructor: -> - super - return if !@authenticate(false, 'Admin') - @title 'System', true - @tabs = [] - if !App.Config.get('system_online_service') - @tabs.push { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'System::Base' } } - @tabs.push { name: 'Services', 'target': 'services', controller: App.SettingsArea, params: { area: 'System::Services' } } - if !App.Config.get('system_online_service') - @tabs.push { name: 'Storage', 'target': 'storage', controller: App.SettingsArea, params: { area: 'System::Storage' } } - @tabs.push { name: 'Frontend', 'target': 'ui', controller: App.SettingsArea, params: { area: 'System::UI' } } - @render() - -class Security extends App.ControllerTabs - header: 'Security' - constructor: -> - super - return if !@authenticate(false, 'Admin') - @title 'Security', true - @tabs = [ - { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'Security::Base' } } -# { name: 'Authentication', 'target': 'auth', controller: App.SettingsArea, params: { area: 'Security::Authentication' } } - { name: 'Password', 'target': 'password', controller: App.SettingsArea, params: { area: 'Security::Password' } } - { name: 'Third-Party Applications', 'target': 'third_party_auth', controller: App.SettingsArea, params: { area: 'Security::ThirdPartyAuthentication' } } - ] - @render() - -class Import extends App.ControllerTabs - header: 'Import' - constructor: -> - super - return if !@authenticate(false, 'Admin') - @title 'Import', true - @tabs = [ - { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'Import::Base' } } - { name: 'OTRS', 'target': 'otrs', controller: App.SettingsArea, params: { area: 'Import::OTRS' } } - ] - @render() - -class Ticket extends App.ControllerTabs - header: 'Ticket' - constructor: -> - super - return if !@authenticate(false, 'Admin') - @title 'Ticket', true - @tabs = [ - { name: 'Base', 'target': 'base', controller: App.SettingsArea, params: { area: 'Ticket::Base' } } - { name: 'Number', 'target': 'number', controller: App.SettingsArea, params: { area: 'Ticket::Number' } } - ] - @render() - -App.Config.set('SettingBranding', { prio: 1200, parent: '#settings', name: 'Branding', target: '#settings/branding', controller: Branding, role: ['Admin'] }, 'NavBarAdmin') -App.Config.set('SettingSystem', { prio: 1400, parent: '#settings', name: 'System', target: '#settings/system', controller: System, role: ['Admin'] }, 'NavBarAdmin') -App.Config.set('SettingSecurity', { prio: 1600, parent: '#settings', name: 'Security', target: '#settings/security', controller: Security, role: ['Admin'] }, 'NavBarAdmin') -App.Config.set('SettingTicket', { prio: 1700, parent: '#settings', name: 'Ticket', target: '#settings/ticket', controller: Ticket, role: ['Admin'] }, 'NavBarAdmin') -App.Config.set('SettingImport', { prio: 1800, parent: '#settings', name: 'Import', target: '#settings/import', controller: Import, role: ['Admin'] }, 'NavBarAdmin')