mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-17 18:50:46 +01:00
Merge pull request #1147 from timthelion/webhooks-3
Fixes for my-tickets view and public ticket view
This commit is contained in:
commit
82653806c4
@ -83,12 +83,13 @@ class PublicTicketListingSerializer(serializers.ModelSerializer):
|
|||||||
status = serializers.SerializerMethodField()
|
status = serializers.SerializerMethodField()
|
||||||
queue = serializers.SerializerMethodField()
|
queue = serializers.SerializerMethodField()
|
||||||
kbitem = serializers.SerializerMethodField()
|
kbitem = serializers.SerializerMethodField()
|
||||||
|
secret_key = serializers.CharField(read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Ticket
|
model = Ticket
|
||||||
# fields = '__all__'
|
# fields = '__all__'
|
||||||
fields = ('ticket', 'id', 'title', 'queue', 'status',
|
fields = ('ticket', 'id', 'title', 'queue', 'status',
|
||||||
'created', 'due_date', 'submitter', 'kbitem')
|
'created', 'due_date', 'submitter', 'kbitem', 'secret_key')
|
||||||
|
|
||||||
def get_queue(self, obj):
|
def get_queue(self, obj):
|
||||||
return {"title": obj.queue.title, "id": obj.queue.id}
|
return {"title": obj.queue.title, "id": obj.queue.id}
|
||||||
|
@ -73,7 +73,13 @@ table.ticket-stats tbody th, table.ticket-stats tbody tr {padding-left: 20px}
|
|||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
#ticket-description {background-color: #FCF8E3;}
|
#ticket-description {background-color: #FCF8E3;}
|
||||||
.followup.well {background-color: #f4f5ff;}
|
.followup.well {
|
||||||
|
background-color: #f4f5ff;
|
||||||
|
}
|
||||||
|
.followup {
|
||||||
|
padding: 20px;
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
Add your custom styles here
|
Add your custom styles here
|
||||||
*/
|
*/
|
||||||
|
@ -7,17 +7,17 @@
|
|||||||
<table class="table table-striped" id="ticketsTable">
|
<table class="table table-striped" id="ticketsTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Title</th>
|
<th>{% trans "Title" %}</th>
|
||||||
<th>Queue</th>
|
<th>{% trans "Queue" %}</th>
|
||||||
<th>Status</th>
|
<th>{% trans "Status" %}</th>
|
||||||
<th>Created</th>
|
<th>{% trans "Created" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<!-- Rows will be added here dynamically using jQuery -->
|
<!-- Rows will be added here dynamically using jQuery -->
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<nav aria-label="Page navigation">
|
<nav aria-label="{% trans 'Page navigation' %}">
|
||||||
<ul class="pagination" id="pagination">
|
<ul class="pagination" id="pagination">
|
||||||
<!-- Pagination buttons will be added here dynamically -->
|
<!-- Pagination buttons will be added here dynamically -->
|
||||||
</ul>
|
</ul>
|
||||||
@ -37,7 +37,7 @@ window.addEventListener('load', function()
|
|||||||
data.results.forEach(function(ticket) {
|
data.results.forEach(function(ticket) {
|
||||||
$('#ticketsTable tbody').append(`
|
$('#ticketsTable tbody').append(`
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/view/?ticket=${ticket.id}&email=${ticket.submitter}">${ticket.title}</a></td>
|
<td><a href="/view/?ticket=${ticket.id}&email=${ticket.submitter}&key=${ticket.secret_key}">${ticket.title}</a></td>
|
||||||
<td>${ticket.queue.title}</td>
|
<td>${ticket.queue.title}</td>
|
||||||
<td>${ticket.status}</td>
|
<td>${ticket.status}</td>
|
||||||
<td>${ticket.created}</td>
|
<td>${ticket.created}</td>
|
||||||
|
@ -5,11 +5,18 @@
|
|||||||
{% block helpdesk_body %}
|
{% block helpdesk_body %}
|
||||||
|
|
||||||
<table class="table table-hover table-bordered table-striped">
|
<table class="table table-hover table-bordered table-striped">
|
||||||
<caption>{{ ticket.ticket }} . {{ ticket.title }} [{{ ticket.get_status }}]</caption>
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th colspan='2'>{% blocktrans with ticket.queue as queue_name %}Queue: {{ queue_name }}{% endblocktrans %}</th></tr>
|
<tr>
|
||||||
|
<th colspan="2">
|
||||||
|
<capiton>
|
||||||
|
{{ ticket.ticket }} . {{ ticket.title }} [{{ ticket.get_status }}]
|
||||||
|
</capiton>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr><th>{% blocktrans with ticket.queue as queue_name %}Queue</th>
|
||||||
|
<td>{{ queue_name }}{% endblocktrans %}</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Submitted On" %}</th>
|
<th>{% trans "Submitted On" %}</th>
|
||||||
<td>{{ ticket.created|date:"DATETIME_FORMAT" }} ({{ ticket.created|naturaltime }})</td>
|
<td>{{ ticket.created|date:"DATETIME_FORMAT" }} ({{ ticket.created|naturaltime }})</td>
|
||||||
@ -66,8 +73,8 @@
|
|||||||
<h3>{% trans "Follow-Ups" %}</h3>
|
<h3>{% trans "Follow-Ups" %}</h3>
|
||||||
{% load ticket_to_link %}
|
{% load ticket_to_link %}
|
||||||
{% for followup in ticket.followup_set.public_followups %}
|
{% for followup in ticket.followup_set.public_followups %}
|
||||||
<div class='followup well'>
|
<div class='followup well card'>
|
||||||
<div class='title'>{{ followup.title }} <span class='byline text-info'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"DATETIME_FORMAT" }}'>{{ followup.date|naturaltime }}</span></span></div>
|
<p><b>{{ followup.title }} <span class='byline text-info'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"DATETIME_FORMAT" }}'>{{ followup.date|naturaltime }}</span></span></b></p>
|
||||||
{{ followup.comment|force_escape|urlizetrunc:50|num_to_link|linebreaksbr }}
|
{{ followup.comment|force_escape|urlizetrunc:50|num_to_link|linebreaksbr }}
|
||||||
{% if followup.ticketchange_set.all %}<div class='changes'><ul>
|
{% if followup.ticketchange_set.all %}<div class='changes'><ul>
|
||||||
{% for change in followup.ticketchange_set.all %}
|
{% for change in followup.ticketchange_set.all %}
|
||||||
@ -152,7 +159,7 @@
|
|||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<button class="btn btn-primary btn-lg" type='submit'>{% trans "Update This Ticket" %}</button>
|
<button class="btn btn-primary btn-lg" style="margin-bottom:10px" type='submit'>{% trans "Update This Ticket" %}</button>
|
||||||
|
|
||||||
{% csrf_token %}</form>
|
{% csrf_token %}</form>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user