mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-29 03:13:15 +01:00
Improvements to iframe workflow
This commit is contained in:
parent
07a42e07f8
commit
cd019d1128
@ -4,7 +4,7 @@
|
||||
|
||||
{% if helpdesk_settings.HELPDESK_SUBMIT_A_TICKET_PUBLIC %}
|
||||
<p>{% trans "Unless otherwise stated, all fields are required." %} {% trans "Please provide as descriptive a title and description as possible." %}</p>
|
||||
<form method='post' action='./#submit' enctype='multipart/form-data'>
|
||||
<form method='post' enctype='multipart/form-data'>
|
||||
{{ form|bootstrap4form }}
|
||||
<button type="submit" class="btn btn-primary btn-lg btn-block"><i class="fa fa-send"></i> {% trans "Submit Ticket" %}</button>
|
||||
{% csrf_token %}</form>
|
||||
|
4
helpdesk/templates/helpdesk/success_iframe.html
Normal file
4
helpdesk/templates/helpdesk/success_iframe.html
Normal file
@ -0,0 +1,4 @@
|
||||
{% load i18n %}
|
||||
<h1>
|
||||
{% trans "Ticket submitted successfully! We will reply via email as soon as we get the chance." %}
|
||||
</h1>
|
@ -171,6 +171,10 @@ urlpatterns += [
|
||||
public.CreateTicketIframeView.as_view(),
|
||||
name='submit_iframe'),
|
||||
|
||||
url(r'^tickets/success_iframe/$', # Ticket was submitted successfully
|
||||
public.SuccessIframeView.as_view(),
|
||||
name='success_iframe'),
|
||||
|
||||
url(r'^view/$',
|
||||
public.view_ticket,
|
||||
name='public_view'),
|
||||
|
@ -107,6 +107,13 @@ class CreateTicketIframeView(BaseCreateTicketView):
|
||||
def dispatch(self, *args, **kwargs):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
|
||||
def form_valid(self, form):
|
||||
if super().form_valid(form).status_code == 302:
|
||||
return HttpResponseRedirect(reverse('helpdesk:success_iframe'))
|
||||
|
||||
|
||||
class SuccessIframeView(TemplateView):
|
||||
template_name = 'helpdesk/success_iframe.html'
|
||||
|
||||
|
||||
class CreateTicketView(BaseCreateTicketView):
|
||||
|
Loading…
Reference in New Issue
Block a user