Reformat file ticket_desc_table.html

This commit is contained in:
Benbb96 2023-04-22 23:20:41 +02:00
parent 9e9ebd45a7
commit 9e7b4ef9bf
No known key found for this signature in database

View File

@ -10,111 +10,163 @@
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-sm table-border"> <table class="table table-sm table-border">
<thead class="thead-light"> <thead class="thead-light">
<tr class=''><th colspan='4'><h3>{{ ticket.queue.slug }}-{{ ticket.id }}. {{ ticket.title }} [{{ ticket.get_status }}]</h3> <tr class=''>
<th colspan='4'>
<h3>{{ ticket.queue.slug }}-{{ ticket.id }}. {{ ticket.title }} [{{ ticket.get_status }}]</h3>
{% blocktrans with ticket.queue as queue %}Queue: {{ queue }}{% endblocktrans %} {% blocktrans with ticket.queue as queue %}Queue: {{ queue }}{% endblocktrans %}
<span class='ticket_toolbar float-right'> <span class='ticket_toolbar float-right'>
<a href="{% url 'helpdesk:edit' ticket.id %}" class="ticket-edit"><button class="btn btn-warning btn-sm"><i class="fas fa-pencil-alt"></i> {% trans "Edit" %}</button></a> <a href="{% url 'helpdesk:edit' ticket.id %}" class="btn btn-warning btn-sm ticket-edit">
| <a href="{% url 'helpdesk:delete' ticket.id %}" class="ticket-delete"><button class="btn btn-danger btn-sm"><i class="fas fa-trash-alt"></i> {% trans "Delete" %}</button></a> <i class="fas fa-pencil-alt"></i> {% trans "Edit" %}
| </a>
{% if ticket.on_hold %} | <a href="{% url 'helpdesk:delete' ticket.id %}" class="btn btn-danger btn-sm ticket-delete">
<form class="form-inline ticket-hold" method='post' action='unhold/'> <i class="fas fa-trash-alt"></i> {% trans "Delete" %}
{% csrf_token %} </a>
<button class="btn btn-warning btn-sm" type='submit'><i class="fas fa-play"></i> {% trans "Unhold" %}</button> | {% if ticket.on_hold %}
</form> <form class="form-inline ticket-hold" method='post' action='unhold/'>
{% else %} {% csrf_token %}
<form class="form-inline ticket-hold" method='post' action='hold/'> <button class="btn btn-warning btn-sm" type='submit'>
{% csrf_token %} <i class="fas fa-play"></i> {% trans "Unhold" %}
<button class="btn btn-warning btn-sm" type='submit'><i class="fas fa-pause"></i> {% trans "Hold" %}</button> </button>
</form> </form>
{% endif %} {% else %}
</span></th></tr> <form class="form-inline ticket-hold" method='post' action='hold/'>
{% csrf_token %}
<button class="btn btn-warning btn-sm" type='submit'>
<i class="fas fa-pause"></i> {% trans "Hold" %}
</button>
</form>
{% endif %}
</span>
</th>
</tr>
</thead> </thead>
<tbody> <tbody>
{% for customfield in ticket.ticketcustomfieldvalue_set.all %} {% for customfield in ticket.ticketcustomfieldvalue_set.all %}
<tr> <tr>
<th class="table-secondary">{{ customfield.field.label }}</th> <th class="table-secondary">{{ customfield.field.label }}</th>
<td>{% spaceless %}{% if "url" == customfield.field.data_type %}<a href='{{ customfield.value }}'>{{ customfield.value }}</a> <td>
{% elif "datetime" == customfield.field.data_type %}{{ customfield.value|datetime_string_format }} {% spaceless %}
{% elif "date" == customfield.field.data_type %}{{ customfield.value|datetime_string_format }} {% if "url" == customfield.field.data_type %}
{% elif "time" == customfield.field.data_type %}{{ customfield.value|datetime_string_format }} <a href='{{ customfield.value }}'>{{ customfield.value }}</a>
{% else %}{{ customfield.value|default:"" }} {% elif "datetime" == customfield.field.data_type %}
{% endif %}{% endspaceless %}</td> {{ customfield.value|datetime_string_format }}
</tr>{% endfor %} {% elif "date" == customfield.field.data_type %}
{{ customfield.value|datetime_string_format }}
{% elif "time" == customfield.field.data_type %}
{{ customfield.value|datetime_string_format }}
{% else %}
{{ customfield.value|default:"" }}
{% endif %}
{% endspaceless %}
</td>
</tr>
{% endfor %}
<tr> <tr>
<th class="table-active">{% trans "Due Date" %}</th> <th class="table-active">{% trans "Due Date" %}</th>
<td>{{ ticket.due_date|date:"DATETIME_FORMAT" }} {% if ticket.due_date %}({{ ticket.due_date|naturaltime }}){% endif %} <td>
{{ ticket.due_date|date:"DATETIME_FORMAT" }}
{% if ticket.due_date %}({{ ticket.due_date|naturaltime }}){% endif %}
</td> </td>
<th class="table-active">{% trans "Submitted On" %}</th> <th class="table-active">{% trans "Submitted On" %}</th>
<td>{{ ticket.created|date:"DATETIME_FORMAT" }} ({{ ticket.created|naturaltime }})</td> <td>{{ ticket.created|date:"DATETIME_FORMAT" }} ({{ ticket.created|naturaltime }})</td>
</tr> </tr>
<tr> <tr>
<th class="table-active">{% trans "Assigned To" %}</th> <th class="table-active">{% trans "Assigned To" %}</th>
<td>{{ ticket.get_assigned_to }}{% if _('Unassigned') == ticket.get_assigned_to %} <strong> <td>
<a data-toggle="tooltip" href='?take' title='{% trans "Assign this ticket to " %}{{ request.user.email }}'><button type="button" class="btn btn-primary btn-sm float-right"><i class="fas fa-hand-paper"></i></button></a> {{ ticket.get_assigned_to }}
</strong>{% endif %} {% if _('Unassigned') == ticket.get_assigned_to %}
<a class="btn btn-primary btn-sm float-right" data-toggle="tooltip" href='?take' title='{% trans "Assign this ticket to " %}{{ request.user.email }}'>
<i class="fas fa-hand-paper"></i>
</a>
{% endif %}
</td> </td>
<th class="table-active">{% trans "Submitter E-Mail" %}</th> <th class="table-active">{% trans "Submitter E-Mail" %}</th>
<td> {{ ticket.submitter_email }} <td>
{% if user.is_superuser %} {% if submitter_userprofile_url %}<strong><a data-toggle="tooltip" href='{{submitter_userprofile_url}}' title='{% trans "Edit " %}{{ ticket.submitter_email }}{% trans " user profile" %}'><button type="button" class="btn btn-primary btn-sm"><i class="fas fa-address-book"></i></button></a></strong>{% endif %} {{ ticket.submitter_email }}
<strong><a data-toggle="tooltip" href ="{% url 'helpdesk:list'%}?q={{ticket.submitter_email}}" title='{% trans "Display tickets filtered for " %}{{ ticket.submitter_email }}{% trans " as a keyword" %}'> {% if user.is_superuser %}
<button type="button" class="btn btn-primary btn-sm"><i class="fas fa-search"></i></button></a></strong> {% if submitter_userprofile_url %}
<strong><a data-toggle="tooltip" href='{% url 'helpdesk:email_ignore_add' %}?email={{ ticket.submitter_email }}' title='{% trans "Add email address for the ticket system to ignore." %}'> <a class="btn btn-primary btn-sm" data-toggle="tooltip" href='{{submitter_userprofile_url}}' title='{% trans "Edit " %}{{ ticket.submitter_email }}{% trans " user profile" %}'>
<button type="button" class="btn btn-warning btn-sm float-right"><i class="fas fa-eye-slash"></i></button></a></strong>{% endif %} <i class="fas fa-address-book"></i>
</a>
{% endif %}
<a class="btn btn-primary btn-sm" data-toggle="tooltip" href ="{% url 'helpdesk:list'%}?q={{ticket.submitter_email}}" title='{% trans "Display tickets filtered for " %}{{ ticket.submitter_email }}{% trans " as a keyword" %}'>
<i class="fas fa-search"></i>
</a>
<a class="btn btn-warning btn-sm float-right" data-toggle="tooltip" href='{% url 'helpdesk:email_ignore_add' %}?email={{ ticket.submitter_email }}' title='{% trans "Add email address for the ticket system to ignore." %}'>
<i class="fas fa-eye-slash"></i>
</a>
{% endif %}
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="table-active">{% trans "Priority" %}</th> <th class="table-active">{% trans "Priority" %}</th>
<td class="{% if ticket.priority < 3 %}table-warning{% endif %}">{{ ticket.get_priority_display }} <td class="{% if ticket.priority < 3 %}table-warning{% endif %}">
{{ ticket.get_priority_display }}
</td> </td>
<th class="table-active">{% trans "Copies To" %}</th> <th class="table-active">{% trans "Copies To" %}</th>
<td>{{ ticketcc_string }} <a data-toggle='tooltip' href='{% url 'helpdesk:ticket_cc' ticket.id %}' title='{% trans "Click here to add / remove people who should receive an e-mail whenever this ticket is updated." %}'><strong><button type="button" class="btn btn-warning btn-sm float-right"><i class="fa fa-share"></i></button></strong></a>{% if SHOW_SUBSCRIBE %} <strong><a data-toggle='tooltip' href='?subscribe' title='{% trans "Click here to subscribe yourself to this ticket, if you want to receive an e-mail whenever this ticket is updated." %}'><button type="button" class="btn btn-warning btn-sm float-right"><i class="fas fa-rss-square"></i></button></a></strong>{% endif %}</td> <td>
{{ ticketcc_string }}
<a class="btn btn-warning btn-sm float-right" data-toggle='tooltip' href='{% url 'helpdesk:ticket_cc' ticket.id %}' title='{% trans "Click here to add / remove people who should receive an e-mail whenever this ticket is updated." %}'>
<i class="fa fa-share"></i>
</a>
{% if SHOW_SUBSCRIBE %}
<a class="btn btn-warning btn-sm float-right" data-toggle='tooltip' href='?subscribe' title='{% trans "Click here to subscribe yourself to this ticket, if you want to receive an e-mail whenever this ticket is updated." %}'>
<i class="fas fa-rss-square"></i>
</a>
{% endif %}
</td>
</tr> </tr>
{% if helpdesk_settings.HELPDESK_ENABLE_DEPENDENCIES_ON_TICKET != False and helpdesk_settings.HELPDESK_ENABLE_TIME_SPENT_ON_TICKET != False %} {% if helpdesk_settings.HELPDESK_ENABLE_DEPENDENCIES_ON_TICKET != False and helpdesk_settings.HELPDESK_ENABLE_TIME_SPENT_ON_TICKET != False %}
<tr> <tr>
{% if helpdesk_settings.HELPDESK_ENABLE_DEPENDENCIES_ON_TICKET %} {% if helpdesk_settings.HELPDESK_ENABLE_DEPENDENCIES_ON_TICKET %}
<th class="table-active">{% trans "Dependencies" %}</th> <th class="table-active">{% trans "Dependencies" %}</th>
<td> <td>
<a data-toggle='tooltip' href='{% url 'helpdesk:ticket_dependency_add' ticket.id %}' title="{% trans "Click on 'Add Dependency', if you want to make this ticket dependent on another ticket. A ticket may not be closed until all tickets it depends on are closed." %}"><button type="button" class="btn btn-primary btn-sm float-right"><i class="fas fa-link"></i></button></a> <a data-toggle='tooltip' href='{% url 'helpdesk:ticket_dependency_add' ticket.id %}' title="{% trans "Click on 'Add Dependency', if you want to make this ticket dependent on another ticket. A ticket may not be closed until all tickets it depends on are closed." %}"><button type="button" class="btn btn-primary btn-sm float-right"><i class="fas fa-link"></i></button></a>
{% for dep in ticket.ticketdependency.all %} {% for dep in ticket.ticketdependency.all %}
{% if forloop.first %}<p>{% trans "This ticket cannot be resolved until the following ticket(s) are resolved" %}</p><ul>{% endif %} {% if forloop.first %}<p>{% trans "This ticket cannot be resolved until the following ticket(s) are resolved" %}</p><ul>{% endif %}
<li><a href='{{ dep.depends_on.get_absolute_url }}'>{{ dep.depends_on.ticket }} {{ dep.depends_on.title }}</a> ({{ dep.depends_on.get_status_display }}) <a href='{% url 'helpdesk:ticket_dependency_del' ticket.id dep.id %}'><button type="button" class="btn btn-warning btn-sm"><i class="fas fa-trash"></i></button></a></li> <li><a href='{{ dep.depends_on.get_absolute_url }}'>{{ dep.depends_on.ticket }} {{ dep.depends_on.title }}</a> ({{ dep.depends_on.get_status_display }}) <a href='{% url 'helpdesk:ticket_dependency_del' ticket.id dep.id %}'><button type="button" class="btn btn-warning btn-sm"><i class="fas fa-trash"></i></button></a></li>
{% if forloop.last %}</ul>{% endif %} {% if forloop.last %}</ul>{% endif %}
{% empty %} {% empty %}
{% trans "This ticket has no dependencies." %} {% trans "This ticket has no dependencies." %}
{% endfor %} {% endfor %}
</td> </td>
{% else %} {% else %}
<th class="table-active"></th> <th class="table-active"></th>
<td></td> <td></td>
{% endif %} {% endif %}
{% if helpdesk_settings.HELPDESK_ENABLE_TIME_SPENT_ON_TICKET %} {% if helpdesk_settings.HELPDESK_ENABLE_TIME_SPENT_ON_TICKET %}
<th class="table-active">{% trans "Total time spent" %}</th> <th class="table-active">{% trans "Total time spent" %}</th>
<td>{{ ticket.time_spent_formated }}</td> <td>{{ ticket.time_spent_formated }}</td>
{% else %} {% else %}
<th class="table-active"></th> <th class="table-active"></th>
<td></td> <td></td>
{% endif %} {% endif %}
</tr> </tr>
{% endif %} {% endif %}
{% if ticket.kbitem %} {% if ticket.kbitem %}
<tr> <tr>
<th class="table-active">{% trans "Knowlegebase item" %}</th> <th class="table-active">{% trans "Knowlegebase item" %}</th>
<td> <a href ="{{ticket.kbitem.query_url}}"> {{ticket.kbitem}} </a> </td> <td> <a href ="{{ticket.kbitem.query_url}}"> {{ticket.kbitem}} </a> </td>
</tr> </tr>
{% endif %} {% endif %}
<tr> <tr>
<th class="table-active">{% trans "Attachments" %}</th> <th class="table-active">{% trans "Attachments" %}</th>
<td colspan="3"> <td colspan="3">
<ul> <ul>
{% for followup in ticket.followup_set.all %} {% for followup in ticket.followup_set.all %}
{% for attachment in followup.followupattachment_set.all %} {% for attachment in followup.followupattachment_set.all %}
<li><a href='{{ attachment.file.url }}'>{{ attachment.filename }}</a> ({{ attachment.mime_type }}, {{ attachment.size|filesizeformat }}) <li>
{% if followup.user and request.user == followup.user %} <a href='{{ attachment.file.url }}'>
<a href='{% url 'helpdesk:attachment_del' ticket.id attachment.id %}'><button class="btn btn-danger btn-sm"><i class="fas fa-trash"></i></button></a> {{ attachment.filename }}
{% endif %} </a> ({{ attachment.mime_type }}, {{ attachment.size|filesizeformat }})
</li> {% if followup.user and request.user == followup.user %}
{% endfor %} <a class="btn btn-danger btn-sm" href='{% url 'helpdesk:attachment_del' ticket.id attachment.id %}'>
<i class="fas fa-trash"></i>
</a>
{% endif %}
</li>
{% endfor %}
{% endfor %} {% endfor %}
</ul> </ul>
</td> </td>
@ -122,18 +174,34 @@
<tr> <tr>
<td id="ticket-description" colspan='4'> <td id="ticket-description" colspan='4'>
<h4>{% trans "Description" %}</h4> <h4>{% trans "Description" %}</h4>
{{ ticket.get_markdown|urlizetrunc:50|num_to_link }}</td> {{ ticket.get_markdown|urlizetrunc:50|num_to_link }}
</td>
</tr> </tr>
{% if ticket.resolution %}<tr> {% if ticket.resolution %}
<th colspan='2'>{% trans "Resolution" %}{% if "Resolved" == ticket.get_status_display %} <a href='?close'><button type="button" class="btn btn-warning btn-sm">{% trans "Accept and Close" %}</button></a>{% endif %}</th> <tr>
</tr> <th colspan='4'>
<tr> {% trans "Resolution" %}
<td colspan='2'>{{ ticket.get_resolution_markdown|urlizetrunc:50|linebreaksbr }}</td> {% if "Resolved" == ticket.get_status_display %}
</tr>{% endif %} <a href='?close'>
<button type="button" class="btn btn-warning btn-sm">
{% trans "Accept and Close" %}
</button>
</a>
{% endif %}
</th>
</tr>
<tr>
<td colspan='4'>{{ ticket.get_resolution_markdown|urlizetrunc:50|linebreaksbr }}</td>
</tr>
{% endif %}
</tbody> </tbody>
</table> </table>
<a href='#FurtherEditOptions'><button type="button" class="btn btn-sm btn-warning float-right" onclick="$('#FurtherEditOptions').fadeIn()"><i class="fas fa-pencil-alt"></i>&nbsp;{% trans "Edit details" %}</button></a> <a href='#FurtherEditOptions'>
<button type="button" class="btn btn-sm btn-warning float-right" onclick="$('#FurtherEditOptions').fadeIn()">
<i class="fas fa-pencil-alt"></i>&nbsp;{% trans "Edit details" %}
</button>
</a>
</div> </div>
<!-- /.table-responsive --> <!-- /.table-responsive -->
</div> </div>