06/09 Add customer request view
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Support Request #{{ ticket.id }}{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<style>
|
||||
.reply-bubble {
|
||||
max-width: 85%;
|
||||
padding: .65rem 1rem;
|
||||
border-radius: 1rem;
|
||||
font-size: .9rem;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.reply-staff { background:#d1ecf1; border-bottom-right-radius:.25rem; align-self:flex-end; }
|
||||
#reply-thread { display:flex; flex-direction:column; gap:.75rem; }
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="mb-3">
|
||||
<a href="{{ url_for('support.my_tickets') }}" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-1"></i>All My Requests
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
|
||||
{# Original request #}
|
||||
<div class="card shadow-sm mb-3">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<strong>Request #{{ ticket.id }}: {{ ticket.subject }}</strong>
|
||||
{% set status_class = {'open': 'warning', 'answered': 'success', 'closed': 'secondary'} %}
|
||||
{% set status_label = {'open': 'Awaiting reply', 'answered': 'Answered', 'closed': 'Closed'} %}
|
||||
<span class="badge bg-{{ status_class.get(ticket.status, 'secondary') }}">
|
||||
{{ status_label.get(ticket.status, ticket.status | capitalize) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="text-muted small mb-2">
|
||||
{% if ticket.facility %}
|
||||
<i class="bi bi-building me-1"></i>{{ ticket.facility.name }} ·
|
||||
{% endif %}
|
||||
<i class="bi bi-clock me-1"></i>{{ ticket.created_at.strftime('%b %d, %Y %I:%M %p') }}
|
||||
</div>
|
||||
<p class="mb-0" style="white-space:pre-wrap;">{{ ticket.body }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Staff replies #}
|
||||
{% if replies %}
|
||||
<div class="card shadow-sm mb-3">
|
||||
<div class="card-header">
|
||||
<i class="bi bi-chat-left-text me-2"></i>Replies from Support Team
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="reply-thread">
|
||||
{% for reply in replies %}
|
||||
<div class="d-flex flex-column">
|
||||
<div class="reply-bubble reply-staff ms-auto">
|
||||
<div class="text-muted small mb-1">
|
||||
<strong>{{ reply.author.display_name if reply.author else 'Support Team' }}</strong>
|
||||
· {{ reply.created_at.strftime('%b %d, %Y %I:%M %p') }}
|
||||
</div>
|
||||
{{ reply.body }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
<i class="bi bi-hourglass-split me-2"></i>
|
||||
Your request has been received. Our team will reply shortly.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="text-center mt-2">
|
||||
<a href="{{ url_for('support.chat') }}" class="btn btn-outline-primary btn-sm">
|
||||
<i class="bi bi-chat-dots me-1"></i>Ask another question
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,64 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}My Support Requests{% 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>My Support Requests</h4>
|
||||
<small class="text-muted">{{ tickets | length }} request{{ 's' if tickets | length != 1 }}</small>
|
||||
</div>
|
||||
<a href="{{ url_for('support.chat') }}" class="btn btn-outline-primary btn-sm">
|
||||
<i class="bi bi-chat-dots me-1"></i>New Chat / Ask a Question
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if tickets %}
|
||||
<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>Subject</th>
|
||||
<th>Facility</th>
|
||||
<th>Status</th>
|
||||
<th>Submitted</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set status_class = {'open': 'warning', 'answered': 'success', 'closed': 'secondary'} %}
|
||||
{% set status_label = {'open': 'Awaiting reply', 'answered': 'Answered', 'closed': 'Closed'} %}
|
||||
{% for ticket in tickets %}
|
||||
<tr>
|
||||
<td class="text-muted small">{{ ticket.id }}</td>
|
||||
<td>{{ ticket.subject }}</td>
|
||||
<td>{{ ticket.facility.name if ticket.facility else '—' }}</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ status_class.get(ticket.status, 'secondary') }}">
|
||||
{{ status_label.get(ticket.status, ticket.status | capitalize) }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-muted small text-nowrap">
|
||||
{{ ticket.created_at.strftime('%b %d, %Y') }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('support.my_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>
|
||||
{% else %}
|
||||
<div class="text-center text-muted py-5">
|
||||
<i class="bi bi-inbox fs-1 d-block mb-2"></i>
|
||||
You haven't submitted any support requests yet.<br>
|
||||
<a href="{{ url_for('support.chat') }}" class="mt-2 d-inline-block">Start a support chat</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user