Merge branch 'feature/maintenance_message' of https://github.com/martini/zammad into feature/maintenance_message
This commit is contained in:
commit
077f793934
3 changed files with 71 additions and 0 deletions
21
app/assets/javascripts/app/controllers/maintenance.js.coffee
Normal file
21
app/assets/javascripts/app/controllers/maintenance.js.coffee
Normal file
|
@ -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' )
|
|
@ -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' )
|
22
app/assets/javascripts/app/views/maintenance.jst.eco
Normal file
22
app/assets/javascripts/app/views/maintenance.jst.eco
Normal file
|
@ -0,0 +1,22 @@
|
|||
<div class="page-header">
|
||||
<h1>Maintenance Message<small></small></h1>
|
||||
</div>
|
||||
<form class="form-horizontal" id="maintenanceForm">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="HeaderText">Header Text</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="HeaderText" name="HeaderText" placeholder="Header Text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="Message">Message</label>
|
||||
<div class="controls">
|
||||
<textarea id="Message" name="Message" class="" rows="8" placeholder="Maintenance Message"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn">Send Message</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
Loading…
Reference in a new issue