From c4895b3fdf71274568c35785e9fc495d6c027100 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 7 Nov 2012 09:10:17 +0100 Subject: [PATCH] Added controller for overviews. --- .../app/controllers/overview.js.coffee | 31 +++++++++++++++++++ .../app/controllers/text_module.js.coffee | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/app/controllers/overview.js.coffee diff --git a/app/assets/javascripts/app/controllers/overview.js.coffee b/app/assets/javascripts/app/controllers/overview.js.coffee new file mode 100644 index 000000000..461097153 --- /dev/null +++ b/app/assets/javascripts/app/controllers/overview.js.coffee @@ -0,0 +1,31 @@ +$ = jQuery.sub() + +class Index extends App.Controller + constructor: -> + super + + # check authentication + return if !@authenticate() + + new App.ControllerGenericIndex( + el: @el, + id: @id, + genericObject: 'TextModule', + pageData: { + title: 'TextModules', + home: 'text_modules', + object: 'TextModule', + objects: 'TextModules', + navupdate: '#text_modules', + notes: [ + 'TextModules are ...' + ], + buttons: [ + { name: 'New TextModule', 'data-type': 'new', class: 'primary' }, + ], + }, + ) + +App.Config.set( 'overviews', Index, 'Routes' ) +App.Config.set( 'Overview', { prio: 2300, parent: '#admin', name: 'Overviews', target: '#overviews', role: ['Admin'] }, 'NavBar' ) + diff --git a/app/assets/javascripts/app/controllers/text_module.js.coffee b/app/assets/javascripts/app/controllers/text_module.js.coffee index 6c7f4fcf2..52b15b64e 100644 --- a/app/assets/javascripts/app/controllers/text_module.js.coffee +++ b/app/assets/javascripts/app/controllers/text_module.js.coffee @@ -27,5 +27,5 @@ class Index extends App.Controller ) App.Config.set( 'text_modules', Index, 'Routes' ) -App.Config.set( 'AdminTextModule', { prio: 2300, parent: '#admin', name: 'Text Modules', target: '#text_modules', role: ['Admin'] }, 'NavBar' ) +App.Config.set( 'TextModule', { prio: 2300, parent: '#admin', name: 'Text Modules', target: '#text_modules', role: ['Admin'] }, 'NavBar' )