From 4b0b6287244e8b67269cfc952780540e8b540a77 Mon Sep 17 00:00:00 2001 From: Andreas Kotowicz Date: Wed, 23 Nov 2011 19:56:36 +0100 Subject: [PATCH] hide "log in" button on '/helpdesk/login/' page. modify "log in" redirect if possbible, so that user lands on same ticket (instead of dashboard) after login. --- helpdesk/templates/helpdesk/navigation.html | 4 ++-- helpdesk/views/public.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/helpdesk/templates/helpdesk/navigation.html b/helpdesk/templates/helpdesk/navigation.html index 6fc52b0d..4cc2ea89 100644 --- a/helpdesk/templates/helpdesk/navigation.html +++ b/helpdesk/templates/helpdesk/navigation.html @@ -28,8 +28,8 @@
  • {% trans "Submit A Ticket" %}
  • {% endif %} {% if helpdesk_settings.HELPDESK_KB_ENABLED %}
  • {% trans "Knowledgebase" %}
  • {% endif %} -{% if not helpdesk_settings.HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT or user.is_authenticated %} -
  • {% if user.is_authenticated %}{% trans "Logout" %}{% else %}{% trans "Log In" %}{% endif %}
  • +{% if not request.path == '/helpdesk/login/' or user.is_authenticated %} +
  • {% if user.is_authenticated %}{% trans "Logout" %}{% else %}{% trans "Log In" %}{% endif %}
  • {% endif %} {% endif %} diff --git a/helpdesk/views/public.py b/helpdesk/views/public.py index e7ee1682..d3506e9e 100644 --- a/helpdesk/views/public.py +++ b/helpdesk/views/public.py @@ -111,10 +111,16 @@ def view_ticket(request): return update_ticket(request, ticket_id, public=True) + # redirect user back to this ticket if possible. + redirect_url = '' + if helpdesk_settings.HELPDESK_NAVIGATION_ENABLED: + redirect_url = reverse('helpdesk_view', args=[ticket_id]) + return render_to_response('helpdesk/public_view_ticket.html', RequestContext(request, { 'ticket': ticket, 'helpdesk_settings': helpdesk_settings, + 'next': redirect_url, })) return render_to_response('helpdesk/public_view_form.html',