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 new file mode 100644 index 000000000..9b927e8bf --- /dev/null +++ b/app/assets/javascripts/app/controllers/maintenance_widget.js.coffee @@ -0,0 +1,28 @@ +class App.MaintananceWidget extends App.Controller + constructor: -> + super + + # 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 + constructor: -> + super + @render() + + render: -> + @html App.view('modal')( + title: @title, + message: @message + detail: @detail + close: @close + ) + @modalShow( + 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