diff --git a/app/assets/javascripts/app/controllers/maintenance.js.coffee b/app/assets/javascripts/app/controllers/maintenance.js.coffee new file mode 100644 index 000000000..682e807d3 --- /dev/null +++ b/app/assets/javascripts/app/controllers/maintenance.js.coffee @@ -0,0 +1,21 @@ +class App.Maintenance extends App.ControllerContent + events: + 'submit form': 'sendMessage' + constructor: -> + super + # render page + @render() + + render: -> + + @html App.view('maintenance')() + + sendMessage: (e) -> + e.preventDefault() + params = @formParam(e.target) + console.log(params) + App.Event.trigger('session:maintanance', {title: params.HeaderText, message: params.Message}) + + +App.Config.set( 'maintenance', App.Maintenance, 'Routes' ) +App.Config.set( 'maintenance', { prio: 3600, parent: '#admin', name: 'Maintenance Message', target: '#maintenance', role: ['Admin'] }, 'NavBar' ) \ No newline at end of file diff --git a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee index 206f463d3..9b927e8bf 100644 --- a/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -5,6 +5,7 @@ class App.MaintananceWidget extends App.Controller # bind on event to show message App.Event.bind 'session:maintanance', (data) => console.log('hannes was here') + new Message(data) class Message extends App.ControllerModal @@ -14,14 +15,14 @@ class Message extends App.ControllerModal render: -> @html App.view('modal')( - title: 'Maintanance Message', + title: @title, message: @message detail: @detail close: @close ) @modalShow( - backdrop: false, - keyboard: false, + backdrop: true, + keyboard: true, ) App.Config.set( 'maintanance', App.MaintananceWidget, 'Widgets' ) diff --git a/app/assets/javascripts/app/views/maintenance.jst.eco b/app/assets/javascripts/app/views/maintenance.jst.eco new file mode 100644 index 000000000..f4b75acb9 --- /dev/null +++ b/app/assets/javascripts/app/views/maintenance.jst.eco @@ -0,0 +1,22 @@ + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
\ No newline at end of file