243 lines
11 KiB
HTML
243 lines
11 KiB
HTML
{% extends "layouts/base.html" %}
|
|
{% load i18n %}
|
|
{% load static %}
|
|
|
|
{% block title %}{% trans "Inquiries" %} - {% trans "Call Center" %} - PX360{% endblock %}
|
|
|
|
{% block extra_css %}
|
|
<style>
|
|
.stats-card {
|
|
border-radius: 8px;
|
|
padding: 20px;
|
|
margin-bottom: 20px;
|
|
border: none;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
}
|
|
.badge-status-open { background: #17a2b8; }
|
|
.badge-status-in_progress { background: #ffc107; color: #000; }
|
|
.badge-status-resolved { background: #28a745; }
|
|
.badge-status-closed { background: #6c757d; }
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid">
|
|
<!-- Page Header -->
|
|
<div class="mb-4">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h2 class="mb-1">
|
|
<i class="bi bi-telephone-fill text-info me-2"></i>
|
|
{% trans "Call Center Inquiries" %}
|
|
</h2>
|
|
<p class="text-muted mb-0">{% trans "Inquiries created via call center" %}</p>
|
|
</div>
|
|
<a href="{% url 'callcenter:create_inquiry' %}" class="btn btn-info text-white">
|
|
<i class="bi bi-plus-circle me-1"></i> {% trans "Create Inquiry" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Statistics -->
|
|
<div class="row mb-4">
|
|
<div class="col-md-3">
|
|
<div class="stats-card bg-info text-white">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h3 class="mb-0">{{ stats.total }}</h3>
|
|
<small>{% trans "Total Inquiries" %}</small>
|
|
</div>
|
|
<i class="bi bi-chat-left-text" style="font-size: 2rem; opacity: 0.5;"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="stats-card bg-primary text-white">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h3 class="mb-0">{{ stats.open }}</h3>
|
|
<small>{% trans "Open" %}</small>
|
|
</div>
|
|
<i class="bi bi-inbox" style="font-size: 2rem; opacity: 0.5;"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="stats-card bg-warning text-dark">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h3 class="mb-0">{{ stats.in_progress }}</h3>
|
|
<small>{% trans "In Progress" %}</small>
|
|
</div>
|
|
<i class="bi bi-hourglass-split" style="font-size: 2rem; opacity: 0.5;"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="stats-card bg-success text-white">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h3 class="mb-0">{{ stats.resolved }}</h3>
|
|
<small>{% trans "Resolved" %}</small>
|
|
</div>
|
|
<i class="bi bi-check-circle" style="font-size: 2rem; opacity: 0.5;"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Filters -->
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<form method="get" class="row g-3">
|
|
<div class="col-md-4">
|
|
<label class="form-label">{% trans "Search" %}</label>
|
|
<input type="text" name="search" class="form-control"
|
|
placeholder="{% trans 'Search...' %}" value="{{ filters.search }}">
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label class="form-label">{% trans "Status" %}</label>
|
|
<select name="status" class="form-select">
|
|
<option value="">{% trans "All" %}</option>
|
|
<option value="open" {% if filters.status == 'open' %}selected{% endif %}>{% trans "Open" %}</option>
|
|
<option value="in_progress" {% if filters.status == 'in_progress' %}selected{% endif %}>{% trans "In Progress" %}</option>
|
|
<option value="resolved" {% if filters.status == 'resolved' %}selected{% endif %}>{% trans "Resolved" %}</option>
|
|
<option value="closed" {% if filters.status == 'closed' %}selected{% endif %}>{% trans "Closed" %}</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label class="form-label">{% trans "Category" %}</label>
|
|
<select name="category" class="form-select">
|
|
<option value="">{% trans "All" %}</option>
|
|
<option value="appointment" {% if filters.category == 'appointment' %}selected{% endif %}>{% trans "Appointment" %}</option>
|
|
<option value="billing" {% if filters.category == 'billing' %}selected{% endif %}>{% trans "Billing" %}</option>
|
|
<option value="medical_records" {% if filters.category == 'medical_records' %}selected{% endif %}>{% trans "Medical Records" %}</option>
|
|
<option value="general" {% if filters.category == 'general' %}selected{% endif %}>{% trans "General" %}</option>
|
|
<option value="other" {% if filters.category == 'other' %}selected{% endif %}>{% trans "Other" %}</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label class="form-label">{% trans "Hospital" %}</label>
|
|
<select name="hospital" class="form-select">
|
|
<option value="">{% trans "All" %}</option>
|
|
{% for hospital in hospitals %}
|
|
<option value="{{ hospital.id }}" {% if filters.hospital == hospital.id|stringformat:"s" %}selected{% endif %}>
|
|
{{ hospital.name_en }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-md-2 d-flex align-items-end">
|
|
<button type="submit" class="btn btn-info text-white w-100">
|
|
<i class="bi bi-funnel me-1"></i> {% trans "Filter" %}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Inquiries Table -->
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans "ID" %}</th>
|
|
<th>{% trans "Subject" %}</th>
|
|
<th>{% trans "Contact" %}</th>
|
|
<th>{% trans "Hospital" %}</th>
|
|
<th>{% trans "Category" %}</th>
|
|
<th>{% trans "Status" %}</th>
|
|
<th>{% trans "Created" %}</th>
|
|
<th>{% trans "Actions" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for inquiry in inquiries %}
|
|
<tr>
|
|
<td>
|
|
<small class="text-muted">#{{ inquiry.id|slice:":8" }}</small>
|
|
</td>
|
|
<td>
|
|
<strong>{{ inquiry.subject|truncatewords:10 }}</strong>
|
|
</td>
|
|
<td>
|
|
{% if inquiry.patient %}
|
|
{{ inquiry.patient.get_full_name }}<br>
|
|
<small class="text-muted">MRN: {{ inquiry.patient.mrn }}</small>
|
|
{% else %}
|
|
{{ inquiry.contact_name }}<br>
|
|
<small class="text-muted">{{ inquiry.contact_phone }}</small>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ inquiry.hospital.name_en }}</td>
|
|
<td>
|
|
<span class="badge bg-secondary">
|
|
{{ inquiry.get_category_display }}
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<span class="badge badge-status-{{ inquiry.status }}">
|
|
{{ inquiry.get_status_display }}
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<small>{{ inquiry.created_at|date:"Y-m-d H:i" }}</small>
|
|
</td>
|
|
<td>
|
|
<a href="{% url 'complaints:inquiry_detail' inquiry.id %}"
|
|
class="btn btn-sm btn-outline-info">
|
|
<i class="bi bi-eye"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr>
|
|
<td colspan="8" class="text-center text-muted py-4">
|
|
<i class="bi bi-inbox" style="font-size: 3rem;"></i>
|
|
<p class="mt-2">{% trans "No inquiries found" %}</p>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
{% if page_obj.has_other_pages %}
|
|
<nav aria-label="Page navigation" class="mt-4">
|
|
<ul class="pagination justify-content-center">
|
|
{% if page_obj.has_previous %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.previous_page_number }}{% for key, value in filters.items %}&{{ key }}={{ value }}{% endfor %}">
|
|
{% trans "Previous" %}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
|
|
<li class="page-item active">
|
|
<span class="page-link">
|
|
{% trans "Page" %} {{ page_obj.number }} {% trans "of" %} {{ page_obj.paginator.num_pages }}
|
|
</span>
|
|
</li>
|
|
|
|
{% if page_obj.has_next %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.next_page_number }}{% for key, value in filters.items %}&{{ key }}={{ value }}{% endfor %}">
|
|
{% trans "Next" %}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|