From c723873d83e20dd42f103427c59763b3bbe11379 Mon Sep 17 00:00:00 2001 From: Georg Lehner Date: Wed, 17 Apr 2024 21:17:41 +0200 Subject: [PATCH] FIX: replace hardcoded urls with Django generated ones. The My Tickets view generated ticket urls with a '/view' string prefix. This is replaced by proper Django URL resolution. The public and staff ticket view used a '../../' string prefix which brakes in the public ticket view. They are both replaced with proper Django URL resolution. --- helpdesk/templates/helpdesk/my_tickets.html | 4 +++- helpdesk/templates/helpdesk/public_view_ticket.html | 5 ++++- helpdesk/templates/helpdesk/ticket.html | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/helpdesk/templates/helpdesk/my_tickets.html b/helpdesk/templates/helpdesk/my_tickets.html index cde160a1..ab25a840 100644 --- a/helpdesk/templates/helpdesk/my_tickets.html +++ b/helpdesk/templates/helpdesk/my_tickets.html @@ -37,7 +37,9 @@ window.addEventListener('load', function() data.results.forEach(function(ticket) { $('#ticketsTable tbody').append(` - ${ticket.title} + + ${ticket.title} + ${ticket.queue.title} ${ticket.status} ${ticket.created} diff --git a/helpdesk/templates/helpdesk/public_view_ticket.html b/helpdesk/templates/helpdesk/public_view_ticket.html index 62f37a43..77de5af1 100644 --- a/helpdesk/templates/helpdesk/public_view_ticket.html +++ b/helpdesk/templates/helpdesk/public_view_ticket.html @@ -103,7 +103,10 @@
-
{% trans "You can insert ticket and queue details in your message. For more information, see the context help page." %}
+ {% url "helpdesk:help_context" as context_help_url %} + {% blocktrans %} +
You can insert ticket and queue details in your message. For more information, see the context help page.
+ {% endblocktrans %} {% if not ticket.can_be_resolved %}
{% trans "This ticket cannot be resolved or closed until the tickets it depends on are resolved." %}
{% endif %} {% if ticket.status == 1 %} diff --git a/helpdesk/templates/helpdesk/ticket.html b/helpdesk/templates/helpdesk/ticket.html index 8f0ede76..b61743f7 100644 --- a/helpdesk/templates/helpdesk/ticket.html +++ b/helpdesk/templates/helpdesk/ticket.html @@ -105,7 +105,10 @@
-
{% trans "You can insert ticket and queue details in your message. For more information, see the context help page." %}
+ {% url "helpdesk:help_context" as context_help_url %} + {% blocktrans %} +
You can insert ticket and queue details in your message. For more information, see the context help page.
+ {% endblocktrans %}
{% if not ticket.can_be_resolved %}
{% trans "This ticket cannot be resolved or closed until the tickets it depends on are resolved." %}
{% endif %}