forked from extern/django-helpdesk
Fix links to tickets in datatables ticket list
This commit is contained in:
parent
17fef846e2
commit
782aec649d
@ -277,9 +277,12 @@
|
||||
responsive: true
|
||||
});
|
||||
{% else %}
|
||||
function get_url(row)
|
||||
{
|
||||
return "{% url 'helpdesk:view' 1234 %}".replace(/1234/, row.id.toString());
|
||||
}
|
||||
$(document).ready(function()
|
||||
{
|
||||
let url = ""
|
||||
//DataTables Initialization
|
||||
let tasks_table = $('#ticketTable').DataTable({
|
||||
"language": {
|
||||
@ -302,10 +305,9 @@
|
||||
{
|
||||
var id = data.split(" ")[0];
|
||||
var name = data.split(" ")[1];
|
||||
let url = "{% url 'helpdesk:view' 1234 %}".replace(/1234/, id.toString());
|
||||
if (type === 'display')
|
||||
{
|
||||
data = '<b><a href="' + url + '" >' + name + '</a></b>';
|
||||
data = '<b><a href="' + get_url(row) + '" >' + name + '</a></b>';
|
||||
}
|
||||
return data
|
||||
}
|
||||
@ -327,7 +329,7 @@
|
||||
{
|
||||
if (type === 'display')
|
||||
{
|
||||
data = '<b><a href="' + url + '" >' + data + '</a></b>';
|
||||
data = '<b><a href="' + get_url(row) + '" >' + data + '</a></b>';
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user