115 lines
3.9 KiB
HTML
115 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Support Tickets{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<div>
|
|
<h4 class="mb-0"><i class="bi bi-inbox me-2 text-primary"></i>Customer Support Tickets</h4>
|
|
<small class="text-muted">{{ tickets.total }} ticket{{ 's' if tickets.total != 1 }}</small>
|
|
</div>
|
|
</div>
|
|
|
|
{# Status filter tabs #}
|
|
<ul class="nav nav-tabs mb-3">
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if not status_filter %}active{% endif %}"
|
|
href="{{ url_for('support.admin_tickets') }}">All</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if status_filter == 'open' %}active{% endif %}"
|
|
href="{{ url_for('support.admin_tickets', status='open') }}">
|
|
<span class="badge bg-danger me-1">!</span>Open
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if status_filter == 'answered' %}active{% endif %}"
|
|
href="{{ url_for('support.admin_tickets', status='answered') }}">Answered</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if status_filter == 'closed' %}active{% endif %}"
|
|
href="{{ url_for('support.admin_tickets', status='closed') }}">Closed</a>
|
|
</li>
|
|
</ul>
|
|
|
|
{% if tickets.items %}
|
|
<div class="card shadow-sm">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover mb-0 align-middle">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th style="width:60px">#</th>
|
|
<th>Customer</th>
|
|
<th>Facility</th>
|
|
<th>Subject</th>
|
|
<th>Status</th>
|
|
<th>Submitted</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for ticket in tickets.items %}
|
|
{% set status_class = {'open': 'danger', 'answered': 'success', 'closed': 'secondary'} %}
|
|
<tr>
|
|
<td class="text-muted small">{{ ticket.id }}</td>
|
|
<td>{{ ticket.customer.display_name if ticket.customer else '—' }}</td>
|
|
<td>{{ ticket.facility.name if ticket.facility else '—' }}</td>
|
|
<td>{{ ticket.subject }}</td>
|
|
<td>
|
|
<span class="badge bg-{{ status_class.get(ticket.status, 'secondary') }}">
|
|
{{ ticket.status | capitalize }}
|
|
</span>
|
|
</td>
|
|
<td class="text-muted small text-nowrap">
|
|
{{ ticket.created_at.strftime('%b %d, %Y %I:%M %p') }}
|
|
</td>
|
|
<td>
|
|
<a href="{{ url_for('support.admin_ticket_detail', ticket_id=ticket.id) }}"
|
|
class="btn btn-sm btn-outline-primary">
|
|
<i class="bi bi-eye me-1"></i>View
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
{# Pagination #}
|
|
{% if tickets.pages > 1 %}
|
|
<nav class="mt-3">
|
|
<ul class="pagination justify-content-center mb-0">
|
|
<li class="page-item {% if not tickets.has_prev %}disabled{% endif %}">
|
|
<a class="page-link"
|
|
href="{{ url_for('support.admin_tickets', page=tickets.prev_num, status=status_filter) }}">
|
|
« Prev
|
|
</a>
|
|
</li>
|
|
{% for p in tickets.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
|
|
{% if p %}
|
|
<li class="page-item {% if p == tickets.page %}active{% endif %}">
|
|
<a class="page-link"
|
|
href="{{ url_for('support.admin_tickets', page=p, status=status_filter) }}">{{ p }}</a>
|
|
</li>
|
|
{% else %}
|
|
<li class="page-item disabled"><span class="page-link">…</span></li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
<li class="page-item {% if not tickets.has_next %}disabled{% endif %}">
|
|
<a class="page-link"
|
|
href="{{ url_for('support.admin_tickets', page=tickets.next_num, status=status_filter) }}">
|
|
Next »
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
<div class="text-center text-muted py-5">
|
|
<i class="bi bi-inbox fs-1 d-block mb-2"></i>
|
|
No tickets{% if status_filter %} with status "{{ status_filter }}"{% endif %}.
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|