Fix links to tickets in datatables ticket list

This commit is contained in:
Timothy Hobbs 2019-01-30 15:24:05 +01:00
parent 17fef846e2
commit 782aec649d
No known key found for this signature in database
GPG Key ID: 9CA9B3D779CEEDE7

View File

@ -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
}