diff --git a/app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee b/app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee index fc086d6ac..bc21ccc7a 100644 --- a/app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee +++ b/app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee @@ -113,6 +113,23 @@ class App.DashboardTicket extends App.Controller attribute.data = id: refObject.id value + callbackPriorityIconHeader = (header) -> + attribute = + name: 'priority_icon' + display: '' + translation: false + style: 'width: 28px' + header.unshift(0) + header[0] = attribute + header + callbackPriorityIcon = (value, object, attribute, header, refObject) -> + value = ' ' + attribute.class = 'priority icon' + if object && object.priority_id + attribute.class += " level-#{object.priority_id}" + attribute.link = '' + attribute.title = App.i18n.translateInline( object.priority.displayName() ) + value new App.ControllerTable( overview: @overview.view.d @@ -121,10 +138,13 @@ class App.DashboardTicket extends App.Controller objects: @tickets_in_table, checkbox: false groupBy: @overview.group_by + callbackHeader: callbackPriorityIconHeader bindRow: events: 'click': openTicket callbackAttributes: + priority_icon: + [ callbackPriorityIcon ] customer_id: [ callbackResetLink, callbackUserPopover ] owner_id: diff --git a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee index 58c8d1c5a..a6c5b620d 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee @@ -203,6 +203,23 @@ class Table extends App.ControllerContent @el.find('.bulk-action').addClass('hide') else @el.find('.bulk-action').removeClass('hide') + callbackPriorityIconHeader = (header) -> + attribute = + name: 'priority_icon' + display: '' + translation: false + style: 'width: 28px' + header.unshift(0) + header[0] = attribute + header + callbackPriorityIcon = (value, object, attribute, header, refObject) -> + value = ' ' + attribute.class = 'priority icon' + if object && object.priority_id + attribute.class += " level-#{object.priority_id}" + attribute.link = '' + attribute.title = App.i18n.translateInline( object.priority.displayName() ) + value new App.ControllerTable( overview: @overview.view.s @@ -218,7 +235,10 @@ class Table extends App.ControllerContent # customer_id: # events: # 'mouseover': popOver + callbackHeader: callbackPriorityIconHeader callbackAttributes: + priority_icon: + [ callbackPriorityIcon ] customer_id: [ callbackUserPopover ] owner_id: diff --git a/app/assets/javascripts/app/views/generic/table.jst.eco b/app/assets/javascripts/app/views/generic/table.jst.eco index dbbb1007b..24656e12b 100644 --- a/app/assets/javascripts/app/views/generic/table.jst.eco +++ b/app/assets/javascripts/app/views/generic/table.jst.eco @@ -12,7 +12,6 @@ <% if @radio: %>