Merge branch 'develop' of github.com:martini/zammad into develop

This commit is contained in:
Felix Niklas 2015-10-19 15:23:23 +02:00
commit fb8666b0e4
20 changed files with 85 additions and 52 deletions

View file

@ -531,6 +531,21 @@ class App.Controller extends Spine.Controller
stopPropagation: (e) ->
e.stopPropagation()
startLoading: (el) =>
return if @initLoadingDone && !el
@initLoadingDone = true
@stopLoading()
later = =>
if el
el.html App.view('generic/page_loading')()
else
@html App.view('generic/page_loading')()
@initLoadingDoneDelay = @delay(later, 2800)
stopLoading: =>
return if !@initLoadingDoneDelay
@clearDelay(@initLoadingDoneDelay)
class App.ControllerPermanent extends App.Controller
constructor: ->
super

View file

@ -244,6 +244,9 @@ class App.ChannelEmailAccountOverview extends App.Controller
#@load()
load: =>
@startLoading()
@ajax(
id: 'email_index'
type: 'GET'
@ -251,6 +254,8 @@ class App.ChannelEmailAccountOverview extends App.Controller
processData: true
success: (data, status, xhr) =>
@stopLoading()
# load assets
App.Collection.loadAssets(data.assets)

View file

@ -8,12 +8,14 @@ class App.SettingsArea extends App.Controller
@load()
load: ->
@startLoading()
@ajax(
id: "setting_area_#{@area}"
type: 'GET'
url: "#{@apiPath}/settings/area/#{@area}"
processData: true
success: (data, status, xhr) =>
@stopLoading()
App.Collection.load( localStorage: false, type: 'Setting', data: data )
@render()
)

View file

@ -16,6 +16,7 @@ class Index extends App.ControllerContent
#@load()
load: =>
@startLoading()
@ajax(
id: 'calendar_index'
type: 'GET'
@ -29,6 +30,7 @@ class Index extends App.ControllerContent
# load assets
App.Collection.loadAssets(data.assets)
@stopLoading()
@render(data)
)

View file

@ -10,12 +10,14 @@ class Index extends App.ControllerTabs
@title 'Objects', true
# get data
@startLoading()
@ajax(
id: 'object_manager_attributes_list'
type: 'GET'
url: @apiPath + '/object_manager_attributes_list'
processData: true
success: (data, status, xhr) =>
@stopLoading()
@build(data.objects)
)

View file

@ -20,11 +20,13 @@ class Index extends App.ControllerContent
# fetch data, render view
load: ->
@startLoading()
@ajax(
id: 'sessions'
type: 'GET'
url: @apiPath + '/sessions'
success: (data) =>
@stopLoading()
@render(data)
)

View file

@ -15,16 +15,15 @@ class Index extends App.ControllerContent
#@load()
load: =>
@startLoading()
@ajax(
id: 'sla_index'
type: 'GET'
url: @apiPath + '/slas'
processData: true
success: (data, status, xhr) =>
# load assets
App.Collection.loadAssets(data.assets)
@stopLoading()
@render(data)
)

View file

@ -255,12 +255,14 @@ class TranslationList extends App.Controller
)
load: =>
@startLoading()
@ajax(
id: 'translations_admin'
type: 'GET'
url: @apiPath + "/translations/admin/lang/#{@locale}"
processData: true
success: (data, status, xhr) =>
@stopLoading()
@render(data)
)

View file

@ -47,16 +47,15 @@ class App.TriggerTime extends App.Controller
#@load()
load: =>
@startLoading()
@ajax(
id: 'trigger_time_index'
type: 'GET'
url: @apiPath + '/jobs'
processData: true
success: (data, status, xhr) =>
# load assets
#App.Collection.loadAssets(data.assets)
@stopLoading()
@render(data)
)

View file

@ -49,6 +49,7 @@ class Index extends App.Controller
@recent()
renderResult: (user_ids = []) ->
@stopLoading()
callbackHeader = (header) ->
attribute =
@ -126,6 +127,7 @@ class Index extends App.Controller
@$('.tab.active').each( (i,d) ->
role_ids.push $(d).data('id')
)
@startLoading(@$('.table-overview'))
App.Ajax.request(
id: 'search'
type: 'GET'
@ -137,11 +139,10 @@ class Index extends App.Controller
full: 1
processData: true,
success: (data, status, xhr) =>
# load assets
App.Collection.loadAssets( data.assets )
App.Collection.loadAssets(data.assets)
@renderResult(data.user_ids)
done: =>
@stopLoading()
)
recent: =>
@ -149,6 +150,7 @@ class Index extends App.Controller
@$('.tab.active').each( (i,d) ->
role_ids.push $(d).data('id')
)
@startLoading(@$('.table-overview'))
App.Ajax.request(
id: 'search'
type: 'GET'
@ -159,11 +161,10 @@ class Index extends App.Controller
full: 1
processData: true,
success: (data, status, xhr) =>
# load assets
App.Collection.loadAssets( data.assets )
App.Collection.loadAssets(data.assets)
@renderResult(data.user_ids)
complete: =>
@stopLoading()
)
new: (e) ->

View file

@ -215,7 +215,7 @@ class App extends Spine.Controller
if escalation
cssClass += ' escalation'
humanTime = App.PrettyDate.humanTime(time, escalation)
"<time class=\"humanTimeFromNow #{cssClass}\" data-time=\"#{time}\" data-tooltip=\"#{timestamp}\">#{humanTime}</time>"
"<time class=\"humanTimeFromNow #{cssClass}\" data-time=\"#{time}\" title=\"#{timestamp}\">#{humanTime}</time>"
# define icon helper
params.Icon = (name, className = '') ->

View file

@ -32,7 +32,7 @@ class _delaySingleton extends Spine.Module
constructor: ->
@levelStack = {}
set: ( callback, timeout, key, level ) ->
set: ( callback, timeout, key, level ) =>
if !level
level = '_all'
@ -59,9 +59,9 @@ class _delaySingleton extends Spine.Module
level: level
}
return delay_id
key.toString()
clear: ( key, level ) ->
clear: ( key, level ) =>
if !level
level = '_all'
@ -80,19 +80,19 @@ class _delaySingleton extends Spine.Module
if _.isEmpty( @levelStack[ level ] )
delete @levelStack[ level ]
clearLevel: (level) ->
clearLevel: (level) =>
return if !@levelStack[ level ]
for key, data of @levelStack[ level ]
@clear( key, level )
delete @levelStack[level]
reset: ->
reset: =>
for level, items of @levelStack
for key, data of items
@clear( key, level )
@levelStack[level] = {}
true
_all: ->
_all: =>
@levelStack

View file

@ -32,7 +32,7 @@ class _intervalSingleton extends Spine.Module
constructor: ->
@levelStack = {}
set: ( callback, timeout, key, level ) ->
set: ( callback, timeout, key, level ) =>
if !level
level = '_all'
@ -57,9 +57,9 @@ class _intervalSingleton extends Spine.Module
level: level
}
return interval_id
key.toString()
clear: ( key, level ) ->
clear: ( key, level ) =>
if !level
level = '_all'
@ -78,18 +78,18 @@ class _intervalSingleton extends Spine.Module
if _.isEmpty( @levelStack[ level ] )
delete @levelStack[ level ]
clearLevel: (level) ->
clearLevel: (level) =>
return if !@levelStack[ level ]
for key, data of @levelStack[ level ]
@clear( key, level )
delete @levelStack[level]
reset: ->
reset: =>
for level, items of @levelStack
for key, data of items
@clear( key, level )
@levelStack[level] = {}
true
_all: ->
_all: =>
@levelStack

View file

@ -0,0 +1,4 @@
<div class="page-loading">
<div class="small loading icon"></div>
<div class="page-loading-label"><%- @T('Loading...') %></div>
</div>

View file

@ -37,7 +37,7 @@
<h1 contenteditable="true" class="ticket-title-update" data-placeholder="Enter Title...">Welcome to Zammad! We want to entertain you and your whole family!</h1>
</div>
<div class="ticket-meta">
<small class="task-subline">Ticket# <span class="ticket-number">10001</span> - erstellte <span class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" data-tooltip="11.07.2014 12:10">11.07.2014</span>
<small class="task-subline">Ticket# <span class="ticket-number">10001</span> - erstellte <span class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" title="11.07.2014 12:10">11.07.2014</span>
</small>
</div>
</div>
@ -102,7 +102,7 @@ The <a href="http://Zammad.org" title="http://Zammad.org" target="_blank">Zammad
</div>
</div>
</div>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" data-tooltip="2014-07-11 12:10">2014-07-11</time></small>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" title="2014-07-11 12:10">2014-07-11</time></small>
</div>
<div class="ticket-article-item agent note" data-id="23" id="article-23">
@ -140,7 +140,7 @@ The <a href="http://Zammad.org" title="http://Zammad.org" target="_blank">Zammad
</div>
</div>
</div>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-08-05T13:34:01.000Z" data-tooltip="2014-08-05 15:34">2014-08-05</time></small>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-08-05T13:34:01.000Z" title="2014-08-05 15:34">2014-08-05</time></small>
</div>
<div class="ticket-article-item customer phone" data-id="1" id="article-1">
@ -186,7 +186,7 @@ Grüße, Peter</div>
</div>
</div>
</div>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" data-tooltip="2014-07-11 12:10">2014-07-11</time></small>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" title="2014-07-11 12:10">2014-07-11</time></small>
</div>
<div class="ticket-article-item agent note" data-id="23" id="article-23">
@ -269,7 +269,7 @@ Oliver<br>
</div>
</div>
</div>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-08-05T13:34:01.000Z" data-tooltip="2014-08-05 15:34">2014-08-05</time></small>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-08-05T13:34:01.000Z" title="2014-08-05 15:34">2014-08-05</time></small>
</div>
</div>
</div>

View file

@ -46,7 +46,7 @@
</div>
<div class="ticket-meta">
<small class="task-subline">Ticket# <span class="ticket-number">10001</span> - created <span class="humanTimeFromNow" data-time="2015-01-12T12:58:42.000Z" data-tooltip="01/12/2015 13:58">01/12/2015</span></small>
<small class="task-subline">Ticket# <span class="ticket-number">10001</span> - created <span class="humanTimeFromNow" data-time="2015-01-12T12:58:42.000Z" title="01/12/2015 13:58">01/12/2015</span></small>
</div>
</div>
</div>
@ -155,7 +155,7 @@
<div class="article-content article-actions horizontal stretch">
<a class="article-action u-clickable" data-type="internal" href="">set to internal</a> <a class="article-action u-clickable" data-type="reply" href="#">reply</a> <a class="article-action u-clickable" data-type="split" href="#ticket/create/1/1">split</a>
</div>
</div><small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2015-01-12T12:58:42.000Z" data-tooltip="01/12/2015 13:58">01/12/2015</time></small>
</div><small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2015-01-12T12:58:42.000Z" title="01/12/2015 13:58">01/12/2015</time></small>
</div>
<div class="ticket-article-item agent" data-id="2" id="article-2">
@ -329,7 +329,7 @@
<div class="article-content article-actions horizontal stretch">
<a class="article-action u-clickable" data-type="internal" href="">set to internal</a> <a class="article-action u-clickable" data-type="split" href="#ticket/create/1/2">split</a>
</div>
</div><small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2015-01-12T14:02:35.000Z" data-tooltip="01/12/2015 15:02">01/12/2015</time></small>
</div><small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2015-01-12T14:02:35.000Z" title="01/12/2015 15:02">01/12/2015</time></small>
</div>
<div class="ticket-article-item agent" data-id="6" id="article-6">
@ -393,7 +393,7 @@
<div class="article-content article-actions horizontal stretch">
<a class="article-action u-clickable" data-type="internal" href="">set to internal</a> <a class="article-action u-clickable" data-type="split" href="#ticket/create/1/6">split</a>
</div>
</div><small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2015-05-05T10:25:01.000Z" data-tooltip="05/05/2015 12:25">05/05/2015</time></small>
</div><small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2015-05-05T10:25:01.000Z" title="05/05/2015 12:25">05/05/2015</time></small>
</div>
</div>
@ -753,7 +753,7 @@
<div class="task-text">
<a class="name ticket-popover" data-id="3" href="#ticket/zoom/3">Noch mehr Tickets bitte</a>
<div class="time humanTimeFromNow" data-time="2015-01-20T11:47:43.000Z" data-tooltip="01/20/2015 12:47">
<div class="time humanTimeFromNow" data-time="2015-01-20T11:47:43.000Z" title="01/20/2015 12:47">
01/20/2015
</div>
</div>

View file

@ -340,7 +340,7 @@
Users
</span> </td>
<td class="noTruncate"> <span>
<span class="humanTimeFromNow undefined" data-time="2015-01-12T12:58:42.000Z" data-tooltip="01/12/2015 13:58">01/12/2015</span> </span>
<span class="humanTimeFromNow undefined" data-time="2015-01-12T12:58:42.000Z" title="01/12/2015 13:58">01/12/2015</span> </span>
</td>
</tr>
<tr class="item" data-id="6" data-position="6" style="cursor: pointer;">
@ -359,7 +359,7 @@
Users
</span> </td>
<td class="noTruncate"> <span>
<span class="humanTimeFromNow undefined" data-time="2015-06-11T07:26:31.000Z" data-tooltip="06/11/2015 09:26">5 days 3 hours ago</span> </span>
<span class="humanTimeFromNow undefined" data-time="2015-06-11T07:26:31.000Z" title="06/11/2015 09:26">5 days 3 hours ago</span> </span>
</td>
</tr>
</tbody>

View file

@ -92,7 +92,7 @@
Users
</span> </td>
<td class="noTruncate"> <span>
<span class="humanTimeFromNow undefined" data-time="2015-01-12T12:58:42.000Z" data-tooltip="01/12/2015 13:58">01/12/2015</span> </span>
<span class="humanTimeFromNow undefined" data-time="2015-01-12T12:58:42.000Z" title="01/12/2015 13:58">01/12/2015</span> </span>
</td>
</tr>
<tr class="item" data-id="3" data-position="3" style="cursor: pointer;">
@ -111,7 +111,7 @@
Users
</span> </td>
<td class="noTruncate"> <span>
<span class="humanTimeFromNow undefined" data-time="2015-01-20T11:47:43.000Z" data-tooltip="01/20/2015 12:47">01/20/2015</span> </span>
<span class="humanTimeFromNow undefined" data-time="2015-01-20T11:47:43.000Z" title="01/20/2015 12:47">01/20/2015</span> </span>
</td>
</tr>
<tr class="item" data-id="4" data-position="4" style="cursor: pointer;">
@ -130,7 +130,7 @@
Users
</span> </td>
<td class="noTruncate"> <span>
<span class="humanTimeFromNow undefined" data-time="2015-05-04T14:26:51.000Z" data-tooltip="05/04/2015 16:26">05/04/2015</span> </span>
<span class="humanTimeFromNow undefined" data-time="2015-05-04T14:26:51.000Z" title="05/04/2015 16:26">05/04/2015</span> </span>
</td>
</tr>
<tr class="item" data-id="5" data-position="5" style="cursor: pointer;">
@ -149,7 +149,7 @@
Users
</span> </td>
<td class="noTruncate"> <span>
<span class="humanTimeFromNow undefined" data-time="2015-06-10T13:41:29.000Z" data-tooltip="06/10/2015 15:41">5 days 21 hours ago</span> </span>
<span class="humanTimeFromNow undefined" data-time="2015-06-10T13:41:29.000Z" title="06/10/2015 15:41">5 days 21 hours ago</span> </span>
</td>
</tr>
<tr class="item" data-id="6" data-position="6" style="cursor: pointer;">
@ -168,7 +168,7 @@
Users
</span> </td>
<td class="noTruncate"> <span>
<span class="humanTimeFromNow undefined" data-time="2015-06-11T07:26:31.000Z" data-tooltip="06/11/2015 09:26">5 days 3 hours ago</span> </span>
<span class="humanTimeFromNow undefined" data-time="2015-06-11T07:26:31.000Z" title="06/11/2015 09:26">5 days 3 hours ago</span> </span>
</td>
</tr>
</tbody>

View file

@ -57,7 +57,7 @@
<h1 contenteditable="true" class="ticket-title-update" data-placeholder="Enter Title...">Welcome to Zammad! We want to entertain you and your whole family!</h1>
</div>
<div class="ticket-meta">
<small class="task-subline">Ticket# <span class="ticket-number">10001</span> - erstellte <span class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" data-tooltip="11.07.2014 12:10">11.07.2014</span>
<small class="task-subline">Ticket# <span class="ticket-number">10001</span> - erstellte <span class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" title="11.07.2014 12:10">11.07.2014</span>
</small>
</div>
</div>
@ -127,7 +127,7 @@
</div>
</div>
</div>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" data-tooltip="2014-07-11 12:10">2014-07-11</time></small>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" title="2014-07-11 12:10">2014-07-11</time></small>
</div>
<div class="ticket-article-item agent note" data-id="23" id="article-23">
@ -167,7 +167,7 @@
</div>
</div>
</div>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-08-05T13:34:01.000Z" data-tooltip="2014-08-05 15:34">2014-08-05</time></small>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-08-05T13:34:01.000Z" title="2014-08-05 15:34">2014-08-05</time></small>
</div>
<div class="ticket-article-item customer phone" data-id="1" id="article-1">
@ -216,7 +216,7 @@
</div>
</div>
</div>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" data-tooltip="2014-07-11 12:10">2014-07-11</time></small>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-07-11T10:10:32.000Z" title="2014-07-11 12:10">2014-07-11</time></small>
</div>
<div class="ticket-article-item agent note" data-id="23" id="article-23">
@ -296,7 +296,7 @@
</div>
</div>
</div>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-08-05T13:34:01.000Z" data-tooltip="2014-08-05 15:34">2014-08-05</time></small>
<small class="task-subline zIndex-1"><time class="humanTimeFromNow" data-time="2014-08-05T13:34:01.000Z" title="2014-08-05 15:34">2014-08-05</time></small>
</div>
</div>
</div>
@ -524,7 +524,7 @@
<li class="task">
<div class="icon-holder"></div>
<div class="task-text">
<a class="name ticket-popover" data-id="3" href="#ticket/zoom/3">Noch mehr Tickets bitte</a> <time class="humanTimeFromNow" data-time="2015-01-20T11:47:43.000Z" data-tooltip="01/20/2015 12:47">01/20/2015</time>
<a class="name ticket-popover" data-id="3" href="#ticket/zoom/3">Noch mehr Tickets bitte</a> <time class="humanTimeFromNow" data-time="2015-01-20T11:47:43.000Z" title="01/20/2015 12:47">01/20/2015</time>
</div>
<div class="list-item-delete js-delete" data-link-type="child" data-object="Ticket" data-object-id="3" data-type="remove"></div>
</li>

View file

@ -44,7 +44,7 @@ test( "model ui basic tests", function() {
equal( App.viewPrint( ticket, 'state' ), 'open')
equal( App.viewPrint( ticket, 'state_id' ), 'open')
equal( App.viewPrint( ticket, 'not_existing' ), '-')
equal( App.viewPrint( ticket, 'updated_at' ), '<time class="humanTimeFromNow " data-time="2014-11-07T23:43:08.000Z" data-tooltip="11/07/2014 23:43">11/07/2014</time>')
equal( App.viewPrint( ticket, 'updated_at' ), '<time class="humanTimeFromNow " data-time="2014-11-07T23:43:08.000Z" title="11/07/2014 23:43">11/07/2014</time>')
equal( App.viewPrint( ticket, 'date' ), '02/07/2015')
equal( App.viewPrint( ticket, 'textarea' ), '<div>some new</div><div>line</div>')
@ -55,7 +55,7 @@ test( "model ui basic tests", function() {
equal( App.viewPrint( ticket, 'state' ), 'offen')
equal( App.viewPrint( ticket, 'state_id' ), 'offen')
equal( App.viewPrint( ticket, 'not_existing' ), '-')
equal( App.viewPrint( ticket, 'updated_at' ), '<time class="humanTimeFromNow " data-time="2014-11-07T23:43:08.000Z" data-tooltip="07.11.2014 23:43">07.11.2014</time>')
equal( App.viewPrint( ticket, 'updated_at' ), '<time class="humanTimeFromNow " data-time="2014-11-07T23:43:08.000Z" title="07.11.2014 23:43">07.11.2014</time>')
equal( App.viewPrint( ticket, 'date' ), '07.02.2015')
equal( App.viewPrint( ticket, 'textarea' ), '<div>some new</div><div>line</div>')