mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-12-24 15:48:49 +01:00
Add iframe supporting view for submitting tickets
This commit is contained in:
parent
24b8e45f66
commit
aadfe08504
74
helpdesk/templates/helpdesk/base-head.html
Normal file
74
helpdesk/templates/helpdesk/base-head.html
Normal file
@ -0,0 +1,74 @@
|
||||
{% load i18n %}
|
||||
{% load saved_queries %}
|
||||
{% load load_helpdesk_settings %}
|
||||
{% load static from staticfiles %}
|
||||
{% with request|load_helpdesk_settings as helpdesk_settings %}
|
||||
{% with user|saved_queries as user_saved_queries_ %}
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{% block helpdesk_title %}Helpdesk{% endblock %} :: {% trans "Powered by django-helpdesk" %}</title>
|
||||
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
{% if helpdesk_settings.HELPDESK_USE_CDN %}
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet">
|
||||
{% else %}
|
||||
<link href="{% static 'helpdesk/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link href="{% static 'helpdesk/vendor/fontawesome-free/css/all.min.css' %}" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- DataTables CSS-->
|
||||
<link href="{% static 'helpdesk/vendor/datatables/css/dataTables.bootstrap4.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- MetisMenu CSS -->
|
||||
<link href="{% static 'helpdesk/vendor/metisMenu/metisMenu.min.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Morris Charts CSS -->
|
||||
{% if helpdesk_settings.HELPDESK_USE_CDN %}
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
|
||||
{% else %}
|
||||
<link href="{% static 'helpdesk/vendor/morrisjs/morris.css' %}" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="{% static 'helpdesk/css/sb-admin.css' %}" rel="stylesheet">
|
||||
<link rel='stylesheet' href='{% static "helpdesk/helpdesk-extend.css" %}' type='text/css' media="screen" >
|
||||
|
||||
{% if user.id %}
|
||||
<!-- RSS -->
|
||||
<link rel='alternate' href='{% url 'helpdesk:rss_user' user.get_username %}' type='application/rss+xml' title='{% trans "My Open Tickets" %}' />
|
||||
<link rel='alternate' href='{% url 'helpdesk:rss_activity' %}' type='application/rss+xml' title='{% trans "All Recent Activity" %}' />
|
||||
<link rel='alternate' href='{% url 'helpdesk:rss_unassigned' %}' type='application/rss+xml' title='{% trans "Unassigned Tickets" %}' />
|
||||
|
||||
<style type="text/css">
|
||||
/* hide google translate top bar */
|
||||
.goog-te-banner-frame {display: none !important;}
|
||||
.goog-te-balloon-frame {display: none !important;}
|
||||
/* hide google translate tooltips (generated for every translated item) */
|
||||
.goog-tooltip {display: none !important; }
|
||||
</style>
|
||||
|
||||
<style type="text/css">
|
||||
/* header */
|
||||
#dropdown li.headerlink { width: auto; float: left; text-align: center; }
|
||||
|
||||
/* query list */
|
||||
#dropdown li.headerlink ul { display: none;
|
||||
text-align: left;
|
||||
position: absolute;
|
||||
padding: 5px;
|
||||
z-index: 2; }
|
||||
/* query entries */
|
||||
#dropdown li.headerlink:hover ul { display: block; width: auto; }
|
||||
#dropdown li.headerlink:hover ul li { padding: 5px; margin: 1px; float: none; display: block; }
|
||||
</style>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
@ -9,69 +9,7 @@
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{% block helpdesk_title %}Helpdesk{% endblock %} :: {% trans "Powered by django-helpdesk" %}</title>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
{% if helpdesk_settings.HELPDESK_USE_CDN %}
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet">
|
||||
{% else %}
|
||||
<link href="{% static 'helpdesk/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link href="{% static 'helpdesk/vendor/fontawesome-free/css/all.min.css' %}" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- DataTables CSS-->
|
||||
<link href="{% static 'helpdesk/vendor/datatables/css/dataTables.bootstrap4.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- MetisMenu CSS -->
|
||||
<link href="{% static 'helpdesk/vendor/metisMenu/metisMenu.min.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Morris Charts CSS -->
|
||||
{% if helpdesk_settings.HELPDESK_USE_CDN %}
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
|
||||
{% else %}
|
||||
<link href="{% static 'helpdesk/vendor/morrisjs/morris.css' %}" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="{% static 'helpdesk/css/sb-admin.css' %}" rel="stylesheet">
|
||||
<link rel='stylesheet' href='{% static "helpdesk/helpdesk-extend.css" %}' type='text/css' media="screen" >
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel='alternate' href='{% url 'helpdesk:rss_user' user.get_username %}' type='application/rss+xml' title='{% trans "My Open Tickets" %}' />
|
||||
<link rel='alternate' href='{% url 'helpdesk:rss_activity' %}' type='application/rss+xml' title='{% trans "All Recent Activity" %}' />
|
||||
<link rel='alternate' href='{% url 'helpdesk:rss_unassigned' %}' type='application/rss+xml' title='{% trans "Unassigned Tickets" %}' />
|
||||
|
||||
<style type="text/css">
|
||||
/* hide google translate top bar */
|
||||
.goog-te-banner-frame {display: none !important;}
|
||||
.goog-te-balloon-frame {display: none !important;}
|
||||
/* hide google translate tooltips (generated for every translated item) */
|
||||
.goog-tooltip {display: none !important; }
|
||||
</style>
|
||||
|
||||
<style type="text/css">
|
||||
/* header */
|
||||
#dropdown li.headerlink { width: auto; float: left; text-align: center; }
|
||||
|
||||
/* query list */
|
||||
#dropdown li.headerlink ul { display: none;
|
||||
text-align: left;
|
||||
position: absolute;
|
||||
padding: 5px;
|
||||
z-index: 2; }
|
||||
/* query entries */
|
||||
#dropdown li.headerlink:hover ul { display: block; width: auto; }
|
||||
#dropdown li.headerlink:hover ul li { padding: 5px; margin: 1px; float: none; display: block; }
|
||||
</style>
|
||||
|
||||
{% include 'helpdesk/base-head.html' %}
|
||||
{% block helpdesk_head %}{% endblock %}
|
||||
|
||||
</head>
|
||||
|
@ -1,47 +1,13 @@
|
||||
{% load i18n %}
|
||||
{% load load_helpdesk_settings %}
|
||||
{% load static from staticfiles %}
|
||||
{% load load_helpdesk_settings %}
|
||||
{% with request|load_helpdesk_settings as helpdesk_settings %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{% block helpdesk_title %}{% trans 'Helpdesk' %}{% endblock %} :: {% trans "Powered by django-helpdesk" %}</title>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
{% if helpdesk_settings.HELPDESK_USE_CDN %}
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet">
|
||||
{% else %}
|
||||
<link href="{% static 'helpdesk/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link href="{% static 'helpdesk/vendor/fontawesome-free/css/all.min.css' %}" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- DataTables CSS-->
|
||||
<link href="{% static 'helpdesk/vendor/datatables/css/dataTables.bootstrap4.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- MetisMenu CSS -->
|
||||
<link href="{% static 'helpdesk/vendor/metisMenu/metisMenu.min.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="{% static 'helpdesk/css/sb-admin.css' %}" rel="stylesheet">
|
||||
<link rel='stylesheet' href='{% static "helpdesk/helpdesk-extend.css" %}' type='text/css' media="screen" >
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
{% include 'helpdesk/base-head.html' %}
|
||||
{% block helpdesk_head %}{% endblock %}
|
||||
|
||||
</head>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends "helpdesk/public_base.html" %}
|
||||
{% load i18n bootstrap4form %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block helpdesk_title %}{% trans "Create Ticket" %}{% endblock %}
|
||||
|
||||
@ -11,20 +11,13 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block helpdesk_body %}
|
||||
{% if helpdesk_settings.HELPDESK_SUBMIT_A_TICKET_PUBLIC %}
|
||||
<div class="container">
|
||||
<div class="card card-register mx-auto mt-5">
|
||||
<div class="container">
|
||||
<div class="card card-register mx-auto mt-5">
|
||||
<div class="card-header">{% trans "Submit a Ticket" %}</div>
|
||||
<div class="card-body">
|
||||
<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|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>
|
||||
{% include 'helpdesk/public_create_ticket_base.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<h2>{% trans "Public ticket submission is disabled. Please contact the administrator for assistance." %}</h2>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
14
helpdesk/templates/helpdesk/public_create_ticket_base.html
Normal file
14
helpdesk/templates/helpdesk/public_create_ticket_base.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% load i18n bootstrap4form %}
|
||||
{% load load_helpdesk_settings %}
|
||||
{% with request|load_helpdesk_settings as helpdesk_settings %}
|
||||
|
||||
{% 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|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>
|
||||
{% else %}
|
||||
<h2>{% trans "Public ticket submission is disabled. Please contact the administrator for assistance." %}</h2>
|
||||
{% endif %}
|
||||
{% endwith %}
|
11
helpdesk/templates/helpdesk/public_create_ticket_iframe.html
Normal file
11
helpdesk/templates/helpdesk/public_create_ticket_iframe.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% load i18n %}
|
||||
{% load saved_queries %}
|
||||
<head>
|
||||
{% include 'helpdesk/base-head.html' %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block helpdesk_body %}
|
||||
{% include 'helpdesk/public_create_ticket_base.html' %}
|
||||
{% endblock %}
|
||||
</body>
|
@ -167,6 +167,10 @@ urlpatterns += [
|
||||
public.create_ticket,
|
||||
name='submit'),
|
||||
|
||||
url(r'^tickets/submit_iframe/$',
|
||||
public.CreateTicketIframeView.as_view(),
|
||||
name='submit_iframe'),
|
||||
|
||||
url(r'^view/$',
|
||||
public.view_ticket,
|
||||
name='public_view'),
|
||||
|
@ -31,8 +31,7 @@ def create_ticket(request, *args, **kwargs):
|
||||
return CreateTicketView.as_view()(request, *args, **kwargs)
|
||||
|
||||
|
||||
class CreateTicketView(FormView):
|
||||
template_name = 'helpdesk/public_create_ticket.html'
|
||||
class BaseCreateTicketView(FormView):
|
||||
form_class = PublicTicketForm
|
||||
|
||||
def dispatch(self, *args, **kwargs):
|
||||
@ -115,6 +114,14 @@ class CreateTicketView(FormView):
|
||||
request = self.request
|
||||
|
||||
|
||||
class CreateTicketIframeView(BaseCreateTicketView):
|
||||
template_name = 'helpdesk/public_create_ticket_iframe.html'
|
||||
|
||||
|
||||
class CreateTicketView(BaseCreateTicketView):
|
||||
template_name = 'helpdesk/public_create_ticket.html'
|
||||
|
||||
|
||||
class Homepage(CreateTicketView):
|
||||
template_name = 'helpdesk/public_homepage.html'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user