diff --git a/app/assets/javascripts/app/controllers/_application_controller_generic.coffee b/app/assets/javascripts/app/controllers/_application_controller_generic.coffee index 58d4ead54..d2f1f8df8 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_generic.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_generic.coffee @@ -169,6 +169,7 @@ class App.ControllerGenericIndex extends App.Controller # append content table params = _.extend( { + tableId: "#{@genericObject}-generic-overview" el: @$('.table-overview') model: App[ @genericObject ] objects: objects diff --git a/app/assets/javascripts/app/controllers/_application_controller_table.coffee b/app/assets/javascripts/app/controllers/_application_controller_table.coffee index b1e9cbee8..c35ae9507 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_table.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_table.coffee @@ -14,14 +14,16 @@ class App.ControllerTable extends App.Controller super # apply personal preferences - data = @preferencesGet() - if data['order'] - for key, value of data['order'] - @[key] = value + data = {} + if @tableId + data = @preferencesGet() + if data.order + for key, value of data.order + @[key] = value @headerWidth = {} - if data['headerWidth'] - for key, value of data['headerWidth'] + if data.headerWidth + for key, value of data.headerWidth @headerWidth[key] = value @availableWidth = @el.width() @@ -91,7 +93,7 @@ class App.ControllerTable extends App.Controller value new App.ControllerTable( - table_id: 'some_id_to_idientify_user_based_table_preferences' + tableId: 'some_id_to_idientify_user_based_table_preferences' el: element overview: ['host', 'user', 'adapter', 'active'] model: App.Channel @@ -282,12 +284,12 @@ class App.ControllerTable extends App.Controller @objects = @objects.concat groupObjects[group] groupObjects[group] = [] # release old array - if @table_id + if @tableId @calculateHeaderWidths() # get content table = App.view('generic/table')( - table_id: @table_id + tableId: @tableId header: @headers attributes: attributes objects: @objects @@ -363,7 +365,7 @@ class App.ControllerTable extends App.Controller ) # if we have a personalised table - if @table_id + if @tableId # enable resize column table.on 'mousedown', '.js-col-resize', @onColResizeMousedown table.on 'click', '.js-col-resize', @stopPropagation @@ -551,4 +553,4 @@ class App.ControllerTable extends App.Controller data preferencesStoreKey: => - "tablePrefs:#{@table_id}" + "tablePrefs:#{@tableId}" diff --git a/app/assets/javascripts/app/controllers/api.coffee b/app/assets/javascripts/app/controllers/api.coffee index 50cd78ce1..9b301bbf5 100644 --- a/app/assets/javascripts/app/controllers/api.coffee +++ b/app/assets/javascripts/app/controllers/api.coffee @@ -37,7 +37,7 @@ class Index extends App.ControllerSubContent new App.ControllerTable( el: @$('.js-appList') model: App.Application - table_id: 'applications' + tableId: 'applications' objects: App.Application.all() bindRow: events: diff --git a/app/assets/javascripts/app/controllers/search.coffee b/app/assets/javascripts/app/controllers/search.coffee index 5aab0ec2b..90043b952 100644 --- a/app/assets/javascripts/app/controllers/search.coffee +++ b/app/assets/javascripts/app/controllers/search.coffee @@ -156,7 +156,7 @@ class App.Search extends App.Controller for item in localList ticket_ids.push item.id new App.TicketList( - table_id: "find_#{model}" + tableId: "find_#{model}" el: @$('.js-content') columns: [ 'number', 'title', 'customer', 'group', 'owner', 'created_at' ] ticket_ids: ticket_ids @@ -167,10 +167,10 @@ class App.Search extends App.Controller object = App[@model].fullLocal(id) @navigate object.uiUrl() new App.ControllerTable( - table_id: "find_#{model}" - el: @$('.js-content') - model: App[model] - objects: list + tableId: "find_#{model}" + el: @$('.js-content') + model: App[model] + objects: list bindRow: events: 'click': openObject diff --git a/app/assets/javascripts/app/controllers/ticket_overview.coffee b/app/assets/javascripts/app/controllers/ticket_overview.coffee index 76133bc69..a5083ccbc 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.coffee @@ -457,7 +457,7 @@ class Table extends App.Controller value new App.ControllerTable( - table_id: "ticket_overview_#{@overview.id}" + tableId: "ticket_overview_#{@overview.id}" overview: @overview.view.s el: @$('.table-overview') model: App.Ticket diff --git a/app/assets/javascripts/app/controllers/users.coffee b/app/assets/javascripts/app/controllers/users.coffee index 11238b25d..22a389bdb 100644 --- a/app/assets/javascripts/app/controllers/users.coffee +++ b/app/assets/javascripts/app/controllers/users.coffee @@ -112,10 +112,11 @@ class Index extends App.ControllerSubContent @$('.table-overview').html('') new App.ControllerTable( - el: @$('.table-overview') - model: App.User - objects: users - class: 'user-list' + tableId: 'users_admin_overview' + el: @$('.table-overview') + model: App.User + objects: users + class: 'user-list' callbackHeader: [callbackHeader] callbackAttributes: switch_to: [ @@ -166,12 +167,13 @@ class Index extends App.ControllerSubContent data: limit: 40 role_ids: role_ids - full: 1 - processData: true, + full: 1 + processData: true success: (data, status, xhr) => App.Collection.loadAssets(data.assets) @renderResult(data.user_ids) - complete: => + @stopLoading() + error: => @stopLoading() ) diff --git a/app/assets/javascripts/app/controllers/widget/ticket_list.coffee b/app/assets/javascripts/app/controllers/widget/ticket_list.coffee index 8402b1a5f..6856df871 100644 --- a/app/assets/javascripts/app/controllers/widget/ticket_list.coffee +++ b/app/assets/javascripts/app/controllers/widget/ticket_list.coffee @@ -50,7 +50,7 @@ class App.TicketList extends App.Controller list.push ticketItem @el.html('') new App.ControllerTable( - table_id: @table_id + tableId: @tableId el: @el overview: @columns || [ 'number', 'title', 'customer', 'group', 'created_at' ] model: App.Ticket diff --git a/app/assets/javascripts/app/views/generic/table.jst.eco b/app/assets/javascripts/app/views/generic/table.jst.eco index c7d611a9b..8374ac870 100644 --- a/app/assets/javascripts/app/views/generic/table.jst.eco +++ b/app/assets/javascripts/app/views/generic/table.jst.eco @@ -18,7 +18,7 @@ <% end %> <% for item, i in @header: %> <%= " align-#{ item.align }" if item.align %>" style="<% if item.displayWidth: %>width:<%= item.displayWidth %>px<% end %>" data-column-key="<%= item.name %>"> -
+
<%- @T(item.display) %>
@@ -28,7 +28,7 @@ <% end %>
- <% if @table_id && !item.unresizable && i < @header.length - 1: %> + <% if @tableId && !item.unresizable && i < @header.length - 1: %>
<% end %>