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 @@ +
    + <% for ticket in @tickets: %> +
  1. +
    + <%- @Icon('task-state', ticket.iconClass()) %> +
    + + <% if @object: %> + + <%- @Icon('diagonal-cross') %> + + <% end %> + <% end %> +
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/link/info.jst.eco b/app/assets/javascripts/app/views/link/info.jst.eco index 7a757986e..3b22687f4 100644 --- a/app/assets/javascripts/app/views/link/info.jst.eco +++ b/app/assets/javascripts/app/views/link/info.jst.eco @@ -2,21 +2,7 @@ <% for type of @links: %> <% end %>
+ <%- @T('Add Link') %>
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/popover/user_ticket_list.jst.eco b/app/assets/javascripts/app/views/popover/user_ticket_list.jst.eco index 65de820b5..b332f3193 100644 --- a/app/assets/javascripts/app/views/popover/user_ticket_list.jst.eco +++ b/app/assets/javascripts/app/views/popover/user_ticket_list.jst.eco @@ -1,13 +1 @@ -
    - <% for ticket in @tickets: %> -
  1. -
    - <%- @Icon('task-state', ticket.iconClass()) %> -
    -
    - #<%= ticket.number %> <%= ticket.title || '-' %> - <%- @humanTime(ticket.created_at, false, 'time') %> -
    -
  2. - <% end %> -
\ No newline at end of file +<%- @ticketList %> \ No newline at end of file diff --git a/app/assets/javascripts/app/views/widget/ticket_stats_list.jst.eco b/app/assets/javascripts/app/views/widget/ticket_stats_list.jst.eco index 1cf1bae10..b734ecda0 100644 --- a/app/assets/javascripts/app/views/widget/ticket_stats_list.jst.eco +++ b/app/assets/javascripts/app/views/widget/ticket_stats_list.jst.eco @@ -1,19 +1,6 @@ <% if @ticket_ids.length: %> -
    - <% for ticket_id in @ticket_ids_show: %> - <% ticket = App.Ticket.fullLocal(ticket_id) %> -
  1. -
    - <%- @Icon('task-state', ticket.iconClass()) %> -
    -
    - <%= ticket.title || '-' %> - <%- @humanTime(ticket.created_at, false, 'time') %> -
    -
  2. - <% end %> -
+ <%- @ticketList %> <% else: %>
diff --git a/app/assets/stylesheets/zammad.scss b/app/assets/stylesheets/zammad.scss index 2278dbb65..3a53a8561 100644 --- a/app/assets/stylesheets/zammad.scss +++ b/app/assets/stylesheets/zammad.scss @@ -3232,6 +3232,10 @@ footer { min-width: 0; /* Firefox wrong content-calculation with word-wrap workaround */ } + .tasks--standalone .task-id { + &:after { content: " - "; } + } + .tasks--standalone .name { @extend .u-highlight, .u-textTruncate; display: block;