diff --git a/app/assets/javascripts/app/controllers/_application_controller.coffee b/app/assets/javascripts/app/controllers/_application_controller.coffee index 619116a2a..47728e507 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.coffee @@ -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 diff --git a/app/assets/javascripts/app/controllers/_channel/email.coffee b/app/assets/javascripts/app/controllers/_channel/email.coffee index fa7504944..e23878755 100644 --- a/app/assets/javascripts/app/controllers/_channel/email.coffee +++ b/app/assets/javascripts/app/controllers/_channel/email.coffee @@ -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) diff --git a/app/assets/javascripts/app/controllers/_settings/area.coffee b/app/assets/javascripts/app/controllers/_settings/area.coffee index 9921a74d8..f7ae38654 100644 --- a/app/assets/javascripts/app/controllers/_settings/area.coffee +++ b/app/assets/javascripts/app/controllers/_settings/area.coffee @@ -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() ) diff --git a/app/assets/javascripts/app/controllers/calendar.coffee b/app/assets/javascripts/app/controllers/calendar.coffee index 30a16400b..fdb2a21d0 100644 --- a/app/assets/javascripts/app/controllers/calendar.coffee +++ b/app/assets/javascripts/app/controllers/calendar.coffee @@ -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) ) diff --git a/app/assets/javascripts/app/controllers/object_manager.coffee b/app/assets/javascripts/app/controllers/object_manager.coffee index e963aa622..e35c950d5 100644 --- a/app/assets/javascripts/app/controllers/object_manager.coffee +++ b/app/assets/javascripts/app/controllers/object_manager.coffee @@ -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) ) diff --git a/app/assets/javascripts/app/controllers/session.coffee b/app/assets/javascripts/app/controllers/session.coffee index b208ee116..f149c081b 100644 --- a/app/assets/javascripts/app/controllers/session.coffee +++ b/app/assets/javascripts/app/controllers/session.coffee @@ -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) ) diff --git a/app/assets/javascripts/app/controllers/sla.coffee b/app/assets/javascripts/app/controllers/sla.coffee index 1dcb5b536..d098c2356 100644 --- a/app/assets/javascripts/app/controllers/sla.coffee +++ b/app/assets/javascripts/app/controllers/sla.coffee @@ -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) ) diff --git a/app/assets/javascripts/app/controllers/translation.coffee b/app/assets/javascripts/app/controllers/translation.coffee index ef9ac2c5a..5362752f2 100644 --- a/app/assets/javascripts/app/controllers/translation.coffee +++ b/app/assets/javascripts/app/controllers/translation.coffee @@ -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) ) diff --git a/app/assets/javascripts/app/controllers/trigger.coffee b/app/assets/javascripts/app/controllers/trigger.coffee index 7ce2a4e33..123f79965 100644 --- a/app/assets/javascripts/app/controllers/trigger.coffee +++ b/app/assets/javascripts/app/controllers/trigger.coffee @@ -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) ) diff --git a/app/assets/javascripts/app/controllers/users.coffee b/app/assets/javascripts/app/controllers/users.coffee index fc059be15..7cb4dc376 100644 --- a/app/assets/javascripts/app/controllers/users.coffee +++ b/app/assets/javascripts/app/controllers/users.coffee @@ -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) -> diff --git a/app/assets/javascripts/app/index.coffee b/app/assets/javascripts/app/index.coffee index 490d25d12..f7316faa4 100644 --- a/app/assets/javascripts/app/index.coffee +++ b/app/assets/javascripts/app/index.coffee @@ -215,7 +215,7 @@ class App extends Spine.Controller if escalation cssClass += ' escalation' humanTime = App.PrettyDate.humanTime(time, escalation) - "" + "" # define icon helper params.Icon = (name, className = '') -> diff --git a/app/assets/javascripts/app/lib/app_post/delay.coffee b/app/assets/javascripts/app/lib/app_post/delay.coffee index 9c3d09f5e..0588be2ac 100644 --- a/app/assets/javascripts/app/lib/app_post/delay.coffee +++ b/app/assets/javascripts/app/lib/app_post/delay.coffee @@ -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 diff --git a/app/assets/javascripts/app/lib/app_post/interval.coffee b/app/assets/javascripts/app/lib/app_post/interval.coffee index fec999e2b..757d3f2e4 100644 --- a/app/assets/javascripts/app/lib/app_post/interval.coffee +++ b/app/assets/javascripts/app/lib/app_post/interval.coffee @@ -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 diff --git a/app/assets/javascripts/app/views/generic/page_loading.jst.eco b/app/assets/javascripts/app/views/generic/page_loading.jst.eco new file mode 100644 index 000000000..01ee126fc --- /dev/null +++ b/app/assets/javascripts/app/views/generic/page_loading.jst.eco @@ -0,0 +1,4 @@ +
+
+
<%- @T('Loading...') %>
+
diff --git a/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco b/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco index 2d61ef6cd..353bacc4b 100644 --- a/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco @@ -37,7 +37,7 @@

Welcome to Zammad! We want to entertain you and your whole family!

- Ticket# 10001 - erstellte 11.07.2014 + Ticket# 10001 - erstellte 11.07.2014
@@ -102,7 +102,7 @@ The Zammad - +
@@ -140,7 +140,7 @@ The Zammad
- +
@@ -186,7 +186,7 @@ Grüße, Peter
- +
@@ -269,7 +269,7 @@ Oliver
- + diff --git a/app/assets/javascripts/app/views/layout_ref/merge_customer_view.jst.eco b/app/assets/javascripts/app/views/layout_ref/merge_customer_view.jst.eco index a7ffc32ee..d17ff9628 100644 --- a/app/assets/javascripts/app/views/layout_ref/merge_customer_view.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/merge_customer_view.jst.eco @@ -46,7 +46,7 @@
- Ticket# 10001 - created 01/12/2015 + Ticket# 10001 - created 01/12/2015
@@ -155,7 +155,7 @@
set to internal reply split
- +
@@ -329,7 +329,7 @@
set to internal split
-
+
@@ -393,7 +393,7 @@
set to internal split
-
+ @@ -753,7 +753,7 @@
Noch mehr Tickets bitte -
+
01/20/2015
diff --git a/app/assets/javascripts/app/views/layout_ref/scheduler_modal.jst.eco b/app/assets/javascripts/app/views/layout_ref/scheduler_modal.jst.eco index 4d2e2b098..c094bc98e 100644 --- a/app/assets/javascripts/app/views/layout_ref/scheduler_modal.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/scheduler_modal.jst.eco @@ -340,7 +340,7 @@ Users - 01/12/2015 + 01/12/2015 @@ -359,7 +359,7 @@ Users - 5 days 3 hours ago + 5 days 3 hours ago diff --git a/app/assets/javascripts/app/views/layout_ref/sla_modal.jst.eco b/app/assets/javascripts/app/views/layout_ref/sla_modal.jst.eco index 573f42233..096452a03 100644 --- a/app/assets/javascripts/app/views/layout_ref/sla_modal.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/sla_modal.jst.eco @@ -92,7 +92,7 @@ Users - 01/12/2015 + 01/12/2015 @@ -111,7 +111,7 @@ Users - 01/20/2015 + 01/20/2015 @@ -130,7 +130,7 @@ Users - 05/04/2015 + 05/04/2015 @@ -149,7 +149,7 @@ Users - 5 days 21 hours ago + 5 days 21 hours ago @@ -168,7 +168,7 @@ Users - 5 days 3 hours ago + 5 days 3 hours ago diff --git a/app/assets/javascripts/app/views/layout_ref/ticket_zoom.jst.eco b/app/assets/javascripts/app/views/layout_ref/ticket_zoom.jst.eco index 234d351e5..e633d9f24 100644 --- a/app/assets/javascripts/app/views/layout_ref/ticket_zoom.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/ticket_zoom.jst.eco @@ -57,7 +57,7 @@

Welcome to Zammad! We want to entertain you and your whole family!

- Ticket# 10001 - erstellte 11.07.2014 + Ticket# 10001 - erstellte 11.07.2014
@@ -127,7 +127,7 @@ - +
@@ -167,7 +167,7 @@
- +
@@ -216,7 +216,7 @@
- +
@@ -296,7 +296,7 @@
- + @@ -524,7 +524,7 @@
  • diff --git a/public/assets/tests/model-ui.js b/public/assets/tests/model-ui.js index 8f5a7d99d..f43e95c14 100644 --- a/public/assets/tests/model-ui.js +++ b/public/assets/tests/model-ui.js @@ -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' ), '') + equal( App.viewPrint( ticket, 'updated_at' ), '') equal( App.viewPrint( ticket, 'date' ), '02/07/2015') equal( App.viewPrint( ticket, 'textarea' ), '
    some new
    line
    ') @@ -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' ), '') + equal( App.viewPrint( ticket, 'updated_at' ), '') equal( App.viewPrint( ticket, 'date' ), '07.02.2015') equal( App.viewPrint( ticket, 'textarea' ), '
    some new
    line
    ')