From b699ab73d14be7d413eb5b792d03c66d1b80341c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 15 Sep 2014 14:09:02 +0200 Subject: [PATCH] Added layout references to users with role admin. --- .../app/controllers/layout_ref.js.coffee | 66 +++++++++++++++++++ .../javascripts/app/views/dashboard.jst.eco | 2 +- .../app/views/layout_ref/content.jst.eco | 52 +++++++++++++++ .../layout_ref/content_sidebar_left.jst.eco | 27 ++++++++ .../layout_ref/content_sidebar_right.jst.eco | 28 ++++++++ ...ent_sidebar_right_sidebar_optional.jst.eco | 28 ++++++++ .../content_sidebar_tabs_right.jst.eco | 28 ++++++++ .../app/views/layout_ref/index.jst.eco | 14 ++++ app/assets/stylesheets/zzz.css.erb | 4 +- 9 files changed, 246 insertions(+), 3 deletions(-) create mode 100644 app/assets/javascripts/app/controllers/layout_ref.js.coffee create mode 100644 app/assets/javascripts/app/views/layout_ref/content.jst.eco create mode 100644 app/assets/javascripts/app/views/layout_ref/content_sidebar_left.jst.eco create mode 100644 app/assets/javascripts/app/views/layout_ref/content_sidebar_right.jst.eco create mode 100644 app/assets/javascripts/app/views/layout_ref/content_sidebar_right_sidebar_optional.jst.eco create mode 100644 app/assets/javascripts/app/views/layout_ref/content_sidebar_tabs_right.jst.eco create mode 100644 app/assets/javascripts/app/views/layout_ref/index.jst.eco diff --git a/app/assets/javascripts/app/controllers/layout_ref.js.coffee b/app/assets/javascripts/app/controllers/layout_ref.js.coffee new file mode 100644 index 000000000..983bd4dc2 --- /dev/null +++ b/app/assets/javascripts/app/controllers/layout_ref.js.coffee @@ -0,0 +1,66 @@ +class Index extends App.ControllerContent + constructor: -> + super + @render() + + render: -> + @html App.view('layout_ref/index')() + +App.Config.set( 'layout_ref', Index, 'Routes' ) + + +class Content extends App.ControllerContent + constructor: -> + super + @render() + + render: -> + @html App.view('layout_ref/content')() + +App.Config.set( 'layout_ref/content', Content, 'Routes' ) + + +class ContentSidebarRight extends App.ControllerContent + constructor: -> + super + @render() + + render: -> + @html App.view('layout_ref/content_sidebar_right')() + +App.Config.set( 'layout_ref/content_sidebar_right', ContentSidebarRight, 'Routes' ) + + +class ContentSidebarRightSidebarOptional extends App.ControllerContent + constructor: -> + super + @render() + + render: -> + @html App.view('layout_ref/content_sidebar_right_sidebar_optional')() + +App.Config.set( 'layout_ref/content_sidebar_right_sidebar_optional', ContentSidebarRightSidebarOptional, 'Routes' ) + + +class ContentSidebarTabsRight extends App.ControllerContent + constructor: -> + super + @render() + + render: -> + @html App.view('layout_ref/content_sidebar_tabs_right')() + +App.Config.set( 'layout_ref/content_sidebar_tabs_right', ContentSidebarTabsRight, 'Routes' ) + + +class ContentSidebarLeft extends App.ControllerContent + constructor: -> + super + @render() + + render: -> + @html App.view('layout_ref/content_sidebar_left')() + +App.Config.set( 'layout_ref/content_sidebar_left', ContentSidebarLeft, 'Routes' ) + +App.Config.set( 'LayoutRef', { prio: 1700, parent: '#current_user', name: 'Layout Reference', target: '#layout_ref', role: [ 'Admin' ] }, 'NavBarRight' ) diff --git a/app/assets/javascripts/app/views/dashboard.jst.eco b/app/assets/javascripts/app/views/dashboard.jst.eco index 64c2e8c89..a65a822db 100644 --- a/app/assets/javascripts/app/views/dashboard.jst.eco +++ b/app/assets/javascripts/app/views/dashboard.jst.eco @@ -119,6 +119,6 @@
-