diff --git a/app/assets/javascripts/app/controllers/widget/link.coffee b/app/assets/javascripts/app/controllers/widget/link.coffee index 7af8f6d6d..043ee6b4d 100644 --- a/app/assets/javascripts/app/controllers/widget/link.coffee +++ b/app/assets/javascripts/app/controllers/widget/link.coffee @@ -48,13 +48,23 @@ class App.WidgetLink extends App.Controller list = {} for item in @localLinks if !list[ item['link_type'] ] - list[ item['link_type'] ] = [] + list[ item['link_type'] ] = { + tickets: [] + } if item['link_object'] is 'Ticket' ticket = App.Ticket.fullLocal( item['link_object_value'] ) if ticket.state.name is 'merged' ticket.css = 'merged' - list[ item['link_type'] ].push ticket + list[ item['link_type'] ].tickets.push ticket + + # create ticket lists + for type of list + list[type].ticketList = App.view('generic/ticket_list')( + tickets: list[type].tickets + object: 'Ticket' + linkType: type + ) unless list[type].tickets.length == 0 # insert data @html App.view('link/info')( diff --git a/app/assets/javascripts/app/controllers/widget/ticket_stats.coffee b/app/assets/javascripts/app/controllers/widget/ticket_stats.coffee index 44c1d2726..17231cc48 100644 --- a/app/assets/javascripts/app/controllers/widget/ticket_stats.coffee +++ b/app/assets/javascripts/app/controllers/widget/ticket_stats.coffee @@ -160,10 +160,16 @@ class App.TicketStatsList extends App.Controller else ticket_ids_show = @ticket_ids + tickets = (App.Ticket.fullLocal(id) for id in ticket_ids_show) + console.log tickets + @html App.view('widget/ticket_stats_list')( user: @user head: @head iconClass: @iconClass + ticketList: App.view('generic/ticket_list')( + tickets: tickets + ) ticket_ids: @ticket_ids ticket_ids_show: ticket_ids_show limit: @limit diff --git a/app/assets/javascripts/app/lib/app_post/user_ticket_popover_provider.coffee b/app/assets/javascripts/app/lib/app_post/user_ticket_popover_provider.coffee index b5c1f1cd4..d50f8c552 100644 --- a/app/assets/javascripts/app/lib/app_post/user_ticket_popover_provider.coffee +++ b/app/assets/javascripts/app/lib/app_post/user_ticket_popover_provider.coffee @@ -33,6 +33,10 @@ class UserTicket extends App.PopoverProvider tickets = ticket_ids.map (ticketId) -> App.Ticket.fullLocal(ticketId) # insert data - @buildHtmlContent(tickets: tickets) - + @buildHtmlContent( + ticketList: App.view('generic/ticket_list')( + tickets: tickets + show_id: true + ) + ) App.PopoverProvider.registerProvider('UserTicket', UserTicket) diff --git a/app/assets/javascripts/app/views/generic/ticket_list.jst.eco b/app/assets/javascripts/app/views/generic/ticket_list.jst.eco new file mode 100644 index 000000000..ef9201570 --- /dev/null +++ b/app/assets/javascripts/app/views/generic/ticket_list.jst.eco @@ -0,0 +1,22 @@ +