Replaced App.ControllerModal by App.ControllerModalNice to support also translation inline feature (ctrl+alt+t) for modal dialog screens.
This commit is contained in:
parent
3a649527bc
commit
8800b6b61a
40 changed files with 589 additions and 646 deletions
|
@ -568,55 +568,79 @@ class App.ControllerContent extends App.Controller
|
||||||
$('#content').removeClass('hide')
|
$('#content').removeClass('hide')
|
||||||
@navShow()
|
@navShow()
|
||||||
|
|
||||||
class App.ControllerModal extends App.Controller
|
class App.ControllerModalNice extends App.Controller
|
||||||
elements:
|
backdrop: true
|
||||||
'.modal-body': 'body'
|
keyboard: true
|
||||||
|
large: false
|
||||||
|
head: '?'
|
||||||
|
container: null
|
||||||
|
buttonClass: 'btn--success'
|
||||||
|
centerButtons: []
|
||||||
|
buttonClose: true
|
||||||
|
buttonCancel: false
|
||||||
|
buttonSubmit: true
|
||||||
|
headPrefix: ''
|
||||||
|
shown: true
|
||||||
|
|
||||||
events:
|
events:
|
||||||
'submit form': 'onSubmit'
|
'submit form': 'submit'
|
||||||
'click .js-submit:not(.is-disabled)': 'onSubmit'
|
'click .js-submit:not(.is-disabled)': 'submit'
|
||||||
'click .js-cancel': 'hide'
|
'click .js-cancel': 'cancel'
|
||||||
'click .js-close': 'hide'
|
'click .js-close': 'close'
|
||||||
|
|
||||||
className: 'modal fade'
|
className: 'modal fade'
|
||||||
|
|
||||||
constructor: (options = {}) ->
|
constructor: ->
|
||||||
defaults =
|
@className += ' modal--large' if @large
|
||||||
backdrop: true
|
super
|
||||||
keyboard: true
|
|
||||||
close: true
|
|
||||||
large: false
|
|
||||||
head: '?'
|
|
||||||
buttonClass: 'btn--success'
|
|
||||||
centerButtons: []
|
|
||||||
container: null
|
|
||||||
|
|
||||||
options = _.extend( defaults, options )
|
|
||||||
|
|
||||||
@className += ' modal--large' if options.large
|
|
||||||
|
|
||||||
super(options)
|
|
||||||
|
|
||||||
|
# rerender view, e. g. on langauge change
|
||||||
|
@bind('ui:rerender', =>
|
||||||
|
@update()
|
||||||
|
'modal'
|
||||||
|
)
|
||||||
if @shown
|
if @shown
|
||||||
@show()
|
@render()
|
||||||
|
|
||||||
show: (content) ->
|
content: ->
|
||||||
if @button is true
|
'You need to implement a one @content()!'
|
||||||
@button = 'Submit'
|
|
||||||
|
|
||||||
@html App.view('modal')
|
update: =>
|
||||||
|
if @message
|
||||||
|
content = App.i18n.translateContent(@message)
|
||||||
|
else if @contentInline
|
||||||
|
content = @contentInline
|
||||||
|
else
|
||||||
|
content = @content()
|
||||||
|
modal = $(App.view('modal')
|
||||||
head: @head
|
head: @head
|
||||||
|
headPrefix: @headPrefix
|
||||||
message: @message
|
message: @message
|
||||||
detail: @detail
|
detail: @detail
|
||||||
close: @close
|
buttonClose: @buttonClose
|
||||||
cancel: @cancel
|
buttonCancel: @buttonCancel
|
||||||
button: @button
|
buttonSubmit: @buttonSubmit
|
||||||
buttonClass: @buttonClass
|
buttonClass: @buttonClass
|
||||||
centerButtons: @centerButtons
|
centerButtons: @centerButtons
|
||||||
content: content
|
)
|
||||||
|
modal.find('.modal-body').html content
|
||||||
|
if !@initRenderingDone
|
||||||
|
@initRenderingDone = true
|
||||||
|
@html modal
|
||||||
|
else
|
||||||
|
@$('.modal-dialog').replaceWith(modal)
|
||||||
|
@post()
|
||||||
|
|
||||||
if @content
|
post: =>
|
||||||
@body.html @content
|
# nothing
|
||||||
|
|
||||||
|
render: =>
|
||||||
|
if @buttonSubmit is true
|
||||||
|
@buttonSubmit = 'Submit'
|
||||||
|
if @buttonCancel is true
|
||||||
|
@buttonCancel = 'Cancel & Go Back'
|
||||||
|
|
||||||
|
@update()
|
||||||
|
|
||||||
if @container
|
if @container
|
||||||
@el.addClass('modal--local')
|
@el.addClass('modal--local')
|
||||||
|
@ -629,52 +653,57 @@ class App.ControllerModal extends App.Controller
|
||||||
.on
|
.on
|
||||||
'show.bs.modal': @onShow
|
'show.bs.modal': @onShow
|
||||||
'shown.bs.modal': @onShown
|
'shown.bs.modal': @onShown
|
||||||
|
'hide.bs.modal': @onClose
|
||||||
'hidden.bs.modal': =>
|
'hidden.bs.modal': =>
|
||||||
@onHide()
|
@onClosed()
|
||||||
# remove modal from dom
|
# remove modal from dom
|
||||||
$('.modal').remove()
|
$('.modal').remove()
|
||||||
|
|
||||||
hide: (e) =>
|
close: (e) =>
|
||||||
if e
|
if e
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@el.modal('hide')
|
@el.modal('hide')
|
||||||
|
|
||||||
onShown: ->
|
|
||||||
console.log('modal shown: do nothing')
|
|
||||||
# do nothing
|
|
||||||
|
|
||||||
onShow: ->
|
onShow: ->
|
||||||
console.log('modal rendered: do nothing')
|
|
||||||
# do nothing
|
# do nothing
|
||||||
|
|
||||||
onHide: ->
|
onShown: ->
|
||||||
console.log('modal removed: do nothing')
|
|
||||||
# do nothing
|
# do nothing
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onClose: ->
|
||||||
|
# do nothing
|
||||||
|
|
||||||
|
onClosed: ->
|
||||||
|
# do nothing
|
||||||
|
|
||||||
|
onSubmit: ->
|
||||||
|
# do nothing
|
||||||
|
|
||||||
|
onCancel: ->
|
||||||
|
# do nothing
|
||||||
|
|
||||||
|
cancel: (e) =>
|
||||||
|
@close(e)
|
||||||
|
@onCancel(e)
|
||||||
|
|
||||||
|
submit: (e) =>
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if @onSubmitCallback
|
@onSubmit(e)
|
||||||
@onSubmitCallback()
|
|
||||||
@log 'error', 'You need to implement your own "onSubmit" method!'
|
|
||||||
|
|
||||||
class App.ErrorModal extends App.ControllerModal
|
class App.SessionMessage extends App.ControllerModalNice
|
||||||
constructor: ->
|
onCancel: (e) =>
|
||||||
super
|
if @forceReload
|
||||||
@show()
|
@reload(e)
|
||||||
|
|
||||||
class App.SessionMessage extends App.ControllerModal
|
onClose: (e) =>
|
||||||
constructor: ->
|
|
||||||
super
|
|
||||||
@show(@content)
|
|
||||||
|
|
||||||
# reload page on modal hidden
|
|
||||||
onHide: (e) =>
|
|
||||||
if @forceReload
|
if @forceReload
|
||||||
@reload(e)
|
@reload(e)
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
if @forceReload
|
if @forceReload
|
||||||
@reload(e)
|
@reload(e)
|
||||||
|
else
|
||||||
|
@close()
|
||||||
|
|
||||||
reload: (e) ->
|
reload: (e) ->
|
||||||
if e
|
if e
|
||||||
|
|
|
@ -1,24 +1,20 @@
|
||||||
class App.ControllerGenericNew extends App.ControllerModal
|
class App.ControllerGenericNew extends App.ControllerModalNice
|
||||||
constructor: (params) ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
@head = App.i18n.translateContent( 'New' ) + ': ' + App.i18n.translateContent( @pageData.object )
|
headPrefix: 'New'
|
||||||
@cancel = true
|
|
||||||
@button = true
|
|
||||||
|
|
||||||
|
content: =>
|
||||||
|
@head = @pageData.object
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model: App[ @genericObject ]
|
model: App[ @genericObject ]
|
||||||
params: @item
|
params: @item
|
||||||
screen: @screen || 'edit'
|
screen: @screen || 'edit'
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
controller.form
|
||||||
@content = controller.form
|
|
||||||
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) ->
|
onSubmit: (e) ->
|
||||||
e.preventDefault()
|
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
|
||||||
object = new App[ @genericObject ]
|
object = new App[ @genericObject ]
|
||||||
|
@ -41,21 +37,22 @@ class App.ControllerGenericNew extends App.ControllerModal
|
||||||
if ui.callback
|
if ui.callback
|
||||||
item = App[ ui.genericObject ].fullLocal(@id)
|
item = App[ ui.genericObject ].fullLocal(@id)
|
||||||
ui.callback(item)
|
ui.callback(item)
|
||||||
ui.hide()
|
ui.close()
|
||||||
|
|
||||||
fail: ->
|
fail: ->
|
||||||
ui.log 'errors'
|
ui.log 'errors'
|
||||||
ui.hide()
|
ui.close()
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ControllerGenericEdit extends App.ControllerModal
|
class App.ControllerGenericEdit extends App.ControllerModalNice
|
||||||
constructor: (params) ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
@item = App[ @genericObject ].find( params.id )
|
buttonSubmit: true
|
||||||
|
headPrefix: 'Edit'
|
||||||
|
|
||||||
@head = App.i18n.translateContent( 'Edit' ) + ': ' + App.i18n.translateContent( @pageData.object )
|
content: =>
|
||||||
@cancel = true
|
@item = App[ @genericObject ].find( @id )
|
||||||
@button = true
|
@head = @pageData.object
|
||||||
|
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model: App[ @genericObject ]
|
model: App[ @genericObject ]
|
||||||
|
@ -63,12 +60,9 @@ class App.ControllerGenericEdit extends App.ControllerModal
|
||||||
screen: @screen || 'edit'
|
screen: @screen || 'edit'
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
@content = controller.form
|
controller.form
|
||||||
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) ->
|
onSubmit: (e) ->
|
||||||
e.preventDefault()
|
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
@item.load(params)
|
@item.load(params)
|
||||||
|
|
||||||
|
@ -89,11 +83,11 @@ class App.ControllerGenericEdit extends App.ControllerModal
|
||||||
if ui.callback
|
if ui.callback
|
||||||
item = App[ ui.genericObject ].fullLocal(@id)
|
item = App[ ui.genericObject ].fullLocal(@id)
|
||||||
ui.callback(item)
|
ui.callback(item)
|
||||||
ui.hide()
|
ui.close()
|
||||||
|
|
||||||
fail: ->
|
fail: ->
|
||||||
ui.log 'errors'
|
ui.log 'errors'
|
||||||
ui.hide()
|
ui.close()
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ControllerGenericIndex extends App.Controller
|
class App.ControllerGenericIndex extends App.Controller
|
||||||
|
@ -214,19 +208,17 @@ class App.ControllerGenericIndex extends App.Controller
|
||||||
container: @container
|
container: @container
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ControllerGenericDescription extends App.ControllerModal
|
class App.ControllerGenericDescription extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: false
|
||||||
@head = 'Description'
|
buttonSubmit: 'Close'
|
||||||
@cancel = false
|
head: 'Description'
|
||||||
@button = 'Close'
|
|
||||||
description = marked(@description)
|
|
||||||
|
|
||||||
@show(description)
|
content: =>
|
||||||
|
marked(@description)
|
||||||
|
|
||||||
onSubmit: (e) ->
|
onSubmit: =>
|
||||||
e.preventDefault()
|
@close()
|
||||||
@hide()
|
|
||||||
|
|
||||||
class App.ControllerModalLoading extends App.Controller
|
class App.ControllerModalLoading extends App.Controller
|
||||||
className: 'modal fade'
|
className: 'modal fade'
|
||||||
|
@ -270,25 +262,25 @@ class App.ControllerModalLoading extends App.Controller
|
||||||
return
|
return
|
||||||
App.Delay.set(remove, delay * 1000)
|
App.Delay.set(remove, delay * 1000)
|
||||||
|
|
||||||
class App.ControllerGenericDestroyConfirm extends App.ControllerModal
|
class App.ControllerGenericDestroyConfirm extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
@head = 'Confirm'
|
buttonSubmit: 'yes'
|
||||||
@cancel = true
|
buttonClass: 'btn--danger'
|
||||||
@button = 'Yes'
|
head: 'Confirm'
|
||||||
@message = 'Sure to delete this object?'
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) ->
|
content: =>
|
||||||
e.preventDefault()
|
App.i18n.translateContent('Sure to delete this object?')
|
||||||
|
|
||||||
|
onSubmit: =>
|
||||||
@item.destroy(
|
@item.destroy(
|
||||||
done: =>
|
done: =>
|
||||||
if @callback
|
if @callback
|
||||||
@callback()
|
@callback()
|
||||||
@hide()
|
@close()
|
||||||
fail: =>
|
fail: =>
|
||||||
@log 'errors'
|
@log 'errors'
|
||||||
@hide()
|
@close()
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ControllerDrox extends App.Controller
|
class App.ControllerDrox extends App.Controller
|
||||||
|
@ -439,40 +431,35 @@ class App.ControllerNavSidbar extends App.ControllerContent
|
||||||
el: @$('.main')
|
el: @$('.main')
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.GenericHistory extends App.ControllerModal
|
class App.GenericHistory extends App.ControllerModalNice
|
||||||
|
buttonClose: true
|
||||||
|
buttonCancel: false
|
||||||
|
buttonSubmit: false
|
||||||
|
head: 'History'
|
||||||
|
shown: false
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
@head = 'History'
|
@fetch()
|
||||||
@close = true
|
|
||||||
|
|
||||||
render: ->
|
|
||||||
|
|
||||||
|
content: =>
|
||||||
localItem = @reworkItems(@items)
|
localItem = @reworkItems(@items)
|
||||||
|
|
||||||
@content = $ App.view('generic/history')(
|
content = $ App.view('generic/history')(
|
||||||
items: localItem
|
items: localItem
|
||||||
)
|
)
|
||||||
|
content.find('a[data-type="sortorder"]').bind('click', (e) =>
|
||||||
@onShow()
|
|
||||||
|
|
||||||
@content.find('a[data-type="sortorder"]').bind(
|
|
||||||
'click',
|
|
||||||
(e) =>
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@sortorder()
|
@sortorder()
|
||||||
)
|
)
|
||||||
if !@isShown
|
content
|
||||||
@isShown = true
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onShow: =>
|
onShown: =>
|
||||||
# enable user popups
|
|
||||||
@userPopups()
|
@userPopups()
|
||||||
|
|
||||||
sortorder: =>
|
sortorder: =>
|
||||||
@items = @items.reverse()
|
@items = @items.reverse()
|
||||||
|
@update()
|
||||||
@render()
|
|
||||||
|
|
||||||
T: (name) ->
|
T: (name) ->
|
||||||
App.i18n.translateInline(name)
|
App.i18n.translateInline(name)
|
||||||
|
|
|
@ -73,15 +73,13 @@ With Filters you can e. g. dispatch new Tickets into certain groups or set a cer
|
||||||
container: @el.closest('.content')
|
container: @el.closest('.content')
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ChannelEmailFilterEdit extends App.ControllerModal
|
class App.ChannelEmailFilterEdit extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
@head = 'Postmaster Filter'
|
head: 'Postmaster Filter'
|
||||||
@button = true
|
|
||||||
@close = true
|
|
||||||
@cancel = true
|
|
||||||
|
|
||||||
|
content: =>
|
||||||
if @object
|
if @object
|
||||||
@form = new App.ControllerForm(
|
@form = new App.ControllerForm(
|
||||||
model: App.PostmasterFilter,
|
model: App.PostmasterFilter,
|
||||||
|
@ -94,8 +92,7 @@ class App.ChannelEmailFilterEdit extends App.ControllerModal
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
@content = @form.form
|
@form.form
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
@ -122,9 +119,9 @@ class App.ChannelEmailFilterEdit extends App.ControllerModal
|
||||||
# save object
|
# save object
|
||||||
object.save(
|
object.save(
|
||||||
done: =>
|
done: =>
|
||||||
@hide()
|
@close()
|
||||||
fail: =>
|
fail: =>
|
||||||
@hide()
|
@close()
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ChannelEmailSignature extends App.Controller
|
class App.ChannelEmailSignature extends App.Controller
|
||||||
|
@ -172,15 +169,13 @@ Once you have created a signature here, you need also to edit the groups where y
|
||||||
container: @el.closest('.content')
|
container: @el.closest('.content')
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ChannelEmailSignatureEdit extends App.ControllerModal
|
class App.ChannelEmailSignatureEdit extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
@head = 'Signature'
|
head: 'Signature'
|
||||||
@button = true
|
|
||||||
@close = true
|
|
||||||
@cancel = true
|
|
||||||
|
|
||||||
|
content: =>
|
||||||
if @object
|
if @object
|
||||||
@form = new App.ControllerForm(
|
@form = new App.ControllerForm(
|
||||||
model: App.Signature
|
model: App.Signature
|
||||||
|
@ -193,12 +188,9 @@ class App.ChannelEmailSignatureEdit extends App.ControllerModal
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
|
||||||
@content = @form.form
|
@form.form
|
||||||
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
e.preventDefault()
|
|
||||||
|
|
||||||
# get params
|
# get params
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
@ -221,9 +213,9 @@ class App.ChannelEmailSignatureEdit extends App.ControllerModal
|
||||||
# save object
|
# save object
|
||||||
object.save(
|
object.save(
|
||||||
done: =>
|
done: =>
|
||||||
@hide()
|
@close()
|
||||||
fail: =>
|
fail: =>
|
||||||
@hide()
|
@formEnable(e)
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ChannelEmailAccountOverview extends App.Controller
|
class App.ChannelEmailAccountOverview extends App.Controller
|
||||||
|
@ -399,15 +391,13 @@ class App.ChannelEmailAccountOverview extends App.Controller
|
||||||
channelDriver: @channelDriver
|
channelDriver: @channelDriver
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ChannelEmailEdit extends App.ControllerModal
|
class App.ChannelEmailEdit extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
@head = 'Channel'
|
head: 'Channel'
|
||||||
@button = true
|
|
||||||
@close = true
|
|
||||||
@cancel = true
|
|
||||||
|
|
||||||
|
content: =>
|
||||||
configureAttributesBase = [
|
configureAttributesBase = [
|
||||||
{ name: 'group_id', display: 'Destination Group', tag: 'select', null: false, relation: 'Group', nulloption: true },
|
{ name: 'group_id', display: 'Destination Group', tag: 'select', null: false, relation: 'Group', nulloption: true },
|
||||||
]
|
]
|
||||||
|
@ -417,12 +407,9 @@ class App.ChannelEmailEdit extends App.ControllerModal
|
||||||
className: ''
|
className: ''
|
||||||
params: @item
|
params: @item
|
||||||
)
|
)
|
||||||
|
@form.form
|
||||||
@content = @form.form
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
e.preventDefault()
|
|
||||||
|
|
||||||
# get params
|
# get params
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
@ -448,9 +435,9 @@ class App.ChannelEmailEdit extends App.ControllerModal
|
||||||
processData: true
|
processData: true
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
@callback()
|
@callback()
|
||||||
@hide()
|
@close()
|
||||||
fail: =>
|
fail: =>
|
||||||
@enable(e)
|
@formEnable(e)
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.ChannelEmailAccountWizard extends App.Wizard
|
class App.ChannelEmailAccountWizard extends App.Wizard
|
||||||
|
|
|
@ -10,7 +10,7 @@ class App.ChannelForm extends App.Controller
|
||||||
@render()
|
@render()
|
||||||
@updateParams()
|
@updateParams()
|
||||||
new App.SettingsArea(
|
new App.SettingsArea(
|
||||||
el: @el.find('.js-settings')
|
el: @$('.js-settings')
|
||||||
area: 'Form::Base'
|
area: 'Form::Base'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -21,10 +21,13 @@ class App.ChannelForm extends App.Controller
|
||||||
|
|
||||||
updateParams: ->
|
updateParams: ->
|
||||||
quote = (string) ->
|
quote = (string) ->
|
||||||
string.replace('\'', '\\\'')
|
string = string.replace('\'', '\\\'')
|
||||||
|
.replace(/\</g, '<')
|
||||||
|
.replace(/\>/g, '>')
|
||||||
params = @formParam(@$('.js-params'))
|
params = @formParam(@$('.js-params'))
|
||||||
paramString = ''
|
paramString = ''
|
||||||
for key, value of params
|
for key, value of params
|
||||||
|
if value != ''
|
||||||
if paramString != ''
|
if paramString != ''
|
||||||
paramString += ",\n"
|
paramString += ",\n"
|
||||||
if value == 'true' || value == 'false'
|
if value == 'true' || value == 'false'
|
||||||
|
|
|
@ -146,20 +146,20 @@ class Index extends App.Controller
|
||||||
App.Config.set( 'Avatar', { prio: 1100, name: 'Avatar', parent: '#profile', target: '#profile/avatar', controller: Index }, 'NavBarProfile' )
|
App.Config.set( 'Avatar', { prio: 1100, name: 'Avatar', parent: '#profile', target: '#profile/avatar', controller: Index }, 'NavBarProfile' )
|
||||||
|
|
||||||
|
|
||||||
class ImageCropper extends App.ControllerModal
|
class ImageCropper extends App.ControllerModalNice
|
||||||
|
buttonClose: true
|
||||||
|
buttonCancel: true
|
||||||
|
buttonSubmit: 'Save'
|
||||||
|
head: 'Crop Image'
|
||||||
|
|
||||||
elements:
|
elements:
|
||||||
'.imageCropper-image': 'image'
|
'.imageCropper-image': 'image'
|
||||||
'.imageCropper-holder': 'holder'
|
'.imageCropper-holder': 'holder'
|
||||||
|
|
||||||
constructor: (options) ->
|
content: =>
|
||||||
super
|
App.view('profile/imageCropper')()
|
||||||
@head = 'Crop Image'
|
|
||||||
@cancel = true
|
|
||||||
@button = 'Save'
|
|
||||||
@buttonClass = 'btn--success'
|
|
||||||
|
|
||||||
@show( App.view('profile/imageCropper')() )
|
|
||||||
|
|
||||||
|
post: =>
|
||||||
@size = 256
|
@size = 256
|
||||||
|
|
||||||
orientationTransform =
|
orientationTransform =
|
||||||
|
@ -168,7 +168,7 @@ class ImageCropper extends App.ControllerModal
|
||||||
6: 90
|
6: 90
|
||||||
8: -90
|
8: -90
|
||||||
|
|
||||||
@angle = orientationTransform[ @options.orientation ]
|
@angle = orientationTransform[ @orientation ]
|
||||||
|
|
||||||
if @angle == undefined
|
if @angle == undefined
|
||||||
@angle = 0
|
@angle = 0
|
||||||
|
@ -177,9 +177,9 @@ class ImageCropper extends App.ControllerModal
|
||||||
@isOrientating = true
|
@isOrientating = true
|
||||||
image = new Image()
|
image = new Image()
|
||||||
image.addEventListener 'load', @orientateImage
|
image.addEventListener 'load', @orientateImage
|
||||||
image.src = @options.imageSource
|
image.src = @imageSource
|
||||||
else
|
else
|
||||||
@image.attr src: @options.imageSource
|
@image.attr src: @imageSource
|
||||||
|
|
||||||
orientateImage: (e) =>
|
orientateImage: (e) =>
|
||||||
image = e.currentTarget
|
image = e.currentTarget
|
||||||
|
@ -215,14 +215,23 @@ class ImageCropper extends App.ControllerModal
|
||||||
minContainerHeight: 300
|
minContainerHeight: 300
|
||||||
preview: '.imageCropper-preview'
|
preview: '.imageCropper-preview'
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: =>
|
||||||
e.preventDefault()
|
@callback( @image.cropper('getCroppedCanvas').toDataURL() )
|
||||||
@options.callback( @image.cropper('getCroppedCanvas').toDataURL() )
|
|
||||||
@image.cropper('destroy')
|
@image.cropper('destroy')
|
||||||
@hide()
|
@close()
|
||||||
|
|
||||||
|
|
||||||
class Camera extends App.ControllerModal
|
class Camera extends App.ControllerModalNice
|
||||||
|
buttonClose: true
|
||||||
|
buttonCancel: true
|
||||||
|
buttonSubmit: 'Save'
|
||||||
|
buttonClass: 'btn--success is-disabled'
|
||||||
|
centerButtons: [{
|
||||||
|
className: 'btn--success js-shoot is-disabled',
|
||||||
|
text: 'Shoot'
|
||||||
|
}]
|
||||||
|
head: 'Camera'
|
||||||
|
|
||||||
elements:
|
elements:
|
||||||
'.js-shoot': 'shootButton'
|
'.js-shoot': 'shootButton'
|
||||||
'.js-submit': 'submitButton'
|
'.js-submit': 'submitButton'
|
||||||
|
@ -233,23 +242,14 @@ class Camera extends App.ControllerModal
|
||||||
events:
|
events:
|
||||||
'click .js-shoot:not(.is-disabled)': 'onShootClick'
|
'click .js-shoot:not(.is-disabled)': 'onShootClick'
|
||||||
|
|
||||||
constructor: (options) ->
|
content: =>
|
||||||
super
|
App.view('profile/camera')()
|
||||||
|
|
||||||
|
post: =>
|
||||||
@size = 256
|
@size = 256
|
||||||
@photoTaken = false
|
@photoTaken = false
|
||||||
@backgroundColor = 'white'
|
@backgroundColor = 'white'
|
||||||
|
|
||||||
@head = 'Camera'
|
|
||||||
@cancel = true
|
|
||||||
@button = 'Save'
|
|
||||||
@buttonClass = 'btn--success is-disabled'
|
|
||||||
@centerButtons = [{
|
|
||||||
className: 'btn--success js-shoot is-disabled',
|
|
||||||
text: 'Shoot'
|
|
||||||
}]
|
|
||||||
|
|
||||||
@show( App.view('profile/camera')() )
|
|
||||||
|
|
||||||
@ctx = @preview.get(0).getContext('2d')
|
@ctx = @preview.get(0).getContext('2d')
|
||||||
|
|
||||||
requestWebcam = Modernizr.prefixed('getUserMedia', navigator)
|
requestWebcam = Modernizr.prefixed('getUserMedia', navigator)
|
||||||
|
@ -312,7 +312,7 @@ class Camera extends App.ControllerModal
|
||||||
'ConstraintNotSatisfiedError': App.i18n.translateInline('No camera found.')
|
'ConstraintNotSatisfiedError': App.i18n.translateInline('No camera found.')
|
||||||
|
|
||||||
alert convertToHumanReadable[error.name]
|
alert convertToHumanReadable[error.name]
|
||||||
@hide()
|
@close()
|
||||||
|
|
||||||
setupPreview: =>
|
setupPreview: =>
|
||||||
@video.attr 'height', @size
|
@video.attr 'height', @size
|
||||||
|
@ -400,14 +400,13 @@ class Camera extends App.ControllerModal
|
||||||
# reset video height
|
# reset video height
|
||||||
@video.attr height: @size
|
@video.attr height: @size
|
||||||
|
|
||||||
onHide: =>
|
onClose: =>
|
||||||
@stream.stop() if @stream
|
@stream.stop() if @stream
|
||||||
@hidden = true
|
@hidden = true
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: =>
|
||||||
e.preventDefault()
|
|
||||||
# send picture to the callback
|
# send picture to the callback
|
||||||
console.log @cache.get(0).toDataURL()
|
console.log @cache.get(0).toDataURL()
|
||||||
window.file = @cache.get(0).toDataURL()
|
window.file = @cache.get(0).toDataURL()
|
||||||
@options.callback @cache.get(0).toDataURL()
|
@callback @cache.get(0).toDataURL()
|
||||||
@hide()
|
@close()
|
||||||
|
|
|
@ -1,73 +1,64 @@
|
||||||
class App.TicketMerge extends App.ControllerModal
|
class App.TicketMerge extends App.ControllerModalNice
|
||||||
|
buttonClose: true
|
||||||
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
|
head: 'Merge'
|
||||||
|
shown: false
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
@head = 'Merge'
|
|
||||||
@button = true
|
|
||||||
@cancel = true
|
|
||||||
@fetch()
|
@fetch()
|
||||||
|
|
||||||
fetch: ->
|
fetch: ->
|
||||||
|
|
||||||
# merge tickets
|
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'ticket_related'
|
id: 'ticket_related'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: @apiPath + '/ticket_related/' + @ticket.id
|
url: "#{@apiPath}/ticket_related/#{@ticket.id}"
|
||||||
processData: true,
|
processData: true
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
App.Collection.loadAssets(data.assets)
|
App.Collection.loadAssets(data.assets)
|
||||||
|
|
||||||
@ticket_ids_by_customer = data.ticket_ids_by_customer
|
@ticket_ids_by_customer = data.ticket_ids_by_customer
|
||||||
@ticket_ids_recent_viewed = data.ticket_ids_recent_viewed
|
@ticket_ids_recent_viewed = data.ticket_ids_recent_viewed
|
||||||
@render()
|
@render()
|
||||||
)
|
)
|
||||||
|
|
||||||
render: ->
|
content: =>
|
||||||
|
content = $( App.view('agent_ticket_merge')() )
|
||||||
@content = $( App.view('agent_ticket_merge')() )
|
|
||||||
|
|
||||||
new App.TicketList(
|
new App.TicketList(
|
||||||
el: @content.find('#ticket-merge-customer-tickets')
|
el: content.find('#ticket-merge-customer-tickets')
|
||||||
ticket_ids: @ticket_ids_by_customer
|
ticket_ids: @ticket_ids_by_customer
|
||||||
radio: true
|
radio: true
|
||||||
)
|
)
|
||||||
|
|
||||||
new App.TicketList(
|
new App.TicketList(
|
||||||
el: @content.find('#ticket-merge-recent-tickets'),
|
el: content.find('#ticket-merge-recent-tickets')
|
||||||
ticket_ids: @ticket_ids_recent_viewed
|
ticket_ids: @ticket_ids_recent_viewed
|
||||||
radio: true
|
radio: true
|
||||||
)
|
)
|
||||||
|
|
||||||
@content.delegate('[name="master_ticket_number"]', 'focus', (e) ->
|
content.delegate('[name="master_ticket_number"]', 'focus', (e) ->
|
||||||
$(e.target).parents().find('[name="radio"]').prop('checked', false)
|
$(e.target).parents().find('[name="radio"]').prop('checked', false)
|
||||||
)
|
)
|
||||||
|
|
||||||
@content.delegate('[name="radio"]', 'click', (e) ->
|
content.delegate('[name="radio"]', 'click', (e) ->
|
||||||
if $(e.target).prop('checked')
|
if $(e.target).prop('checked')
|
||||||
ticket_id = $(e.target).val()
|
ticket_id = $(e.target).val()
|
||||||
ticket = App.Ticket.fullLocal(ticket_id)
|
ticket = App.Ticket.fullLocal(ticket_id)
|
||||||
$(e.target).parents().find('[name="master_ticket_number"]').val(ticket.number)
|
$(e.target).parents().find('[name="master_ticket_number"]').val(ticket.number)
|
||||||
)
|
)
|
||||||
|
|
||||||
@show()
|
content
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
e.preventDefault()
|
|
||||||
|
|
||||||
# disable form
|
|
||||||
@formDisable(e)
|
@formDisable(e)
|
||||||
|
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
|
||||||
# merge tickets
|
# merge tickets
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'ticket_merge',
|
id: 'ticket_merge'
|
||||||
type: 'GET',
|
type: 'GET'
|
||||||
url: @apiPath + '/ticket_merge/' + @ticket.id + '/' + params['master_ticket_number'],
|
url: "#{@apiPath}/ticket_merge/#{@ticket.id}/#{params['master_ticket_number']}"
|
||||||
data: {
|
|
||||||
# view: @view
|
|
||||||
}
|
|
||||||
processData: true,
|
processData: true,
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
|
@ -78,7 +69,7 @@ class App.TicketMerge extends App.ControllerModal
|
||||||
App.Collection.load( type: 'Ticket', data: [data.slave_ticket] )
|
App.Collection.load( type: 'Ticket', data: [data.slave_ticket] )
|
||||||
|
|
||||||
# hide dialog
|
# hide dialog
|
||||||
@hide()
|
@close()
|
||||||
|
|
||||||
# view ticket
|
# view ticket
|
||||||
@log 'notice', 'nav...', App.Ticket.find( data.master_ticket['id'] )
|
@log 'notice', 'nav...', App.Ticket.find( data.master_ticket['id'] )
|
||||||
|
@ -105,4 +96,3 @@ class App.TicketMerge extends App.ControllerModal
|
||||||
error: =>
|
error: =>
|
||||||
@formEnable(e)
|
@formEnable(e)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -413,23 +413,15 @@ class ContentSidebarRightSidebarOptional extends App.ControllerContent
|
||||||
App.Config.set( 'layout_ref/content_sidebar_right_sidebar_optional', ContentSidebarRightSidebarOptional, 'Routes' )
|
App.Config.set( 'layout_ref/content_sidebar_right_sidebar_optional', ContentSidebarRightSidebarOptional, 'Routes' )
|
||||||
|
|
||||||
|
|
||||||
class ModalForm extends App.ControllerModal
|
class ModalForm extends App.ControllerModalNice
|
||||||
constructor: ->
|
head: '123 some title'
|
||||||
super
|
|
||||||
@head = '123 some title'
|
|
||||||
@cancel = true
|
|
||||||
@button = true
|
|
||||||
|
|
||||||
@render()
|
content: ->
|
||||||
|
|
||||||
render: ->
|
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model: App.User
|
model: App.User
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
@content = controller.form
|
controller.form
|
||||||
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onHide: ->
|
onHide: ->
|
||||||
window.history.back()
|
window.history.back()
|
||||||
|
@ -442,15 +434,10 @@ class ModalForm extends App.ControllerModal
|
||||||
App.Config.set( 'layout_ref/modal_form', ModalForm, 'Routes' )
|
App.Config.set( 'layout_ref/modal_form', ModalForm, 'Routes' )
|
||||||
|
|
||||||
|
|
||||||
class ModalText extends App.ControllerModal
|
class ModalText extends App.ControllerModalNice
|
||||||
constructor: ->
|
|
||||||
super
|
|
||||||
@head = '123 some title'
|
|
||||||
|
|
||||||
@render()
|
content: ->
|
||||||
|
App.view('layout_ref/content')()
|
||||||
render: ->
|
|
||||||
@show( App.view('layout_ref/content')() )
|
|
||||||
|
|
||||||
onHide: ->
|
onHide: ->
|
||||||
window.history.back()
|
window.history.back()
|
||||||
|
@ -458,7 +445,6 @@ class ModalText extends App.ControllerModal
|
||||||
App.Config.set( 'layout_ref/modal_text', ModalText, 'Routes' )
|
App.Config.set( 'layout_ref/modal_text', ModalText, 'Routes' )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ContentSidebarTabsRight extends App.ControllerContent
|
class ContentSidebarTabsRight extends App.ControllerContent
|
||||||
elements:
|
elements:
|
||||||
'.tabsSidebar' : 'sidebar'
|
'.tabsSidebar' : 'sidebar'
|
||||||
|
@ -1380,12 +1366,13 @@ class SlaRef extends App.ControllerContent
|
||||||
checkbox.closest('tr').toggleClass('is-active', checkbox.prop('checked'))
|
checkbox.closest('tr').toggleClass('is-active', checkbox.prop('checked'))
|
||||||
|
|
||||||
createNew: =>
|
createNew: =>
|
||||||
@newItemModal = new App.ControllerModal
|
@newItemModal = new App.ControllerModalNice
|
||||||
head: 'New Service Level Agreement (SLA)'
|
head: 'Service Level Agreement (SLA)'
|
||||||
content: App.view('layout_ref/sla_modal')()
|
headPrefox: 'New'
|
||||||
button: 'Create SLA'
|
contentInline: App.view('layout_ref/sla_modal')()
|
||||||
|
buttonSubmit: 'Create SLA'
|
||||||
shown: true
|
shown: true
|
||||||
cancel: true
|
buttonCancel: true
|
||||||
container: @el
|
container: @el
|
||||||
onShown: =>
|
onShown: =>
|
||||||
@$('.js-responseTime').timepicker
|
@$('.js-responseTime').timepicker
|
||||||
|
@ -1419,12 +1406,13 @@ class SchedulersRef extends App.ControllerContent
|
||||||
.text(if isInactive then 'Enable' else 'Disable')
|
.text(if isInactive then 'Enable' else 'Disable')
|
||||||
|
|
||||||
createNew: =>
|
createNew: =>
|
||||||
new App.ControllerModal
|
new App.ControllerModalNice
|
||||||
head: 'New Scheduler'
|
head: 'Scheduler'
|
||||||
content: App.view('layout_ref/scheduler_modal')()
|
headPrefix: 'New'
|
||||||
button: 'Create Schedule'
|
buttonSubmit: 'Create'
|
||||||
|
buttonCancel: true
|
||||||
|
contentInline: App.view('layout_ref/scheduler_modal')()
|
||||||
shown: true
|
shown: true
|
||||||
cancel: true
|
|
||||||
container: @el
|
container: @el
|
||||||
|
|
||||||
select: (event) =>
|
select: (event) =>
|
||||||
|
@ -1655,13 +1643,13 @@ class MergeCustomerRef extends App.ControllerContent
|
||||||
render: ->
|
render: ->
|
||||||
@html App.view('layout_ref/merge_customer_view')
|
@html App.view('layout_ref/merge_customer_view')
|
||||||
|
|
||||||
new App.ControllerModal
|
new App.ControllerModalNice
|
||||||
large: true
|
large: true
|
||||||
head: "Merge #{@mergeSource.firstname} #{@mergeSource.lastname}"
|
head: "#{@mergeSource.firstname} #{@mergeSource.lastname}"
|
||||||
content: App.view('layout_ref/merge_customer')()
|
headPrefix: 'Merge'
|
||||||
button: 'Merge'
|
contentInline: App.view('layout_ref/merge_customer')()
|
||||||
shown: true
|
buttonSubmit: 'Merge'
|
||||||
cancel: true
|
buttonCancel: true
|
||||||
container: @el
|
container: @el
|
||||||
|
|
||||||
onChange: ->
|
onChange: ->
|
||||||
|
|
|
@ -152,15 +152,14 @@ class Items extends App.ControllerContent
|
||||||
@load()
|
@load()
|
||||||
)
|
)
|
||||||
|
|
||||||
class Edit extends App.ControllerModal
|
class Edit extends App.ControllerModalNice
|
||||||
constructor: (params) ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
|
head: 'Edit'
|
||||||
|
|
||||||
@head = App.i18n.translateContent( 'Edit' )
|
content: =>
|
||||||
@cancel = true
|
content = $( App.view('object_manager/edit')(
|
||||||
@button = true
|
|
||||||
|
|
||||||
@content = $( App.view('object_manager/edit')(
|
|
||||||
head: @object
|
head: @object
|
||||||
items: []
|
items: []
|
||||||
) )
|
) )
|
||||||
|
@ -186,7 +185,7 @@ class Edit extends App.ControllerModal
|
||||||
model: { configure_attributes: configureAttributesTop, className: '' },
|
model: { configure_attributes: configureAttributesTop, className: '' },
|
||||||
params: item
|
params: item
|
||||||
#screen: @screen || 'edit'
|
#screen: @screen || 'edit'
|
||||||
el: @content.find('.js-top')
|
el: content.find('.js-top')
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -203,7 +202,7 @@ class Edit extends App.ControllerModal
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model: { configure_attributes: configureAttributesInput, className: '' },
|
model: { configure_attributes: configureAttributesInput, className: '' },
|
||||||
params: item
|
params: item
|
||||||
el: @content.find('.js-input')
|
el: content.find('.js-input')
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -217,7 +216,7 @@ class Edit extends App.ControllerModal
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model: { configure_attributes: configureAttributesTextarea, className: '' },
|
model: { configure_attributes: configureAttributesTextarea, className: '' },
|
||||||
params: item
|
params: item
|
||||||
el: @content.find('.js-textarea')
|
el: content.find('.js-textarea')
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -233,7 +232,7 @@ class Edit extends App.ControllerModal
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model: { configure_attributes: configureAttributesSelect, className: '' },
|
model: { configure_attributes: configureAttributesSelect, className: '' },
|
||||||
params: item
|
params: item
|
||||||
el: @content.find('.js-select')
|
el: content.find('.js-select')
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -245,14 +244,14 @@ class Edit extends App.ControllerModal
|
||||||
},
|
},
|
||||||
###
|
###
|
||||||
|
|
||||||
@content.find('[name=data_type]').on(
|
content.find('[name=data_type]').on(
|
||||||
'change',
|
'change',
|
||||||
(e) =>
|
(e) =>
|
||||||
dataType = $( e.target ).val()
|
dataType = $( e.target ).val()
|
||||||
@content.find('.js-middle > div').addClass('hide')
|
content.find('.js-middle > div').addClass('hide')
|
||||||
@content.find(".js-#{dataType}").removeClass('hide')
|
content.find(".js-#{dataType}").removeClass('hide')
|
||||||
)
|
)
|
||||||
@content.find('[name=data_type]').trigger('change')
|
content.find('[name=data_type]').trigger('change')
|
||||||
|
|
||||||
|
|
||||||
configureAttributesBottom = [
|
configureAttributesBottom = [
|
||||||
|
@ -262,15 +261,9 @@ class Edit extends App.ControllerModal
|
||||||
model: { configure_attributes: configureAttributesBottom, className: '' },
|
model: { configure_attributes: configureAttributesBottom, className: '' },
|
||||||
params: item
|
params: item
|
||||||
#screen: @screen || 'edit'
|
#screen: @screen || 'edit'
|
||||||
el: @content.find('.js-bottom')
|
el: content.find('.js-bottom')
|
||||||
)
|
)
|
||||||
|
|
||||||
#@content = controller.form
|
controller.form
|
||||||
|
|
||||||
|
|
||||||
#@show(content)
|
|
||||||
@show()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
App.Config.set( 'SystemObject', { prio: 1700, parent: '#system', name: 'Objects', target: '#system/object_manager', controller: Index, role: ['Admin'] }, 'NavBarAdmin' )
|
App.Config.set( 'SystemObject', { prio: 1700, parent: '#system', name: 'Objects', target: '#system/object_manager', controller: Index, role: ['Admin'] }, 'NavBarAdmin' )
|
||||||
|
|
|
@ -1,22 +1,11 @@
|
||||||
class App.OrganizationHistory extends App.GenericHistory
|
class App.OrganizationHistory extends App.GenericHistory
|
||||||
constructor: ->
|
fetch: =>
|
||||||
super
|
|
||||||
@fetch()
|
|
||||||
|
|
||||||
fetch: ->
|
|
||||||
|
|
||||||
# get data
|
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'organization_history'
|
id: 'organization_history'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: @apiPath + '/organizations/history/' + @organization_id
|
url: "#{@apiPath}/organizations/history/#{@organization_id}"
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
# load assets
|
|
||||||
App.Collection.loadAssets(data.assets)
|
App.Collection.loadAssets(data.assets)
|
||||||
|
|
||||||
@items = data.history
|
@items = data.history
|
||||||
|
|
||||||
# render page
|
|
||||||
@render()
|
@render()
|
||||||
)
|
)
|
|
@ -108,7 +108,10 @@ class Object extends App.Controller
|
||||||
|
|
||||||
# start action controller
|
# start action controller
|
||||||
showHistory = ->
|
showHistory = ->
|
||||||
new App.OrganizationHistory( organization_id: organization.id )
|
new App.OrganizationHistory(
|
||||||
|
organization_id: organization.id
|
||||||
|
container: @el.closest('.content')
|
||||||
|
)
|
||||||
editOrganization = =>
|
editOrganization = =>
|
||||||
new App.ControllerGenericEdit(
|
new App.ControllerGenericEdit(
|
||||||
id: organization.id
|
id: organization.id
|
||||||
|
|
|
@ -6,4 +6,4 @@ App.Config.set( 'profile/:target', Index, 'Routes' )
|
||||||
|
|
||||||
App.Config.set( 'Profile', { prio: 1000, name: 'Profile', target: '#profile' }, 'NavBarProfile' )
|
App.Config.set( 'Profile', { prio: 1000, name: 'Profile', target: '#profile' }, 'NavBarProfile' )
|
||||||
|
|
||||||
App.Config.set( 'Profile', { prio: 1700, parent: '#current_user', name: 'Profile', target: '#profile', role: [ 'Agent', 'Customer' ] }, 'NavBarRight' )
|
App.Config.set( 'Profile', { prio: 1700, parent: '#current_user', name: 'Profile', target: '#profile', translate: true, role: [ 'Agent', 'Customer' ] }, 'NavBarRight' )
|
||||||
|
|
|
@ -112,18 +112,16 @@ class App.TaskbarWidget extends App.Controller
|
||||||
|
|
||||||
@navigate '#'
|
@navigate '#'
|
||||||
|
|
||||||
class Remove extends App.ControllerModal
|
class Remove extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
@head = 'Confirm'
|
buttonSubmit: 'Discared changes'
|
||||||
@message = 'Tab has changed, you really want to close it?'
|
buttonClass: 'btn--danger'
|
||||||
@cancel = true
|
head: 'Confirm'
|
||||||
@close = true
|
|
||||||
@button = 'Discared changes'
|
content: =>
|
||||||
@buttonClass = 'btn--danger'
|
App.i18n.translateContent('Tab has changed, you really want to close it?')
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
e.preventDefault()
|
@close()
|
||||||
@hide()
|
|
||||||
@ui.remove(e, @key, true)
|
@ui.remove(e, @key, true)
|
||||||
|
|
|
@ -1,29 +1,21 @@
|
||||||
class App.TicketCustomer extends App.ControllerModal
|
class App.TicketCustomer extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
@head = 'Change Customer'
|
head: 'Change Customer'
|
||||||
@close = true
|
|
||||||
@cancel = true
|
|
||||||
@button = true
|
|
||||||
|
|
||||||
|
content: =>
|
||||||
configure_attributes = [
|
configure_attributes = [
|
||||||
{ name: 'customer_id', display: 'Customer', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organization/Company', minLengt: 2, disableCreateUser: true },
|
{ name: 'customer_id', display: 'Customer', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organization/Company', minLengt: 2, disableCreateUser: true },
|
||||||
]
|
]
|
||||||
|
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model:
|
model:
|
||||||
configure_attributes: configure_attributes,
|
configure_attributes: configure_attributes,
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
controller.form
|
||||||
@content = controller.form
|
|
||||||
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
e.preventDefault()
|
|
||||||
|
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
|
||||||
@customer_id = params['customer_id']
|
@customer_id = params['customer_id']
|
||||||
|
@ -31,7 +23,7 @@ class App.TicketCustomer extends App.ControllerModal
|
||||||
callback = =>
|
callback = =>
|
||||||
|
|
||||||
# close modal
|
# close modal
|
||||||
@hide()
|
@close()
|
||||||
|
|
||||||
# update ticket
|
# update ticket
|
||||||
@ticket.updateAttributes(
|
@ticket.updateAttributes(
|
||||||
|
|
|
@ -1,22 +1,11 @@
|
||||||
class App.TicketHistory extends App.GenericHistory
|
class App.TicketHistory extends App.GenericHistory
|
||||||
constructor: ->
|
fetch: =>
|
||||||
super
|
|
||||||
@fetch()
|
|
||||||
|
|
||||||
fetch: ->
|
|
||||||
|
|
||||||
# get data
|
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'ticket_history',
|
id: 'ticket_history'
|
||||||
type: 'GET',
|
type: 'GET'
|
||||||
url: @apiPath + '/ticket_history/' + @ticket_id,
|
url: "#{@apiPath}/ticket_history/#{@ticket_id}"
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
# load assets
|
|
||||||
App.Collection.loadAssets(data.assets)
|
App.Collection.loadAssets(data.assets)
|
||||||
|
|
||||||
@items = data.history
|
@items = data.history
|
||||||
|
|
||||||
# render page
|
|
||||||
@render()
|
@render()
|
||||||
)
|
)
|
|
@ -620,10 +620,15 @@ class BulkForm extends App.Controller
|
||||||
msg: App.i18n.translateContent('Bulk-Action executed!')
|
msg: App.i18n.translateContent('Bulk-Action executed!')
|
||||||
}
|
}
|
||||||
|
|
||||||
class App.OverviewSettings extends App.ControllerModal
|
class App.OverviewSettings extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
|
headPrefix: 'Edit'
|
||||||
|
|
||||||
|
content: =>
|
||||||
@overview = App.Overview.find(@overview_id)
|
@overview = App.Overview.find(@overview_id)
|
||||||
|
@head = @overview.name
|
||||||
|
|
||||||
@configure_attributes_article = []
|
@configure_attributes_article = []
|
||||||
if @view_mode is 'd'
|
if @view_mode is 'd'
|
||||||
|
@ -715,19 +720,13 @@ class App.OverviewSettings extends App.ControllerModal
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
})
|
})
|
||||||
|
|
||||||
@head = App.i18n.translateContent( 'Edit' ) + ': ' + App.i18n.translateContent( @overview.name )
|
|
||||||
@close = true
|
|
||||||
@cancel = true
|
|
||||||
@button = true
|
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model: { configure_attributes: @configure_attributes_article }
|
model: { configure_attributes: @configure_attributes_article }
|
||||||
autofocus: false
|
autofocus: false
|
||||||
)
|
)
|
||||||
@content = controller.form
|
controller.form
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
e.preventDefault()
|
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
|
||||||
# check if re-fetch is needed
|
# check if re-fetch is needed
|
||||||
|
@ -756,8 +755,8 @@ class App.OverviewSettings extends App.ControllerModal
|
||||||
App.OverviewIndexCollection.trigger()
|
App.OverviewIndexCollection.trigger()
|
||||||
App.OverviewCollection.trigger(@overview.link)
|
App.OverviewCollection.trigger(@overview.link)
|
||||||
|
|
||||||
# hide modal
|
# close modal
|
||||||
@hide()
|
@close()
|
||||||
)
|
)
|
||||||
|
|
||||||
class TicketOverviewRouter extends App.ControllerPermanent
|
class TicketOverviewRouter extends App.ControllerPermanent
|
||||||
|
|
|
@ -1,22 +1,11 @@
|
||||||
class App.UserHistory extends App.GenericHistory
|
class App.UserHistory extends App.GenericHistory
|
||||||
constructor: ->
|
fetch: =>
|
||||||
super
|
|
||||||
@fetch()
|
|
||||||
|
|
||||||
fetch: ->
|
|
||||||
|
|
||||||
# get data
|
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'user_history',
|
id: 'user_history'
|
||||||
type: 'GET',
|
type: 'GET'
|
||||||
url: @apiPath + '/users/history/' + @user_id,
|
url: "#{@apiPath}/users/history/#{@user_id}"
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
# load assets
|
|
||||||
App.Collection.loadAssets(data.assets)
|
App.Collection.loadAssets(data.assets)
|
||||||
|
|
||||||
@items = data.history
|
@items = data.history
|
||||||
|
|
||||||
# render page
|
|
||||||
@render()
|
@render()
|
||||||
)
|
)
|
||||||
|
|
|
@ -110,8 +110,11 @@ class Object extends App.Controller
|
||||||
})
|
})
|
||||||
|
|
||||||
# start action controller
|
# start action controller
|
||||||
showHistory = ->
|
showHistory = =>
|
||||||
new App.UserHistory( user_id: user.id )
|
new App.UserHistory(
|
||||||
|
user_id: user.id
|
||||||
|
container: @el.closest('.content')
|
||||||
|
)
|
||||||
|
|
||||||
editUser = =>
|
editUser = =>
|
||||||
new App.ControllerGenericEdit(
|
new App.ControllerGenericEdit(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.WidgetLink extends App.Controller
|
class App.WidgetLink extends App.Controller
|
||||||
events:
|
events:
|
||||||
'click .js-add': 'add',
|
'click .js-add': 'add'
|
||||||
'click .js-remove': 'remove',
|
'click .js-delete': 'delete'
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
@ -16,25 +16,20 @@ class App.WidgetLink extends App.Controller
|
||||||
# fetch item on demand
|
# fetch item on demand
|
||||||
# get data
|
# get data
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'links_' + @object.id + '_' + @object_type,
|
id: "links_#{@object.id}_#{@object_type}"
|
||||||
type: 'GET',
|
type: 'GET'
|
||||||
url: @apiPath + '/links',
|
url: "#{@apiPath}/links"
|
||||||
data: {
|
data:
|
||||||
link_object: @object_type,
|
link_object: @object_type
|
||||||
link_object_value: @object.id,
|
link_object_value: @object.id
|
||||||
}
|
processData: true
|
||||||
processData: true,
|
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
@links = data.links
|
@links = data.links
|
||||||
|
|
||||||
# load assets
|
|
||||||
App.Collection.loadAssets(data.assets)
|
App.Collection.loadAssets(data.assets)
|
||||||
|
|
||||||
@render()
|
@render()
|
||||||
)
|
)
|
||||||
|
|
||||||
render: =>
|
render: =>
|
||||||
|
|
||||||
list = {}
|
list = {}
|
||||||
for item in @links
|
for item in @links
|
||||||
if !list[ item['link_type'] ]
|
if !list[ item['link_type'] ]
|
||||||
|
@ -51,7 +46,7 @@ class App.WidgetLink extends App.Controller
|
||||||
links: list
|
links: list
|
||||||
)
|
)
|
||||||
|
|
||||||
remove: (e) =>
|
delete: (e) =>
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
link_type = $(e.target).data('link-type')
|
link_type = $(e.target).data('link-type')
|
||||||
link_object_source = $(e.target).data('object')
|
link_object_source = $(e.target).data('object')
|
||||||
|
@ -61,17 +56,16 @@ class App.WidgetLink extends App.Controller
|
||||||
|
|
||||||
# get data
|
# get data
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'links_remove_' + @object.id + '_' + @object_type,
|
id: "links_remove_#{@object.id}_#{@object_type}"
|
||||||
type: 'GET',
|
type: 'GET'
|
||||||
url: @apiPath + '/links/remove',
|
url: "#{@apiPath}/links/remove"
|
||||||
data: {
|
data:
|
||||||
link_type: link_type,
|
link_type: link_type
|
||||||
link_object_source: link_object_source,
|
link_object_source: link_object_source
|
||||||
link_object_source_value: link_object_source_value,
|
link_object_source_value: link_object_source_value
|
||||||
link_object_target: link_object_target,
|
link_object_target: link_object_target
|
||||||
link_object_target_value: link_object_target_value,
|
link_object_target_value: link_object_target_value
|
||||||
}
|
processData: true
|
||||||
processData: true,
|
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
@fetch()
|
@fetch()
|
||||||
)
|
)
|
||||||
|
@ -86,42 +80,37 @@ class App.WidgetLink extends App.Controller
|
||||||
container: @container
|
container: @container
|
||||||
)
|
)
|
||||||
|
|
||||||
class App.LinkAdd extends App.ControllerModal
|
class App.LinkAdd extends App.ControllerModalNice
|
||||||
|
buttonClose: true
|
||||||
|
buttonCancel: true
|
||||||
|
buttonSubmit: true
|
||||||
|
head: 'Link'
|
||||||
|
shown: false
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
@head = 'Links'
|
|
||||||
@button = true
|
|
||||||
@cancel = true
|
|
||||||
|
|
||||||
@ticket = @object
|
@ticket = @object
|
||||||
|
|
||||||
@fetch()
|
@fetch()
|
||||||
|
|
||||||
fetch: ->
|
fetch: ->
|
||||||
|
|
||||||
# merge tickets
|
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'ticket_related'
|
id: 'ticket_related'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: @apiPath + '/ticket_related/' + @ticket.id
|
url: "#{@apiPath}/ticket_related/#{@ticket.id}"
|
||||||
processData: true,
|
processData: true
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
# load assets
|
|
||||||
App.Collection.loadAssets(data.assets)
|
App.Collection.loadAssets(data.assets)
|
||||||
|
|
||||||
@ticket_ids_by_customer = data.ticket_ids_by_customer
|
@ticket_ids_by_customer = data.ticket_ids_by_customer
|
||||||
@ticket_ids_recent_viewed = data.ticket_ids_recent_viewed
|
@ticket_ids_recent_viewed = data.ticket_ids_recent_viewed
|
||||||
@render()
|
@render()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
content: =>
|
||||||
render: ->
|
content = $( App.view('link/add')(
|
||||||
@content = $ App.view('link/add')(
|
link_object: @link_object
|
||||||
link_object: @link_object,
|
link_object_id: @link_object_id
|
||||||
link_object_id: @link_object_id,
|
object: @object
|
||||||
object: @object,
|
))
|
||||||
)
|
|
||||||
|
|
||||||
list = []
|
list = []
|
||||||
for ticket_id in @ticket_ids_by_customer
|
for ticket_id in @ticket_ids_by_customer
|
||||||
|
@ -129,11 +118,11 @@ class App.LinkAdd extends App.ControllerModal
|
||||||
ticketItem = App.Ticket.fullLocal( ticket_id )
|
ticketItem = App.Ticket.fullLocal( ticket_id )
|
||||||
list.push ticketItem
|
list.push ticketItem
|
||||||
new App.ControllerTable(
|
new App.ControllerTable(
|
||||||
el: @content.find('#ticket-merge-customer-tickets'),
|
el: content.find('#ticket-merge-customer-tickets')
|
||||||
overview: [ 'number', 'title', 'state', 'group', 'created_at' ]
|
overview: [ 'number', 'title', 'state', 'group', 'created_at' ]
|
||||||
model: App.Ticket,
|
model: App.Ticket
|
||||||
objects: list,
|
objects: list
|
||||||
radio: true,
|
radio: true
|
||||||
)
|
)
|
||||||
|
|
||||||
list = []
|
list = []
|
||||||
|
@ -142,28 +131,26 @@ class App.LinkAdd extends App.ControllerModal
|
||||||
ticketItem = App.Ticket.fullLocal( ticket_id )
|
ticketItem = App.Ticket.fullLocal( ticket_id )
|
||||||
list.push ticketItem
|
list.push ticketItem
|
||||||
new App.ControllerTable(
|
new App.ControllerTable(
|
||||||
el: @content.find('#ticket-merge-recent-tickets'),
|
el: content.find('#ticket-merge-recent-tickets')
|
||||||
overview: [ 'number', 'title', 'state', 'group', 'created_at' ]
|
overview: [ 'number', 'title', 'state', 'group', 'created_at' ]
|
||||||
model: App.Ticket,
|
model: App.Ticket
|
||||||
objects: list,
|
objects: list
|
||||||
radio: true,
|
radio: true
|
||||||
)
|
)
|
||||||
|
|
||||||
@content.delegate('[name="ticket_number"]', 'focus', (e) ->
|
content.delegate('[name="ticket_number"]', 'focus', (e) ->
|
||||||
$(e.target).parents().find('[name="radio"]').prop( 'checked', false )
|
$(e.target).parents().find('[name="radio"]').prop( 'checked', false )
|
||||||
)
|
)
|
||||||
|
|
||||||
@content.delegate('[name="radio"]', 'click', (e) ->
|
content.delegate('[name="radio"]', 'click', (e) ->
|
||||||
if $(e.target).prop('checked')
|
if $(e.target).prop('checked')
|
||||||
ticket_id = $(e.target).val()
|
ticket_id = $(e.target).val()
|
||||||
ticket = App.Ticket.fullLocal( ticket_id )
|
ticket = App.Ticket.fullLocal( ticket_id )
|
||||||
$(e.target).parents().find('[name="ticket_number"]').val( ticket.number )
|
$(e.target).parents().find('[name="ticket_number"]').val( ticket.number )
|
||||||
)
|
)
|
||||||
|
content
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) =>
|
onSubmit: (e) =>
|
||||||
e.preventDefault()
|
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
|
||||||
if !params['ticket_number']
|
if !params['ticket_number']
|
||||||
|
@ -175,18 +162,17 @@ class App.LinkAdd extends App.ControllerModal
|
||||||
|
|
||||||
# get data
|
# get data
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'links_add_' + @object.id + '_' + @object_type,
|
id: "links_add_#{@object.id}_#{@object_type}"
|
||||||
type: 'GET',
|
type: 'GET'
|
||||||
url: @apiPath + '/links/add',
|
url: "#{@apiPath}/links/add"
|
||||||
data: {
|
data:
|
||||||
link_type: params['link_type'],
|
link_type: params['link_type']
|
||||||
link_object_target: 'Ticket',
|
link_object_target: 'Ticket'
|
||||||
link_object_target_value: @object.id,
|
link_object_target_value: @object.id
|
||||||
link_object_source: 'Ticket',
|
link_object_source: 'Ticket'
|
||||||
link_object_source_number: params['ticket_number'],
|
link_object_source_number: params['ticket_number']
|
||||||
}
|
processData: true
|
||||||
processData: true,
|
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
@hide()
|
@close()
|
||||||
@parent.fetch()
|
@parent.fetch()
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,6 +15,8 @@ class Widget extends App.Controller
|
||||||
if message.reload
|
if message.reload
|
||||||
@disconnectClient()
|
@disconnectClient()
|
||||||
button = 'Continue session'
|
button = 'Continue session'
|
||||||
|
else
|
||||||
|
button = 'Close'
|
||||||
|
|
||||||
# convert to html and linkify
|
# convert to html and linkify
|
||||||
message.message = App.Utils.textCleanup( message.message )
|
message.message = App.Utils.textCleanup( message.message )
|
||||||
|
@ -22,11 +24,11 @@ class Widget extends App.Controller
|
||||||
|
|
||||||
new App.SessionMessage(
|
new App.SessionMessage(
|
||||||
head: message.head
|
head: message.head
|
||||||
content: message.message
|
contentInline: message.message
|
||||||
keyboard: true
|
keyboard: true
|
||||||
backdrop: true
|
backdrop: true
|
||||||
close: true
|
buttonClose: true
|
||||||
button: button
|
buttonSubmit: button
|
||||||
forceReload: message.reload
|
forceReload: message.reload
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -40,11 +40,11 @@ class Widget extends App.Controller
|
||||||
if data.taskbar_id isnt App.TaskManager.TaskbarId()
|
if data.taskbar_id isnt App.TaskManager.TaskbarId()
|
||||||
@error = new App.SessionMessage(
|
@error = new App.SessionMessage(
|
||||||
head: 'Session'
|
head: 'Session'
|
||||||
message: App.i18n.translateInline('A new session with your account was created. This session will be stopped to prevent a conflict.')
|
message: 'A new session with your account was created. This session will be stopped to prevent a conflict.'
|
||||||
keyboard: false
|
keyboard: false
|
||||||
backdrop: true
|
backdrop: true
|
||||||
close: false
|
buttonClose: false
|
||||||
button: 'Continue session'
|
buttonSubmit: 'Continue session'
|
||||||
forceReload: true
|
forceReload: true
|
||||||
)
|
)
|
||||||
@disconnectClient()
|
@disconnectClient()
|
||||||
|
|
|
@ -32,11 +32,12 @@ class Widget extends App.Controller
|
||||||
|
|
||||||
# observe if text has been translated
|
# observe if text has been translated
|
||||||
$('body')
|
$('body')
|
||||||
.on '.translation', 'focus', (e) ->
|
.on 'focus.translation', '.translation', (e) ->
|
||||||
element = $(e.target)
|
element = $(e.target)
|
||||||
element.data 'before', element.html()
|
element.data 'before', element.html()
|
||||||
element
|
element
|
||||||
.on '.translation', 'blur', (e) =>
|
.on 'blur.translation', '.translation', (e) =>
|
||||||
|
console.log('blur')
|
||||||
element = $(e.target)
|
element = $(e.target)
|
||||||
source = element.attr('title')
|
source = element.attr('title')
|
||||||
|
|
||||||
|
@ -66,16 +67,17 @@ class Widget extends App.Controller
|
||||||
else
|
else
|
||||||
translation = new App.Translation
|
translation = new App.Translation
|
||||||
translation.load(
|
translation.load(
|
||||||
locale: @locale
|
locale: App.i18n.get()
|
||||||
source: source
|
source: source
|
||||||
target: translation_new
|
target: translation_new
|
||||||
|
initial_target: ''
|
||||||
)
|
)
|
||||||
translation.save()
|
translation.save()
|
||||||
|
|
||||||
element
|
element
|
||||||
|
|
||||||
disable: ->
|
disable: ->
|
||||||
$('body').off('.translation')
|
$('body').off('focus.translation blur.translation')
|
||||||
|
|
||||||
# disable translation inline
|
# disable translation inline
|
||||||
App.Config.set('translation_inline', false)
|
App.Config.set('translation_inline', false)
|
||||||
|
|
|
@ -20,23 +20,9 @@ class TranslationSupport extends App.Controller
|
||||||
meta = App.i18n.meta()
|
meta = App.i18n.meta()
|
||||||
percent = parseInt( meta.translated / (meta.total / 100) )
|
percent = parseInt( meta.translated / (meta.total / 100) )
|
||||||
return if percent > 95
|
return if percent > 95
|
||||||
message = App.i18n.translateContent('Only %s% of this language is translated, help to improve Zammad and complete the translation.', percent)
|
|
||||||
if percent > 80
|
|
||||||
message = App.i18n.translateContent('Up to %s% of this language is translated, help to make Zammad even better and complete the translation.', percent)
|
|
||||||
|
|
||||||
# show message
|
# show message
|
||||||
modal = new App.ControllerModal(
|
new Modal(percent: percent)
|
||||||
head: App.i18n.translateContent('Help to improve Zammad!')
|
|
||||||
message: message
|
|
||||||
cancel: false
|
|
||||||
close: true
|
|
||||||
shown: true
|
|
||||||
button: 'Complete translations'
|
|
||||||
buttonClass: 'btn--success'
|
|
||||||
onSubmitCallback: =>
|
|
||||||
@navigate '#system/translation'
|
|
||||||
modal.hide()
|
|
||||||
)
|
|
||||||
|
|
||||||
@bind 'i18n:language:change', =>
|
@bind 'i18n:language:change', =>
|
||||||
@delay(check, 2500, 'translation_support')
|
@delay(check, 2500, 'translation_support')
|
||||||
|
@ -45,3 +31,32 @@ class TranslationSupport extends App.Controller
|
||||||
@delay(check, 2500, 'translation_support')
|
@delay(check, 2500, 'translation_support')
|
||||||
|
|
||||||
App.Config.set( 'translaton_support', TranslationSupport, 'Widgets' )
|
App.Config.set( 'translaton_support', TranslationSupport, 'Widgets' )
|
||||||
|
|
||||||
|
class Modal extends App.ControllerModalNice
|
||||||
|
buttonClose: true
|
||||||
|
buttonCancel: 'No Thanks!'
|
||||||
|
buttonSubmit: 'Complete translations'
|
||||||
|
head: 'Help to improve Zammad!'
|
||||||
|
shown: false
|
||||||
|
|
||||||
|
constructor: ->
|
||||||
|
super
|
||||||
|
return if App.LocalStorage.get('translation_support_no', @Session.get('id'))
|
||||||
|
@render()
|
||||||
|
|
||||||
|
content: =>
|
||||||
|
better = false
|
||||||
|
if @percent > 80
|
||||||
|
better = true
|
||||||
|
App.view('translation/support')(
|
||||||
|
percent: @percent
|
||||||
|
better: better
|
||||||
|
)
|
||||||
|
|
||||||
|
onCancel: =>
|
||||||
|
App.LocalStorage.set('translation_support_no', true, @Session.get('id'))
|
||||||
|
@onClose()
|
||||||
|
|
||||||
|
onSubmit: =>
|
||||||
|
@navigate '#system/translation'
|
||||||
|
@onClose()
|
||||||
|
|
|
@ -73,10 +73,10 @@ class _ajaxSingleton
|
||||||
return if status is 502
|
return if status is 502
|
||||||
|
|
||||||
# show error message
|
# show error message
|
||||||
new App.ErrorModal(
|
new App.ControllerModalNice(
|
||||||
message: 'StatusCode: ' + status
|
head: 'StatusCode: ' + status
|
||||||
detail: detail
|
contentInline: '<pre>' + App.Utils.htmlEscape(detail) + '</pre>'
|
||||||
close: true
|
buttonClose: true
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,11 @@ class App.Browser
|
||||||
# disable id older
|
# disable id older
|
||||||
if data.browser
|
if data.browser
|
||||||
if map[data.browser.name] && data.browser.major < map[data.browser.name]
|
if map[data.browser.name] && data.browser.major < map[data.browser.name]
|
||||||
@message(data, map[data.browser.name])
|
new Modal(
|
||||||
console.log('Browser not supported')
|
data: data
|
||||||
|
version: map[data.browser.name]
|
||||||
|
)
|
||||||
|
App.Log.error('Browser', 'Browser not supported')
|
||||||
return false
|
return false
|
||||||
|
|
||||||
# allow browser
|
# allow browser
|
||||||
|
@ -73,12 +76,13 @@ class App.Browser
|
||||||
localStorage.setItem('fingerprint', fingerprint)
|
localStorage.setItem('fingerprint', fingerprint)
|
||||||
fingerprint
|
fingerprint
|
||||||
|
|
||||||
@message: (data, version) ->
|
class Modal extends App.ControllerModalNice
|
||||||
new App.ControllerModal(
|
buttonClose: false
|
||||||
head: 'Browser too old!'
|
buttonCancel: false
|
||||||
message: "Your Browser is not supported (#{data.browser.name} #{data.browser.major} on #{data.os.name}). Please use a newer one (e. g. #{data.browser.name} #{version} or higher)."
|
buttonSubmit: false
|
||||||
close: false
|
|
||||||
backdrop: false
|
backdrop: false
|
||||||
keyboard: false
|
keyboard: false
|
||||||
shown: true
|
head: 'Browser too old!'
|
||||||
)
|
|
||||||
|
content: ->
|
||||||
|
"Your Browser is not supported (#{@data.browser.name} #{@data.browser.major} on #{@data.os.name}). Please use a newer one (e. g. #{@data.browser.name} #{@version} or higher)."
|
||||||
|
|
|
@ -294,26 +294,22 @@ class App.UserOrganizationAutocompletion extends App.Controller
|
||||||
container: @el.closest('.content')
|
container: @el.closest('.content')
|
||||||
)
|
)
|
||||||
|
|
||||||
class UserNew extends App.ControllerModal
|
class UserNew extends App.ControllerModalNice
|
||||||
constructor: ->
|
buttonClose: true
|
||||||
super
|
buttonCancel: true
|
||||||
@head = 'New User'
|
buttonSubmit: true
|
||||||
@cancel = true
|
head: 'User'
|
||||||
@button = true
|
headPrefix: 'New'
|
||||||
|
|
||||||
|
content: ->
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
model: App.User
|
model: App.User
|
||||||
screen: 'edit'
|
screen: 'edit'
|
||||||
autofocus: true
|
autofocus: true
|
||||||
)
|
)
|
||||||
|
controller.form
|
||||||
|
|
||||||
@content = controller.form
|
onSubmit: (e) =>
|
||||||
|
|
||||||
@show()
|
|
||||||
|
|
||||||
onSubmit: (e) ->
|
|
||||||
|
|
||||||
e.preventDefault()
|
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
|
|
||||||
# if no login is given, use emails as fallback
|
# if no login is given, use emails as fallback
|
||||||
|
@ -346,9 +342,9 @@ class UserNew extends App.ControllerModal
|
||||||
ui.parent.close()
|
ui.parent.close()
|
||||||
|
|
||||||
# start customer info controller
|
# start customer info controller
|
||||||
ui.hide()
|
ui.close()
|
||||||
App.User.full(@id, callbackReload , true)
|
App.User.full(@id, callbackReload , true)
|
||||||
|
|
||||||
fail: ->
|
fail: ->
|
||||||
ui.hide()
|
ui.close()
|
||||||
)
|
)
|
|
@ -256,14 +256,7 @@ class _webSocketSingleton extends App.Controller
|
||||||
message = =>
|
message = =>
|
||||||
|
|
||||||
# show reconnect message
|
# show reconnect message
|
||||||
@error = new App.ControllerModal(
|
@error = new Modal()
|
||||||
head: 'Lost network connection!'
|
|
||||||
message: 'Trying to reconnect...'
|
|
||||||
backdrop: false
|
|
||||||
keyboard: false
|
|
||||||
close: false
|
|
||||||
shown: true
|
|
||||||
)
|
|
||||||
if !@tryToConnect
|
if !@tryToConnect
|
||||||
App.Delay.set message, 7000, 'websocket-no-connection-try-reconnect-message', 'ws'
|
App.Delay.set message, 7000, 'websocket-no-connection-try-reconnect-message', 'ws'
|
||||||
@tryToConnect = true
|
@tryToConnect = true
|
||||||
|
@ -380,3 +373,14 @@ class _webSocketSingleton extends App.Controller
|
||||||
@_ajaxInit( force: true )
|
@_ajaxInit( force: true )
|
||||||
@_ajaxReceiveWorking = false
|
@_ajaxReceiveWorking = false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Modal extends App.ControllerModalNice
|
||||||
|
buttonClose: false
|
||||||
|
buttonCancel: false
|
||||||
|
buttonSubmit: false
|
||||||
|
backdrop: 'static'
|
||||||
|
keyboard: false
|
||||||
|
head: 'Lost network connection!'
|
||||||
|
|
||||||
|
content: ->
|
||||||
|
'Trying to reconnect...'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.Translation extends App.Model
|
class App.Translation extends App.Model
|
||||||
@configure 'Translation', 'source', 'target', 'locale'
|
@configure 'Translation', 'source', 'target', 'target_initial', 'locale'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: @apiPath + '/translations'
|
@url: @apiPath + '/translations'
|
|
@ -22,14 +22,14 @@
|
||||||
<div class="action-flow action-flow--row">
|
<div class="action-flow action-flow--row">
|
||||||
<div class="action-row">
|
<div class="action-row">
|
||||||
<div class="action-flow action-flow--noWrap">
|
<div class="action-flow action-flow--noWrap">
|
||||||
<h2><% if !_.isEmpty(calendar.ical_url): %><span title="<%- @T('Last sync at') %>: <%= @Ttimestamp(calendar.last_sync) %><% if calendar.last_log: %>: <%= calendar.last_log %><% end %>">
|
<h2><% if !_.isEmpty(calendar.ical_url): %><span title="<%- @Ti('Last sync at') %>: <%- @Ttimestamp(calendar.last_sync) %><% if calendar.last_log: %>: <%= calendar.last_log %><% end %>">
|
||||||
<% if calendar.last_log: %>
|
<% if calendar.last_log: %>
|
||||||
<%- @Icon('status', 'error inline') %>
|
<%- @Icon('status', 'error inline') %>
|
||||||
<% else: %>
|
<% else: %>
|
||||||
<%- @Icon('status', 'ok inline') %>
|
<%- @Icon('status', 'ok inline') %>
|
||||||
<% end %></span><% end %> <%= calendar.name %></h2>
|
<% end %></span><% end %> <%= calendar.name %></h2>
|
||||||
<% if calendar.default: %>
|
<% if calendar.default: %>
|
||||||
<div class="action-label">Default</div>
|
<div class="action-label"><%- @T('Default') %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<label for="form-message-title"><%- @T('Title of the form') %></label>
|
<label for="form-message-title"><%- @T('Title of the form') %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="form-message-title" name="messageTitle" value="<%- @T('Feedback Form') %>">
|
<input type="text" id="form-message-title" name="messageTitle" value="<%- @Ti('Feedback Form') %>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="input form-group">
|
<div class="input form-group">
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<label for="form-message-submit"><%- @T('Name of form submit button') %></label>
|
<label for="form-message-submit"><%- @T('Name of form submit button') %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="form-message-submit" name="messageSubmit" value="<%- @T('Submit') %>">
|
<input type="text" id="form-message-submit" name="messageSubmit" value="<%- @Ti('Submit') %>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="input form-group">
|
<div class="input form-group">
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
<label for="form-message-thank-you"><%- @T('Message after sending form') %></label>
|
<label for="form-message-thank-you"><%- @T('Message after sending form') %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<textarea type="text" id="form-message-thank-you" name="messageThankYou" rows="3"><%- @T('Thank you for your inquiry! We\'ll contact you soon as possible.') %></textarea>
|
<textarea type="text" id="form-message-thank-you" name="messageThankYou" rows="3"><%- @Ti('Thank you for your inquiry! We\'ll contact you soon as possible.') %></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<p><%= @T(@explanation) %></p>
|
<p><%- @T(@explanation) %></p>
|
||||||
|
|
||||||
<table class="table table--placeholder">
|
<table class="table table--placeholder">
|
||||||
<thead><tr><th><%- @T('No Entries') %>
|
<thead><tr><th><%- @T('No Entries') %>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-header-meta">
|
<div class="page-header-meta">
|
||||||
<div class="btn btn--action" data-type="settings"><%= @T('Settings') %></div>
|
<div class="btn btn--action" data-type="settings"><%- @T('Settings') %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-workspace"></div>
|
<div class="chat-workspace"></div>
|
||||||
|
|
|
@ -16,5 +16,5 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-controls">
|
<div class="chat-controls">
|
||||||
<div class="chat-input form-control form-control--small form-control--multiline js-customerChatInput" contenteditable="true"></div>
|
<div class="chat-input form-control form-control--small form-control--multiline js-customerChatInput" contenteditable="true"></div>
|
||||||
<div class="btn btn--primary btn--slim btn--small js-send"><%= @T('Send') %></div>
|
<div class="btn btn--primary btn--slim btn--small js-send"><%- @T('Send') %></div>
|
||||||
</div>
|
</div>
|
|
@ -2,28 +2,20 @@
|
||||||
<form>
|
<form>
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<% if @close: %>
|
<% if @buttonClose: %>
|
||||||
<div class="modal-close js-close">
|
<div class="modal-close js-close">
|
||||||
<%- @Icon('diagonal-cross') %>
|
<%- @Icon('diagonal-cross') %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<h1 class="modal-title"><%- @T( @head ) %></h1>
|
<h1 class="modal-title"><% if @headPrefix: %><%- @T(@headPrefix) %>: <% end %><%- @T(@head) %></h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<% if @message: %>
|
|
||||||
<p><%= @message %></p>
|
|
||||||
<% end %>
|
|
||||||
<% if @detail: %>
|
|
||||||
<pre><%= @detail %></pre>
|
|
||||||
<% end %>
|
|
||||||
<% if @content: %>
|
|
||||||
<%- @content %>
|
<%- @content %>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<% if @cancel: %>
|
<% if @buttonCancel: %>
|
||||||
<div class="modal-leftFooter">
|
<div class="modal-leftFooter">
|
||||||
<a class="btn btn--text btn--subtle js-cancel align-left" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
|
<a class="btn btn--text btn--subtle js-cancel align-left" href="#/"><%- @T(@buttonCancel) %></a>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% for button in @centerButtons: %>
|
<% for button in @centerButtons: %>
|
||||||
|
@ -31,9 +23,9 @@
|
||||||
<div class="btn <%= button.className %> align-center"><%- @T(button.text) %></div>
|
<div class="btn <%= button.className %> align-center"><%- @T(button.text) %></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @button: %>
|
<% if @buttonSubmit: %>
|
||||||
<div class="modal-rightFooter">
|
<div class="modal-rightFooter">
|
||||||
<button type="submit" class="btn <%= @buttonClass %> js-submit align-right"><%- @T( @button ) %></button>
|
<button type="submit" class="btn <%= @buttonClass %> js-submit align-right"><%- @T(@buttonSubmit) %></button>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="page-header-title">
|
<div class="page-header-title">
|
||||||
<h1><%= @T('Calendar') %></h1>
|
<h1><%- @T('Calendar') %></h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<h2><%= @T('Ticket Subscriptions') %></h2>
|
<h2><%- @T('Ticket Subscriptions') %></h2>
|
||||||
|
|
||||||
<p><%= @T('See your tickets from within your favorite calendar by adding the following url to your calendar app.') %></p>
|
<p><%- @T('See your tickets from within your favorite calendar by adding the following url to your calendar app.') %></p>
|
||||||
|
|
||||||
<h3><%= @T('URL') %></h3>
|
<h3><%- @T('URL') %></h3>
|
||||||
<input class="form-control js-select" readonly value="<%= @baseurl %>/ical/tickets">
|
<input class="form-control js-select" readonly value="<%= @baseurl %>/ical/tickets">
|
||||||
|
|
||||||
<h3><%= @T('Subscription Settings') %></h3>
|
<h3><%- @T('Subscription Settings') %></h3>
|
||||||
<table class="settings-list">
|
<table class="settings-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="white-space: nowrap;"><%= @T('Status Type') %>
|
<th style="white-space: nowrap;"><%- @T('Status Type') %>
|
||||||
<th colspan="2"><%= @T('Options') %>
|
<th colspan="2"><%- @T('Options') %>
|
||||||
<th width="100%"><%= @T('Direct URL') %>
|
<th width="100%"><%- @T('Direct URL') %>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -30,18 +30,18 @@
|
||||||
<input type="checkbox" name="<%= stateType %>/own"<%= if options.own then ' checked' %>>
|
<input type="checkbox" name="<%= stateType %>/own"<%= if options.own then ' checked' %>>
|
||||||
<%- @Icon('checkbox', 'icon-unchecked') %>
|
<%- @Icon('checkbox', 'icon-unchecked') %>
|
||||||
<%- @Icon('checkbox-checked', 'icon-checked') %>
|
<%- @Icon('checkbox-checked', 'icon-checked') %>
|
||||||
<span class="label-text"><%= @T('own tickets') %></span>
|
<span class="label-text"><%- @T('own tickets') %></span>
|
||||||
</label>
|
</label>
|
||||||
<td>
|
<td>
|
||||||
<label class="inline-label checkbox-replacement">
|
<label class="inline-label checkbox-replacement">
|
||||||
<input type="checkbox" name="<%= stateType %>/not_assigned"<%= if options.not_assigned then ' checked' %>>
|
<input type="checkbox" name="<%= stateType %>/not_assigned"<%= if options.not_assigned then ' checked' %>>
|
||||||
<%- @Icon('checkbox', 'icon-unchecked') %>
|
<%- @Icon('checkbox', 'icon-unchecked') %>
|
||||||
<%- @Icon('checkbox-checked', 'icon-checked') %>
|
<%- @Icon('checkbox-checked', 'icon-checked') %>
|
||||||
<span class="label-text"><%= @T('not assigned tickets') %></span>
|
<span class="label-text"><%- @T('not assigned tickets') %></span>
|
||||||
</label>
|
</label>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn btn--table btn--text js-showLink"><%= @T('Show') %></div>
|
<div class="btn btn--table btn--text js-showLink"><%- @T('Show') %></div>
|
||||||
<input class="form-control form-control--borderless js-select is-hidden" readonly value="<%= @baseurl %>/ical/tickets/<%= stateType %>">
|
<input class="form-control form-control--borderless js-select is-hidden" readonly value="<%- @baseurl %>/ical/tickets/<%= stateType %>">
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<% for profile in @profiles: %>
|
<% for profile in @profiles: %>
|
||||||
<% for backend in @metric.backend: %>
|
<% for backend in @metric.backend: %>
|
||||||
<% if backend.dataDownload: %>
|
<% if backend.dataDownload: %>
|
||||||
<li <% if backend.name is @downloadBackendSelected: %>class="is-active active"<% end %>><a href="#" class="js-dataDownloadBackendSelector" data-toggle="tab" data-profile-id="<%= profile.id %>" data-backend="<%= backend.name %>"><%= @T(backend.display) %></a></li>
|
<li <% if backend.name is @downloadBackendSelected: %>class="is-active active"<% end %>><a href="#" class="js-dataDownloadBackendSelector" data-toggle="tab" data-profile-id="<%= profile.id %>" data-backend="<%= backend.name %>"><%- @T(backend.display) %></a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -40,6 +40,8 @@ dedicated:
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
json: true,
|
json: true,
|
||||||
|
open_timeout: 6,
|
||||||
|
read_timeout: 16,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
fail "Can't load translations from #{url}: #{result.error}" if !result.success?
|
fail "Can't load translations from #{url}: #{result.error}" if !result.success?
|
||||||
|
@ -114,6 +116,8 @@ push translations to online
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
json: true,
|
json: true,
|
||||||
|
open_timeout: 6,
|
||||||
|
read_timeout: 16,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
fail "Can't push translations to #{url}: #{result.error}" if !result.success?
|
fail "Can't push translations to #{url}: #{result.error}" if !result.success?
|
||||||
|
|
|
@ -16,11 +16,11 @@ get http/https calls
|
||||||
result = UserAgent.get(
|
result = UserAgent.get(
|
||||||
'http://host/some_dir/some_file?param1=123',
|
'http://host/some_dir/some_file?param1=123',
|
||||||
{
|
{
|
||||||
:param1 => 'some value',
|
param1: 'some value',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:open_timeout => 2,
|
open_timeout: 4,
|
||||||
:read_timeout => 4,
|
read_timeout: 10,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ get json object
|
||||||
'http://host/some_dir/some_file?param1=123',
|
'http://host/some_dir/some_file?param1=123',
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
:json => true,
|
json: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -77,12 +77,12 @@ post http/https calls
|
||||||
result = UserAgent.post(
|
result = UserAgent.post(
|
||||||
'http://host/some_dir/some_file',
|
'http://host/some_dir/some_file',
|
||||||
{
|
{
|
||||||
:param1 => 1,
|
param1: 1,
|
||||||
:param2 => 2,
|
param2: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:open_timeout => 2,
|
open_timeout: 4,
|
||||||
:read_timeout => 4,
|
read_timeout: 10,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -125,12 +125,12 @@ put http/https calls
|
||||||
result = UserAgent.put(
|
result = UserAgent.put(
|
||||||
'http://host/some_dir/some_file',
|
'http://host/some_dir/some_file',
|
||||||
{
|
{
|
||||||
:param1 => 1,
|
param1: 1,
|
||||||
:param2 => 2,
|
param2: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:open_timeout => 2,
|
open_timeout: 4,
|
||||||
:read_timeout => 4,
|
read_timeout: 10,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -173,8 +173,8 @@ delete http/https calls
|
||||||
result = UserAgent.delete(
|
result = UserAgent.delete(
|
||||||
'http://host/some_dir/some_file',
|
'http://host/some_dir/some_file',
|
||||||
{
|
{
|
||||||
:open_timeout => 2,
|
open_timeout: 4,
|
||||||
:read_timeout => 4,
|
read_timeout: 10,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -221,8 +221,8 @@ perform get http/https/ftp calls
|
||||||
result = UserAgent.request(
|
result = UserAgent.request(
|
||||||
'http://host/some_dir/some_file?param1=123',
|
'http://host/some_dir/some_file?param1=123',
|
||||||
{
|
{
|
||||||
:open_timeout => 2,
|
open_timeout: 4,
|
||||||
:read_timeout => 4,
|
read_timeout: 10,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
<span class="zammad-chat-loading-circle"></span>
|
<span class="zammad-chat-loading-circle"></span>
|
||||||
<span class="zammad-chat-loading-circle"></span>
|
<span class="zammad-chat-loading-circle"></span>
|
||||||
</span>
|
</span>
|
||||||
<span class="zammad-chat-modal-text"><%= @T('Connecting') %></span>
|
<span class="zammad-chat-modal-text"><%- @T('Connecting') %></span>
|
||||||
</div>
|
</div>
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="zammad-chat-modal">
|
<div class="zammad-chat-modal">
|
||||||
<div class="zammad-chat-modal-text">
|
<div class="zammad-chat-modal-text">
|
||||||
<%- @T('Since you didn\'t respond in the last %s your conversation with <strong>%s</strong> got closed.', "#{ @delay } #{ @unit }", @agent) %><br>
|
<%- @T('Since you didn\'t respond in the last %s your conversation with <strong>%s</strong> got closed.', "#{ @delay } #{ @unit }", @agent) %><br>
|
||||||
<div class="zammad-chat-button"<%= " style='background: #{ @background }'" if @background %>><%= @T('Start new conversation') %></div>
|
<div class="zammad-chat-button"<%= " style='background: #{ @background }'" if @background %>><%- @T('Start new conversation') %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
Loading…
Reference in a new issue