Adde popover preview of linked tickets.
This commit is contained in:
parent
739d5bc640
commit
63e543dfd4
2 changed files with 10 additions and 9 deletions
|
@ -19,9 +19,9 @@ class App.WidgetLink extends App.Controller
|
||||||
# fetch item on demand
|
# fetch item on demand
|
||||||
# get data
|
# get data
|
||||||
@ajax(
|
@ajax(
|
||||||
id: "links_#{@object.id}_#{@object_type}"
|
id: "links_#{@object.id}_#{@object_type}"
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: "#{@apiPath}/links"
|
url: "#{@apiPath}/links"
|
||||||
data:
|
data:
|
||||||
link_object: @object_type
|
link_object: @object_type
|
||||||
link_object_value: @object.id
|
link_object_value: @object.id
|
||||||
|
@ -54,6 +54,7 @@ class App.WidgetLink extends App.Controller
|
||||||
@html App.view('link/info')(
|
@html App.view('link/info')(
|
||||||
links: list
|
links: list
|
||||||
)
|
)
|
||||||
|
@ticketPopups('left')
|
||||||
|
|
||||||
delete: (e) =>
|
delete: (e) =>
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
@ -124,11 +125,11 @@ class App.LinkAdd extends App.ControllerModal
|
||||||
list = []
|
list = []
|
||||||
for ticket_id in @ticket_ids_by_customer
|
for ticket_id in @ticket_ids_by_customer
|
||||||
if ticket_id isnt @ticket.id
|
if ticket_id isnt @ticket.id
|
||||||
ticketItem = App.Ticket.fullLocal( ticket_id )
|
ticketItem = App.Ticket.fullLocal(ticket_id)
|
||||||
list.push ticketItem
|
list.push ticketItem
|
||||||
new App.ControllerTable(
|
new App.ControllerTable(
|
||||||
el: content.find('#ticket-merge-customer-tickets')
|
el: content.find('#ticket-merge-customer-tickets')
|
||||||
overview: [ 'number', 'title', 'state', 'group', 'created_at' ]
|
overview: ['number', 'title', 'state', 'group', 'created_at']
|
||||||
model: App.Ticket
|
model: App.Ticket
|
||||||
objects: list
|
objects: list
|
||||||
radio: true
|
radio: true
|
||||||
|
@ -141,21 +142,21 @@ class App.LinkAdd extends App.ControllerModal
|
||||||
list.push ticketItem
|
list.push ticketItem
|
||||||
new App.ControllerTable(
|
new App.ControllerTable(
|
||||||
el: content.find('#ticket-merge-recent-tickets')
|
el: content.find('#ticket-merge-recent-tickets')
|
||||||
overview: [ 'number', 'title', 'state', 'group', 'created_at' ]
|
overview: ['number', 'title', 'state', 'group', 'created_at']
|
||||||
model: App.Ticket
|
model: App.Ticket
|
||||||
objects: list
|
objects: list
|
||||||
radio: true
|
radio: true
|
||||||
)
|
)
|
||||||
|
|
||||||
content.delegate('[name="ticket_number"]', 'focus', (e) ->
|
content.delegate('[name="ticket_number"]', 'focus', (e) ->
|
||||||
$(e.target).parents().find('[name="radio"]').prop( 'checked', false )
|
$(e.target).parents().find('[name="radio"]').prop('checked', false)
|
||||||
)
|
)
|
||||||
|
|
||||||
content.delegate('[name="radio"]', 'click', (e) ->
|
content.delegate('[name="radio"]', 'click', (e) ->
|
||||||
if $(e.target).prop('checked')
|
if $(e.target).prop('checked')
|
||||||
ticket_id = $(e.target).val()
|
ticket_id = $(e.target).val()
|
||||||
ticket = App.Ticket.fullLocal( ticket_id )
|
ticket = App.Ticket.fullLocal( ticket_id )
|
||||||
$(e.target).parents().find('[name="ticket_number"]').val( ticket.number )
|
$(e.target).parents().find('[name="ticket_number"]').val(ticket.number)
|
||||||
)
|
)
|
||||||
content
|
content
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<label><%- @T('Links') %></label>
|
<label><%- @T('Links') %></label>
|
||||||
<% for type of @links: %>
|
<% for type of @links: %>
|
||||||
<div class="ticketLinks">
|
<div class="ticketLinks">
|
||||||
<div class="list-title"><%- @T( type ) %></div>
|
<div class="list-title"><%- @T(type) %></div>
|
||||||
<ol class="tasks tasks--standalone">
|
<ol class="tasks tasks--standalone">
|
||||||
<% for item in @links[type]: %>
|
<% for item in @links[type]: %>
|
||||||
<li class="task">
|
<li class="task">
|
||||||
|
|
Loading…
Reference in a new issue