diff --git a/app/assets/javascripts/app/controllers/ticket_customer.js.coffee b/app/assets/javascripts/app/controllers/ticket_customer.js.coffee index 47fef48a4..2d53e8191 100644 --- a/app/assets/javascripts/app/controllers/ticket_customer.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_customer.js.coffee @@ -37,7 +37,7 @@ class App.TicketCustomer extends App.ControllerModal @modalHide() # reload zoom view - @zoom.render() + @ui.render() # load user if not already exists App.User.retrieve( params['customer_id'], callback ) diff --git a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee index 91fd5f949..d2afe8e7b 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee @@ -525,6 +525,17 @@ class Navbar extends App.Controller else @render( [] ) + # init fetch via ajax, all other updates on time via websockets + @ajax( + id: 'ticket_overviews', + type: 'GET', + url: @apiPath + '/ticket_overviews', + processData: true, + success: (data) => + App.Store.write( 'navupdate_ticket_overview', data ) + @render(data) + ) + render: (dataOrig) -> data = _.clone(dataOrig) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index a4bc36e24..1a3de87f8 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -140,6 +140,7 @@ class App.TicketZoom extends App.Controller @frontendTimeUpdate() @TicketTitle() + @TicketWidgets() @TicketAction() @ArticleView() @@ -195,15 +196,24 @@ class App.TicketZoom extends App.Controller ui: @ ) - TicketAction: => + TicketWidgets: => # show ticket action row - new TicketAction( + new TicketWidgets( ticket: @ticket task_key: @task_key - el: @el.find('.ticket-action') + el: @el.find('.ticket-widgets') ui: @ ) + TicketAction: => + # start action controller + if !@isRole('Customer') + new TicketActionRow( + el: @el.find('.ticket-action') + ticket: @ticket + ui: @ + ) + class TicketTitle extends App.Controller events: 'blur .ticket-title-update': 'update' @@ -213,7 +223,7 @@ class TicketTitle extends App.Controller @render() render: -> - @html App.view('ticket_zoom/ticket_title')( + @html App.view('ticket_zoom/title')( ticket: @ticket ) @@ -247,7 +257,7 @@ class TicketInfo extends App.ControllerDrox render: -> @html @template( - file: 'ticket_zoom/ticket_info' + file: 'ticket_zoom/info' header: '#' + @ticket.number params: ticket: @ticket @@ -261,14 +271,14 @@ class TicketInfo extends App.ControllerDrox object: @ticket ) -class TicketAction extends App.Controller +class TicketWidgets extends App.Controller constructor: -> super @render() render: -> - @html App.view('ticket_zoom/ticket_action')() + @html App.view('ticket_zoom/widgets')() # show ticket info new TicketInfo( @@ -284,15 +294,6 @@ class TicketAction extends App.Controller ticket: @ticket ) - # start action controller - ### - if !@isRole('Customer') - new TicketActionRow( - el: @el.find('.action_info') - ticket: @ticket - zoom: @ui - ) - ### # start link info controller if !@isRole('Customer') new App.LinkInfo( @@ -301,8 +302,6 @@ class TicketAction extends App.Controller object: @ticket ) - - class Edit extends App.Controller events: 'click .submit': 'update' @@ -789,7 +788,7 @@ class TicketActionRow extends App.Controller @render() render: -> - @html App.view('ticket_action')() + @html App.view('ticket_zoom/actions')() history_dialog: (e) -> e.preventDefault() @@ -797,11 +796,11 @@ class TicketActionRow extends App.Controller merge_dialog: (e) -> e.preventDefault() - new App.TicketMerge( ticket_id: @ticket.id, task_key: @zoom.task_key ) + new App.TicketMerge( ticket_id: @ticket.id, task_key: @ui.task_key ) customer_dialog: (e) -> e.preventDefault() - new App.TicketCustomer( ticket_id: @ticket.id, zoom: @zoom ) + new App.TicketCustomer( ticket_id: @ticket.id, ui: @ui ) class TicketZoomRouter extends App.ControllerPermanent constructor: (params) -> diff --git a/app/assets/javascripts/app/views/customer_ticket_create.jst.eco b/app/assets/javascripts/app/views/customer_ticket_create.jst.eco index 9d50c5862..de3e25bc6 100644 --- a/app/assets/javascripts/app/views/customer_ticket_create.jst.eco +++ b/app/assets/javascripts/app/views/customer_ticket_create.jst.eco @@ -1,4 +1,4 @@ -
+