update-po-file
This commit is contained in:
parent
e0ee8daa8a
commit
14f2ff46c0
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,152 +1,571 @@
|
||||
{% extends 'layouts/base.html' %}
|
||||
{% extends "layouts/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{% trans "Inquiry Detail" %}{% endblock %}
|
||||
{% block title %}Inquiry #{{ inquiry.id|slice:":8" }} - PX360{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<style>
|
||||
.inquiry-header {
|
||||
background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
|
||||
color: white;
|
||||
padding: 30px;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.due-date-badge {
|
||||
background: rgba(255,255,255,0.2);
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.due-date-badge.overdue {
|
||||
background: #d32f2f;
|
||||
}
|
||||
.status-badge {
|
||||
padding: 6px 16px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
.status-open { background: #e3f2fd; color: #1976d2; }
|
||||
.status-in_progress { background: #fff3e0; color: #f57c00; }
|
||||
.status-resolved { background: #e8f5e9; color: #388e3c; }
|
||||
.status-closed { background: #f5f5f5; color: #616161; }
|
||||
|
||||
.priority-badge {
|
||||
padding: 6px 16px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
.priority-low { background: #e8f5e9; color: #388e3c; }
|
||||
.priority-medium { background: #fff3e0; color: #f57c00; }
|
||||
.priority-high { background: #ffebee; color: #d32f2f; }
|
||||
.priority-urgent { background: #880e4f; color: #fff; }
|
||||
|
||||
.timeline {
|
||||
position: relative;
|
||||
padding-left: 30px;
|
||||
}
|
||||
.timeline::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 2px;
|
||||
background: #dee2e6;
|
||||
}
|
||||
.timeline-item {
|
||||
position: relative;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
.timeline-item::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: -26px;
|
||||
top: 5px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
border: 3px solid #17a2b8;
|
||||
z-index: 1;
|
||||
}
|
||||
.timeline-item.status_change::before {
|
||||
border-color: #f57c00;
|
||||
}
|
||||
.timeline-item.response::before {
|
||||
border-color: #388e3c;
|
||||
}
|
||||
.timeline-item.note::before {
|
||||
border-color: #1976d2;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-weight: 600;
|
||||
color: #6c757d;
|
||||
font-size: 0.85rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 1rem;
|
||||
color: #212529;
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container-fluid">
|
||||
<!-- Page Header -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h1 class="h3 mb-0">{% trans "Inquiry Detail" %}</h1>
|
||||
<p class="text-muted">{{ inquiry.subject }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'complaints:inquiry_list' %}" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left"></i> {% trans "Back to List" %}
|
||||
</a>
|
||||
<!-- Back Button -->
|
||||
<div class="mb-3">
|
||||
<a href="{% url 'complaints:inquiry_list' %}" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-arrow-left me-1"></i> {{ _("Back to Inquiries")}}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Inquiry Header -->
|
||||
<div class="inquiry-header">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-8">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<h3 class="mb-0 me-3">{{ inquiry.subject }}</h3>
|
||||
<span class="status-badge status-{{ inquiry.status }}">
|
||||
{{ inquiry.get_status_display }}
|
||||
</span>
|
||||
{% if inquiry.priority %}
|
||||
<span class="priority-badge priority-{{ inquiry.priority }} ms-2">
|
||||
{{ inquiry.get_priority_display }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<p class="mb-2">
|
||||
<i class="bi bi-hash me-1"></i>
|
||||
<strong>{{ _("ID") }}:</strong> {{ inquiry.id|slice:":8" }}
|
||||
{% if inquiry.patient %}
|
||||
<span class="mx-2">|</span>
|
||||
<i class="bi bi-person-fill me-1"></i>
|
||||
<strong>{{ _("Patient") }}:</strong> {{ inquiry.patient.get_full_name }} ({{ _("MRN") }}: {{ inquiry.patient.mrn }})
|
||||
{% else %}
|
||||
<span class="mx-2">|</span>
|
||||
<i class="bi bi-person me-1"></i>
|
||||
<strong>{{ _("Contact") }}:</strong> {{ inquiry.contact_name|default:inquiry.contact_email }}
|
||||
{% endif %}
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
<i class="bi bi-hospital me-1"></i>
|
||||
<strong>{{ _("Hospital") }}:</strong> {{ inquiry.hospital.name_en }}
|
||||
{% if inquiry.department %}
|
||||
<span class="mx-2">|</span>
|
||||
<i class="bi bi-building me-1"></i>
|
||||
<strong>{{ _("Department") }}:</strong> {{ inquiry.department.name_en }}
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{% if inquiry.due_date %}
|
||||
<div class="due-date-badge {% if inquiry.is_overdue %}overdue{% endif %}">
|
||||
<div class="mb-1">
|
||||
<i class="bi bi-clock-history me-1"></i>
|
||||
<strong>{{ _("Due Date")}}</strong>
|
||||
</div>
|
||||
<h4 class="mb-0">{{ inquiry.due_date|date:"M d, Y H:i" }}</h4>
|
||||
{% if inquiry.is_overdue %}
|
||||
<div class="mt-2">
|
||||
<i class="bi bi-exclamation-triangle-fill me-1"></i>
|
||||
<strong>{{ _("OVERDUE") }}</strong>
|
||||
</div>
|
||||
{% else %}
|
||||
<small>{{ inquiry.due_date|timeuntil }} {{ _("remaining") }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Main Content -->
|
||||
<div class="col-lg-8">
|
||||
<!-- Inquiry Details -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<h6 class="m-0 font-weight-bold">{% trans "Inquiry Information" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<strong>{% trans "Subject" %}:</strong><br>
|
||||
{{ inquiry.subject }}
|
||||
<!-- Tabs -->
|
||||
<ul class="nav nav-tabs mb-3" id="inquiryTabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="details-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#details" type="button" role="tab">
|
||||
<i class="bi bi-info-circle me-1"></i> {{ _("Details") }}
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="timeline-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#timeline" type="button" role="tab">
|
||||
<i class="bi bi-clock-history me-1"></i> {{ _("Timeline") }} ({{ timeline.count }})
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="attachments-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#attachments" type="button" role="tab">
|
||||
<i class="bi bi-paperclip me-1"></i> {{ _("Attachments") }} ({{ attachments.count }})
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="tab-content" id="inquiryTabsContent">
|
||||
<!-- Details Tab -->
|
||||
<div class="tab-pane fade show active" id="details" role="tabpanel">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-4">{% trans "Inquiry Details" %}</h5>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<div class="info-label">{{ _("Category") }}</div>
|
||||
<div class="info-value">
|
||||
<span class="badge bg-secondary">{{ inquiry.get_category_display }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="info-label">{{ _("Source") }}</div>
|
||||
<div class="info-value">
|
||||
{% if inquiry.source %}
|
||||
{{ inquiry.get_source_display }}
|
||||
{% else %}
|
||||
<span class="text-muted">{{ _("N/A")}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<div class="info-label">{{ _("Channel") }}</div>
|
||||
<div class="info-value">
|
||||
{% if inquiry.channel %}
|
||||
{{ inquiry.get_channel_display }}
|
||||
{% else %}
|
||||
<span class="text-muted">{{ _("N/A")}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="info-label">{{ _("Assigned To")}}</div>
|
||||
<div class="info-value">
|
||||
{% if inquiry.assigned_to %}
|
||||
{{ inquiry.assigned_to.get_full_name }}
|
||||
{% else %}
|
||||
<span class="text-muted">{{ _("Unassigned") }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Message") }}</div>
|
||||
<div class="info-value mt-2">
|
||||
<p class="mb-0">{{ inquiry.message|linebreaks }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if inquiry.response %}
|
||||
<hr>
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Response") }}</div>
|
||||
<div class="info-value mt-2">
|
||||
<div class="alert alert-success">
|
||||
<p class="mb-2">{{ inquiry.response|linebreaks }}</p>
|
||||
<small class="text-muted">
|
||||
{{ _("Responded by")}} {{ inquiry.responded_by.get_full_name }}
|
||||
{{ _("on") }} {{ inquiry.responded_at|date:"M d, Y H:i" }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="info-label">{{ _("Created") }}</div>
|
||||
<div class="info-value">{{ inquiry.created_at|date:"M d, Y H:i" }}</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="info-label">{{ _("Last Updated")}}</div>
|
||||
<div class="info-value">{{ inquiry.updated_at|date:"M d, Y H:i" }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<strong>{% trans "Status" %}:</strong><br>
|
||||
{% if inquiry.status == 'open' %}
|
||||
<span class="badge bg-warning">{% trans "Open" %}</span>
|
||||
{% elif inquiry.status == 'in_progress' %}
|
||||
<span class="badge bg-info">{% trans "In Progress" %}</span>
|
||||
{% elif inquiry.status == 'resolved' %}
|
||||
<span class="badge bg-success">{% trans "Resolved" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Timeline Tab -->
|
||||
<div class="tab-pane fade" id="timeline" role="tabpanel">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-4">{% trans "Activity Timeline" %}</h5>
|
||||
|
||||
{% if timeline %}
|
||||
<div class="timeline">
|
||||
{% for update in timeline %}
|
||||
<div class="timeline-item {{ update.update_type }}">
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<div>
|
||||
<span class="badge bg-primary">{{ update.get_update_type_display }}</span>
|
||||
{% if update.created_by %}
|
||||
<span class="text-muted ms-2">
|
||||
by {{ update.created_by.get_full_name }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<small class="text-muted">
|
||||
{{ update.created_at|date:"M d, Y H:i" }}
|
||||
</small>
|
||||
</div>
|
||||
<p class="mb-0">{{ update.message }}</p>
|
||||
{% if update.old_status and update.new_status %}
|
||||
<div class="mt-2">
|
||||
<span class="status-badge status-{{ update.old_status }}">
|
||||
{{ update.old_status }}
|
||||
</span>
|
||||
<i class="bi bi-arrow-right mx-2"></i>
|
||||
<span class="status-badge status-{{ update.new_status }}">
|
||||
{{ update.new_status }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">{{ inquiry.get_status_display }}</span>
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-clock-history" style="font-size: 3rem; color: #ccc;"></i>
|
||||
<p class="text-muted mt-3">{{ _("No timeline entries yet")}}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<strong>{% trans "Category" %}:</strong><br>
|
||||
<span class="badge bg-secondary">{{ inquiry.get_category_display }}</span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<strong>{% trans "Created" %}:</strong><br>
|
||||
{{ inquiry.created_at|date:"Y-m-d H:i" }}
|
||||
</div>
|
||||
|
||||
<!-- Attachments Tab -->
|
||||
<div class="tab-pane fade" id="attachments" role="tabpanel">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-4">{% trans "Attachments" %}</h5>
|
||||
|
||||
{% if attachments %}
|
||||
<div class="list-group">
|
||||
{% for attachment in attachments %}
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<i class="bi bi-file-earmark me-2"></i>
|
||||
<strong>{{ attachment.filename }}</strong>
|
||||
<br>
|
||||
<small class="text-muted">
|
||||
Uploaded by {{ attachment.uploaded_by.get_full_name }}
|
||||
on {{ attachment.created_at|date:"M d, Y H:i" }}
|
||||
({{ attachment.file_size|filesizeformat }})
|
||||
</small>
|
||||
{% if attachment.description %}
|
||||
<br>
|
||||
<small>{{ attachment.description }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a href="{{ attachment.file.url }}" class="btn btn-sm btn-outline-primary"
|
||||
target="_blank" download>
|
||||
<i class="bi bi-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-paperclip" style="font-size: 3rem; color: #ccc;"></i>
|
||||
<p class="text-muted mt-3">{{ _("No attachments")}}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<strong>{% trans "Message" %}:</strong><br>
|
||||
<p class="mt-2">{{ inquiry.message|linebreaks }}</p>
|
||||
</div>
|
||||
|
||||
{% if inquiry.response %}
|
||||
<div class="alert alert-success">
|
||||
<strong>{% trans "Response" %}:</strong><br>
|
||||
<p class="mt-2 mb-0">{{ inquiry.response|linebreaks }}</p>
|
||||
<small class="text-muted">
|
||||
{% trans "Responded by" %} {{ inquiry.responded_by.get_full_name }}
|
||||
{% trans "on" %} {{ inquiry.responded_at|date:"Y-m-d H:i" }}
|
||||
</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Response Form -->
|
||||
{% if can_edit and inquiry.status != 'resolved' and inquiry.status != 'closed' %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h6 class="m-0 font-weight-bold">{% trans "Respond to Inquiry" %}</h6>
|
||||
<!-- Sidebar Actions -->
|
||||
<div class="col-lg-4">
|
||||
<!-- Quick Actions -->
|
||||
{% if can_edit %}
|
||||
<div class="card mb-3">
|
||||
<div class="card-header bg-info text-white">
|
||||
<h6 class="mb-0"><i class="bi bi-lightning-fill me-2"></i>{% trans "Quick Actions" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="{% url 'complaints:inquiry_respond' inquiry.id %}">
|
||||
<!-- Assign -->
|
||||
<form method="post" action="{% url 'complaints:inquiry_assign' inquiry.id %}" class="mb-3">
|
||||
{% csrf_token %}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Response" %}</label>
|
||||
<textarea name="response" class="form-control" rows="5" required></textarea>
|
||||
<label class="form-label">{% trans "Assign To" %}</label>
|
||||
<div class="input-group">
|
||||
<select name="user_id" class="form-select" required>
|
||||
<option value="">{{ _("Select user...")}}</option>
|
||||
{% for user_obj in assignable_users %}
|
||||
<option value="{{ user_obj.id }}"
|
||||
{% if inquiry.assigned_to and inquiry.assigned_to.id == user_obj.id %}selected{% endif %}>
|
||||
{{ user_obj.get_full_name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button type="submit" class="btn btn-info">
|
||||
<i class="bi bi-person-check"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-paper-plane"></i> {% trans "Send Response" %}
|
||||
</form>
|
||||
|
||||
<!-- Change Status -->
|
||||
<form method="post" action="{% url 'complaints:inquiry_change_status' inquiry.id %}" class="mb-3">
|
||||
{% csrf_token %}
|
||||
<label class="form-label">{% trans "Change Status" %}</label>
|
||||
<select name="status" class="form-select mb-2" required>
|
||||
{% for value, label in status_choices %}
|
||||
<option value="{{ value }}" {% if inquiry.status == value %}selected{% endif %}>
|
||||
{{ label }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<textarea name="note" class="form-control mb-2" rows="2"
|
||||
placeholder="{% trans 'Optional note...' %}"></textarea>
|
||||
<button type="submit" class="btn btn-info w-100">
|
||||
<i class="bi bi-arrow-repeat me-1"></i> {{ _("Update Status")}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="col-lg-4">
|
||||
|
||||
<!-- Add Note -->
|
||||
<div class="card mb-3">
|
||||
<div class="card-header bg-success text-white">
|
||||
<h6 class="mb-0"><i class="bi bi-chat-left-text me-2"></i>{% trans "Add Note" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="{% url 'complaints:inquiry_add_note' inquiry.id %}">
|
||||
{% csrf_token %}
|
||||
<textarea name="note" class="form-control mb-2" rows="3"
|
||||
placeholder="{% trans 'Enter your note...' %}" required></textarea>
|
||||
<button type="submit" class="btn btn-success w-100">
|
||||
<i class="bi bi-plus-circle me-1"></i> {{ _("Add Note")}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Response Form -->
|
||||
{% if can_edit and inquiry.status != 'resolved' and inquiry.status != 'closed' %}
|
||||
<div class="card mb-3">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h6 class="mb-0"><i class="bi bi-reply-fill me-2"></i>{% trans "Respond to Inquiry" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="{% url 'complaints:inquiry_respond' inquiry.id %}">
|
||||
{% csrf_token %}
|
||||
<textarea name="response" class="form-control mb-2" rows="4"
|
||||
placeholder="{% trans 'Enter your response...' %}" required></textarea>
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
<i class="bi bi-send me-1"></i> {{ _("Send Response")}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Contact Information -->
|
||||
<div class="card mb-4">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="m-0 font-weight-bold">{% trans "Contact Information" %}</h6>
|
||||
<h6 class="mb-0"><i class="bi bi-info-circle me-2"></i>{% trans "Contact Information" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if inquiry.patient %}
|
||||
<p><strong>{% trans "Patient" %}:</strong><br>
|
||||
{{ inquiry.patient.get_full_name }}<br>
|
||||
<small class="text-muted">MRN: {{ inquiry.patient.mrn }}</small></p>
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Patient")}}</div>
|
||||
<div class="info-value">
|
||||
{{ inquiry.patient.get_full_name }}
|
||||
<br>
|
||||
<small class="text-muted">{{ _("MRN") }}: {{ inquiry.patient.mrn }}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if inquiry.patient.phone %}
|
||||
<p><strong>{% trans "Phone" %}:</strong><br>{{ inquiry.patient.phone }}</p>
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Phone")}}</div>
|
||||
<div class="info-value">{{ inquiry.patient.phone }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if inquiry.patient.email %}
|
||||
<p><strong>{% trans "Email" %}:</strong><br>{{ inquiry.patient.email }}</p>
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Email")}}</div>
|
||||
<div class="info-value">{{ inquiry.patient.email }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if inquiry.contact_name %}
|
||||
<p><strong>{% trans "Name" %}:</strong><br>{{ inquiry.contact_name }}</p>
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Name")}}</div>
|
||||
<div class="info-value">{{ inquiry.contact_name }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if inquiry.contact_phone %}
|
||||
<p><strong>{% trans "Phone" %}:</strong><br>{{ inquiry.contact_phone }}</p>
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Phone")}}</div>
|
||||
<div class="info-value">{{ inquiry.contact_phone }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if inquiry.contact_email %}
|
||||
<p><strong>{% trans "Email" %}:</strong><br>{{ inquiry.contact_email }}</p>
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Email")}}</div>
|
||||
<div class="info-value">{{ inquiry.contact_email }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Organization -->
|
||||
<div class="card mb-4">
|
||||
|
||||
<!-- Assignment Info -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h6 class="m-0 font-weight-bold">{% trans "Organization" %}</h6>
|
||||
<h6 class="mb-0"><i class="bi bi-person-check me-2"></i>{% trans "Assignment Info" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><strong>{% trans "Hospital" %}:</strong><br>{{ inquiry.hospital.name }}</p>
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Assigned To")}}</div>
|
||||
<div class="info-value">
|
||||
{% if inquiry.assigned_to %}
|
||||
{{ inquiry.assigned_to.get_full_name }}
|
||||
<br>
|
||||
<small class="text-muted">
|
||||
{{ _("Assigned") }} {{ inquiry.assigned_at|date:"M d, Y H:i"|default:_("N/A") }}
|
||||
</small>
|
||||
{% else %}
|
||||
<span class="text-muted">{{ _("Unassigned") }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if inquiry.department %}
|
||||
<p><strong>{% trans "Department" %}:</strong><br>{{ inquiry.department.name }}</p>
|
||||
{% if inquiry.responded_by %}
|
||||
<div class="mb-3">
|
||||
<div class="info-label">{{ _("Responded By")}}</div>
|
||||
<div class="info-value">
|
||||
{{ inquiry.responded_by.get_full_name }}
|
||||
<br>
|
||||
<small class="text-muted">
|
||||
{{ inquiry.responded_at|date:"M d, Y H:i" }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if inquiry.assigned_to %}
|
||||
<p><strong>{% trans "Assigned To" %}:</strong><br>{{ inquiry.assigned_to.get_full_name }}</p>
|
||||
{% if inquiry.resolved_by %}
|
||||
<div class="mb-0">
|
||||
<div class="info-label">{{ _("Resolved By")}}</div>
|
||||
<div class="info-value">
|
||||
{{ inquiry.resolved_by.get_full_name }}
|
||||
<br>
|
||||
<small class="text-muted">
|
||||
{{ inquiry.resolved_at|date:"M d, Y H:i" }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,162 +1,277 @@
|
||||
{% extends 'layouts/base.html' %}
|
||||
{% extends "layouts/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{% trans "New Inquiry" %}{% endblock %}
|
||||
{% block title %}{{ _("New Inquiry")}} - PX360{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<style>
|
||||
.form-section {
|
||||
background: #fff;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
padding: 25px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.form-section-title {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
color: #495057;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 2px solid #17a2b8;
|
||||
}
|
||||
.required-field::after {
|
||||
content: " *";
|
||||
color: #dc3545;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container-fluid">
|
||||
<!-- Page Header -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h1 class="h3 mb-0">{% trans "New Inquiry" %}</h1>
|
||||
<p class="text-muted">{% trans "Create a new patient inquiry" %}</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'complaints:inquiry_list' %}" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left"></i> {% trans "Back to List" %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<a href="{% url 'complaints:inquiry_list' %}" class="btn btn-outline-secondary btn-sm mb-3">
|
||||
<i class="bi bi-arrow-left me-1"></i> {{ _("Back to Inquiries")}}
|
||||
</a>
|
||||
<h2 class="mb-1">
|
||||
<i class="bi bi-plus-circle text-info me-2"></i>
|
||||
{{ _("Create New Inquiry")}}
|
||||
</h2>
|
||||
<p class="text-muted mb-0">{{ _("Create a new patient inquiry or request")}}</p>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h6 class="m-0 font-weight-bold">{% trans "Inquiry Information" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
<!-- Hospital Selection -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Hospital" %} <span class="text-danger">*</span></label>
|
||||
<select name="hospital_id" class="form-select" required id="hospital-select">
|
||||
<option value="">{% trans "Select Hospital" %}</option>
|
||||
<form method="post" action="{% url 'complaints:inquiry_create' %}" id="inquiryForm">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<!-- Organization Information -->
|
||||
<div class="form-section">
|
||||
<h5 class="form-section-title">
|
||||
<i class="bi bi-hospital me-2"></i>{{ _("Organization") }}
|
||||
</h5>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label required-field">{% trans "Hospital" %}</label>
|
||||
<select name="hospital_id" class="form-select" id="hospital-select" required>
|
||||
<option value="">{{ _("Select hospital")}}</option>
|
||||
{% for hospital in hospitals %}
|
||||
<option value="{{ hospital.id }}">{{ hospital.name }}</option>
|
||||
<option value="{{ hospital.id }}">{{ hospital.name_en }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Department Selection -->
|
||||
<div class="mb-3">
|
||||
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">{% trans "Department" %}</label>
|
||||
<select name="department_id" class="form-select" id="department-select">
|
||||
<option value="">{% trans "Select Department" %}</option>
|
||||
<option value="">{{ _("Select department")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Patient Search -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Patient" %} ({% trans "Optional" %})</label>
|
||||
<input type="text" class="form-control" id="patient-search" placeholder="{% trans 'Search by MRN or name...' %}">
|
||||
<input type="hidden" name="patient_id" id="patient-id">
|
||||
<div id="patient-results" class="list-group mt-2" style="display: none;"></div>
|
||||
<div id="selected-patient" class="alert alert-info mt-2" style="display: none;"></div>
|
||||
<!-- Contact/Patient Information -->
|
||||
<div class="form-section">
|
||||
<h5 class="form-section-title">
|
||||
<i class="bi bi-person-fill me-2"></i>{{ _("Contact Information")}}
|
||||
</h5>
|
||||
|
||||
<!-- Patient Search -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Patient" %} ({% trans "Optional" %})</label>
|
||||
<input type="text" class="form-control" id="patient-search"
|
||||
placeholder="{% trans 'Search by MRN or name...' %}">
|
||||
<input type="hidden" name="patient_id" id="patient-id">
|
||||
<div id="patient-results" class="list-group mt-2" style="display: none;"></div>
|
||||
<div id="selected-patient" class="alert alert-info mt-2" style="display: none;"></div>
|
||||
</div>
|
||||
|
||||
<div class="text-muted mb-3">
|
||||
<small>{{ _("OR") }}</small>
|
||||
</div>
|
||||
|
||||
<!-- Contact Information (if no patient) -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Contact Name" %}</label>
|
||||
<input type="text" name="contact_name" class="form-control"
|
||||
placeholder="{% trans 'Name of contact person' %}">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">{% trans "Contact Phone" %}</label>
|
||||
<input type="tel" name="contact_phone" class="form-control"
|
||||
placeholder="{% trans 'Phone number' %}">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- Contact Information (if no patient) -->
|
||||
<h6 class="mb-3">{% trans "Contact Information" %} ({% trans "if not a registered patient" %})</h6>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Contact Name" %}</label>
|
||||
<input type="text" name="contact_name" class="form-control">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">{% trans "Contact Email" %}</label>
|
||||
<input type="email" name="contact_email" class="form-control"
|
||||
placeholder="{% trans 'Email address' %}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">{% trans "Contact Phone" %}</label>
|
||||
<input type="tel" name="contact_phone" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">{% trans "Contact Email" %}</label>
|
||||
<input type="email" name="contact_email" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Inquiry Details -->
|
||||
<div class="form-section">
|
||||
<h5 class="form-section-title">
|
||||
<i class="bi bi-file-text me-2"></i>{{ _("Inquiry Details")}}
|
||||
</h5>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label required-field">{% trans "Category" %}</label>
|
||||
<select name="category" class="form-select" required>
|
||||
<option value="">{{ _("Select category")}}</option>
|
||||
<option value="appointment">{{ _("Appointment")}}</option>
|
||||
<option value="billing">{{ _("Billing")}}</option>
|
||||
<option value="medical_records">{{ _("Medical Records")}}</option>
|
||||
<option value="pharmacy">{{ _("Pharmacy")}}</option>
|
||||
<option value="insurance">{{ _("Insurance")}}</option>
|
||||
<option value="feedback">{{ _("Feedback")}}</option>
|
||||
<option value="general">{{ _("General Information")}}</option>
|
||||
<option value="other">{{ _("Other")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="mb-3">
|
||||
<label class="form-label required-field">{% trans "Subject" %}</label>
|
||||
<input type="text" name="subject" class="form-control" required maxlength="500"
|
||||
placeholder="{% trans 'Brief summary of the inquiry' %}">
|
||||
</div>
|
||||
|
||||
<!-- Inquiry Details -->
|
||||
<h6 class="mb-3">{% trans "Inquiry Details" %}</h6>
|
||||
<div class="mb-3">
|
||||
<label class="form-label required-field">{% trans "Message" %}</label>
|
||||
<textarea name="message" class="form-control" rows="6" required
|
||||
placeholder="{% trans 'Detailed description of the inquiry...' %}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Category" %} <span class="text-danger">*</span></label>
|
||||
<select name="category" class="form-select" required>
|
||||
<option value="">{% trans "Select Category" %}</option>
|
||||
<option value="appointment">{% trans "Appointment" %}</option>
|
||||
<option value="billing">{% trans "Billing" %}</option>
|
||||
<option value="medical_records">{% trans "Medical Records" %}</option>
|
||||
<option value="general">{% trans "General Information" %}</option>
|
||||
<option value="other">{% trans "Other" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Sidebar -->
|
||||
<div class="col-lg-4">
|
||||
<!-- Classification -->
|
||||
<div class="form-section">
|
||||
<h5 class="form-section-title">
|
||||
<i class="bi bi-tags me-2"></i>{{ _("Classification") }}
|
||||
</h5>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Priority" %}</label>
|
||||
<select name="priority" class="form-select">
|
||||
<option value="">{{ _("Select priority")}}</option>
|
||||
<option value="low">{{ _("Low") }}</option>
|
||||
<option value="medium" selected>{{ _("Medium") }}</option>
|
||||
<option value="high">{{ _("High") }}</option>
|
||||
<option value="urgent">{{ _("Urgent") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Source" %}</label>
|
||||
<select name="source" class="form-select">
|
||||
<option value="">{{ _("Select source")}}</option>
|
||||
<option value="patient">{{ _("Patient") }}</option>
|
||||
<option value="family">{{ _("Family Member")}}</option>
|
||||
<option value="staff">{{ _("Staff") }}</option>
|
||||
<option value="phone">{{ _("Phone") }}</option>
|
||||
<option value="email">{{ _("Email") }}</option>
|
||||
<option value="website">{{ _("Website") }}</option>
|
||||
<option value="walk_in">{{ _("Walk-in") }}</option>
|
||||
<option value="social_media">{{ _("Social Media")}}</option>
|
||||
<option value="call_center">{{ _("Call Center")}}</option>
|
||||
<option value="other">{{ _("Other")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Subject" %} <span class="text-danger">*</span></label>
|
||||
<input type="text" name="subject" class="form-control" required maxlength="500">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Channel" %}</label>
|
||||
<select name="channel" class="form-select">
|
||||
<option value="">{{ _("Select channel")}}</option>
|
||||
<option value="in_person">{{ _("In Person") }}</option>
|
||||
<option value="phone">{{ _("Phone") }}</option>
|
||||
<option value="email">{{ _("Email") }}</option>
|
||||
<option value="web_form">{{ _("Web Form") }}</option>
|
||||
<option value="mobile_app">{{ _("Mobile App") }}</option>
|
||||
<option value="social_media">{{ _("Social Media")}}</option>
|
||||
<option value="fax">{{ _("Fax") }}</option>
|
||||
<option value="other">{{ _("Other")}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Message" %} <span class="text-danger">*</span></label>
|
||||
<textarea name="message" class="form-control" rows="6" required></textarea>
|
||||
</div>
|
||||
<!-- Due Date -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{% trans "Due Date" %}</label>
|
||||
<input type="datetime-local" name="due_date" class="form-control"
|
||||
placeholder="{% trans 'Optional due date' %}">
|
||||
<small class="form-text text-muted">
|
||||
{{ _("Leave empty for default based on priority")}}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<a href="{% url 'complaints:inquiry_list' %}" class="btn btn-secondary me-2">{% trans "Cancel" %}</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save"></i> {% trans "Create Inquiry" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Help Information -->
|
||||
<div class="alert alert-info">
|
||||
<h6 class="alert-heading">
|
||||
<i class="bi bi-info-circle me-2"></i>{{ _("Help")}}
|
||||
</h6>
|
||||
<p class="mb-0 small">
|
||||
{{ _("Use this form to create a new inquiry from a patient or visitor.")}}
|
||||
</p>
|
||||
<hr class="my-2">
|
||||
<p class="mb-0 small">
|
||||
{{ _("If the inquiry is from a registered patient, search and select them. Otherwise, provide contact information.")}}
|
||||
</p>
|
||||
<p class="mb-0 small mt-2 text-muted">
|
||||
{{ _("Fields marked with * are required.")}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div class="d-grid gap-2">
|
||||
<button type="submit" class="btn btn-primary btn-lg">
|
||||
<i class="bi bi-check-circle me-2"></i>{{ _("Create Inquiry")}}
|
||||
</button>
|
||||
<a href="{% url 'complaints:inquiry_list' %}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-x-circle me-2"></i>{{ _("Cancel") }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h6 class="m-0 font-weight-bold">{% trans "Help" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="small">{% trans "Use this form to create a new inquiry from a patient or visitor." %}</p>
|
||||
<p class="small">{% trans "If the inquiry is from a registered patient, search and select them. Otherwise, provide contact information." %}</p>
|
||||
<p class="small text-muted">{% trans "Fields marked with * are required." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
// Department loading
|
||||
document.getElementById('hospital-select').addEventListener('change', function() {
|
||||
document.getElementById('hospital-select')?.addEventListener('change', function() {
|
||||
const hospitalId = this.value;
|
||||
const departmentSelect = document.getElementById('department-select');
|
||||
|
||||
if (!hospitalId) {
|
||||
departmentSelect.innerHTML = '<option value="">{% trans "Select Department" %}</option>';
|
||||
departmentSelect.innerHTML = '<option value="">{{ _("Select department")}}</option>';
|
||||
return;
|
||||
}
|
||||
|
||||
fetch(`/complaints/ajax/departments/?hospital_id=${hospitalId}`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
departmentSelect.innerHTML = '<option value="">{% trans "Select Department" %}</option>';
|
||||
departmentSelect.innerHTML = '<option value="">{{ _("Select department")}}</option>';
|
||||
data.departments.forEach(dept => {
|
||||
const option = document.createElement('option');
|
||||
option.value = dept.id;
|
||||
option.textContent = dept.name;
|
||||
option.textContent = dept.name_en || dept.name;
|
||||
departmentSelect.appendChild(option);
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Error loading departments:', error));
|
||||
});
|
||||
|
||||
// Patient search
|
||||
// Patient search with debounce
|
||||
let searchTimeout;
|
||||
document.getElementById('patient-search').addEventListener('input', function() {
|
||||
document.getElementById('patient-search')?.addEventListener('input', function() {
|
||||
const query = this.value;
|
||||
const resultsDiv = document.getElementById('patient-results');
|
||||
|
||||
@ -172,7 +287,7 @@ document.getElementById('patient-search').addEventListener('input', function() {
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.patients.length === 0) {
|
||||
resultsDiv.innerHTML = '<div class="list-group-item">{% trans "No patients found" %}</div>';
|
||||
resultsDiv.innerHTML = `<div class="list-group-item">{{ _("No patients found")}}</div>`;
|
||||
resultsDiv.style.display = 'block';
|
||||
return;
|
||||
}
|
||||
@ -184,7 +299,7 @@ document.getElementById('patient-search').addEventListener('input', function() {
|
||||
item.className = 'list-group-item list-group-item-action';
|
||||
item.innerHTML = `
|
||||
<strong>${patient.name}</strong><br>
|
||||
<small>MRN: ${patient.mrn} | ${patient.phone || ''} | ${patient.email || ''}</small>
|
||||
<small>{{ _("MRN") }}: ${patient.mrn} | ${patient.phone || ''} | ${patient.email || ''}</small>
|
||||
`;
|
||||
item.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
@ -193,7 +308,8 @@ document.getElementById('patient-search').addEventListener('input', function() {
|
||||
resultsDiv.appendChild(item);
|
||||
});
|
||||
resultsDiv.style.display = 'block';
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Error searching patients:', error));
|
||||
}, 300);
|
||||
});
|
||||
|
||||
@ -204,9 +320,9 @@ function selectPatient(patient) {
|
||||
|
||||
const selectedDiv = document.getElementById('selected-patient');
|
||||
selectedDiv.innerHTML = `
|
||||
<strong>{% trans "Selected Patient" %}:</strong> ${patient.name}<br>
|
||||
<small>MRN: ${patient.mrn}</small>
|
||||
<button type="button" class="btn btn-sm btn-link" onclick="clearPatient()">{% trans "Clear" %}</button>
|
||||
<strong>{{ _("Selected Patient") }}:</strong> ${patient.name}<br>
|
||||
<small>{{ _("MRN") }}: ${patient.mrn}</small>
|
||||
<button type="button" class="btn btn-sm btn-link" onclick="clearPatient()">{{ _("Clear") }}</button>
|
||||
`;
|
||||
selectedDiv.style.display = 'block';
|
||||
}
|
||||
@ -215,5 +331,15 @@ function clearPatient() {
|
||||
document.getElementById('patient-id').value = '';
|
||||
document.getElementById('selected-patient').style.display = 'none';
|
||||
}
|
||||
|
||||
// Form validation
|
||||
const form = document.getElementById('inquiryForm');
|
||||
form?.addEventListener('submit', function(e) {
|
||||
if (!form.checkValidity()) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
form.classList.add('was-validated');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@ -1,19 +1,95 @@
|
||||
{% extends 'layouts/base.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{% trans "Inquiries" %}{% endblock %}
|
||||
{% block title %}{{ _("Inquiries Console")}} - PX360{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<style>
|
||||
.filter-panel {
|
||||
background: #f8f9fa;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.filter-panel.collapsed {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.filter-panel.collapsed .filter-body {
|
||||
display: none;
|
||||
}
|
||||
.table-toolbar {
|
||||
background: #fff;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
padding: 15px;
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.status-badge {
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
.status-open { background: #e3f2fd; color: #1976d2; }
|
||||
.status-in_progress { background: #fff3e0; color: #f57c00; }
|
||||
.status-resolved { background: #e8f5e9; color: #388e3c; }
|
||||
.status-closed { background: #f5f5f5; color: #616161; }
|
||||
|
||||
.priority-badge {
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
.priority-low { background: #e8f5e9; color: #388e3c; }
|
||||
.priority-medium { background: #fff3e0; color: #f57c00; }
|
||||
.priority-high { background: #ffebee; color: #d32f2f; }
|
||||
.priority-urgent { background: #880e4f; color: #fff; }
|
||||
|
||||
.overdue-badge {
|
||||
background: #d32f2f;
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.inquiry-row:hover {
|
||||
background: #f8f9fa;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
border-left: 4px solid;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
.stat-card:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container-fluid">
|
||||
<!-- Page Header -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<h1 class="h3 mb-0">{% trans "Inquiries" %}</h1>
|
||||
<p class="text-muted">{% trans "Manage patient inquiries and requests" %}</p>
|
||||
<h2 class="mb-1">
|
||||
<i class="bi bi-question-circle-fill text-info me-2"></i>
|
||||
{{ _("Inquiries Console")}}
|
||||
</h2>
|
||||
<p class="text-muted mb-0">{{ _("Manage patient inquiries and requests")}}</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'complaints:inquiry_create' %}" class="btn btn-primary">
|
||||
<i class="fas fa-plus"></i> {% trans "New Inquiry" %}
|
||||
<i class="bi bi-plus-circle me-1"></i> {{ _("New Inquiry")}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -21,176 +97,375 @@
|
||||
<!-- Statistics Cards -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-3">
|
||||
<div class="card border-left-primary">
|
||||
<div class="card stat-card border-primary">
|
||||
<div class="card-body">
|
||||
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">{% trans "Total" %}</div>
|
||||
<div class="h5 mb-0 font-weight-bold">{{ stats.total }}</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h6 class="text-muted mb-1">{% trans "Total Inquiries" %}</h6>
|
||||
<h3 class="mb-0">{{ stats.total }}</h3>
|
||||
</div>
|
||||
<div class="text-primary">
|
||||
<i class="bi bi-list-ul" style="font-size: 2rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card border-left-warning">
|
||||
<div class="card stat-card border-info">
|
||||
<div class="card-body">
|
||||
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1">{% trans "Open" %}</div>
|
||||
<div class="h5 mb-0 font-weight-bold">{{ stats.open }}</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h6 class="text-muted mb-1">{% trans "Open" %}</h6>
|
||||
<h3 class="mb-0">{{ stats.open }}</h3>
|
||||
</div>
|
||||
<div class="text-info">
|
||||
<i class="bi bi-folder2-open" style="font-size: 2rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card border-left-info">
|
||||
<div class="card stat-card border-warning">
|
||||
<div class="card-body">
|
||||
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">{% trans "In Progress" %}</div>
|
||||
<div class="h5 mb-0 font-weight-bold">{{ stats.in_progress }}</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h6 class="text-muted mb-1">{% trans "In Progress" %}</h6>
|
||||
<h3 class="mb-0">{{ stats.in_progress }}</h3>
|
||||
</div>
|
||||
<div class="text-warning">
|
||||
<i class="bi bi-hourglass-split" style="font-size: 2rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card border-left-success">
|
||||
<div class="card stat-card border-success">
|
||||
<div class="card-body">
|
||||
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">{% trans "Resolved" %}</div>
|
||||
<div class="h5 mb-0 font-weight-bold">{{ stats.resolved }}</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h6 class="text-muted mb-1">{% trans "Resolved" %}</h6>
|
||||
<h3 class="mb-0 text-success">{{ stats.resolved }}</h3>
|
||||
</div>
|
||||
<div class="text-success">
|
||||
<i class="bi bi-check-circle-fill" style="font-size: 2rem;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<h6 class="m-0 font-weight-bold">{% trans "Filters" %}</h6>
|
||||
<!-- Filter Panel -->
|
||||
<div class="filter-panel" id="filterPanel">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h5 class="mb-0">
|
||||
<i class="bi bi-funnel me-2"></i>{{ _("Filters") }}
|
||||
</h5>
|
||||
<button class="btn btn-sm btn-outline-secondary" onclick="toggleFilters()">
|
||||
<i class="bi bi-chevron-up" id="filterToggleIcon"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="get" class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">{% trans "Search" %}</label>
|
||||
<input type="text" name="search" class="form-control" value="{{ filters.search }}" placeholder="{% trans 'Subject, contact name...' %}">
|
||||
|
||||
<div class="filter-body">
|
||||
<form method="get" action="{% url 'complaints:inquiry_list' %}" id="filterForm">
|
||||
<div class="row g-3">
|
||||
<!-- Search -->
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">{% trans "Search" %}</label>
|
||||
<input type="text" class="form-control" name="search"
|
||||
placeholder="{% trans 'Subject, contact name...' %}"
|
||||
value="{{ filters.search }}">
|
||||
</div>
|
||||
|
||||
<!-- Status -->
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">{% trans "Status" %}</label>
|
||||
<select class="form-select" name="status">
|
||||
<option value="">{{ _("All Statuses")}}</option>
|
||||
{% for value, label in status_choices %}
|
||||
<option value="{{ value }}" {% if filters.status == value %}selected{% endif %}>
|
||||
{{ label }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Priority -->
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">{% trans "Priority" %}</label>
|
||||
<select class="form-select" name="priority">
|
||||
<option value="">{{ _("All Priorities")}}</option>
|
||||
<option value="low" {% if filters.priority == 'low' %}selected{% endif %}>{{ _("Low") }}</option>
|
||||
<option value="medium" {% if filters.priority == 'medium' %}selected{% endif %}>{{ _("Medium") }}</option>
|
||||
<option value="high" {% if filters.priority == 'high' %}selected{% endif %}>{{ _("High") }}</option>
|
||||
<option value="urgent" {% if filters.priority == 'urgent' %}selected{% endif %}>{{ _("Urgent") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Category -->
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">{% trans "Category" %}</label>
|
||||
<select class="form-select" name="category">
|
||||
<option value="">{{ _("All Categories")}}</option>
|
||||
<option value="appointment" {% if filters.category == 'appointment' %}selected{% endif %}>{{ _("Appointment")}}</option>
|
||||
<option value="billing" {% if filters.category == 'billing' %}selected{% endif %}>{{ _("Billing") }}</option>
|
||||
<option value="medical_records" {% if filters.category == 'medical_records' %}selected{% endif %}>{{ _("Medical Records")}}</option>
|
||||
<option value="pharmacy" {% if filters.category == 'pharmacy' %}selected{% endif %}>{{ _("Pharmacy")}}</option>
|
||||
<option value="insurance" {% if filters.category == 'insurance' %}selected{% endif %}>{{ _("Insurance")}}</option>
|
||||
<option value="feedback" {% if filters.category == 'feedback' %}selected{% endif %}>{{ _("Feedback")}}</option>
|
||||
<option value="general" {% if filters.category == 'general' %}selected{% endif %}>{{ _("General")}}</option>
|
||||
<option value="other" {% if filters.category == 'other' %}selected{% endif %}>{{ _("Other") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Hospital -->
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">{% trans "Hospital" %}</label>
|
||||
<select class="form-select" name="hospital">
|
||||
<option value="">{{ _("All Hospitals")}}</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>
|
||||
|
||||
<!-- Assigned To -->
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">{% trans "Assigned To" %}</label>
|
||||
<select class="form-select" name="assigned_to">
|
||||
<option value="">{{ _("All Users")}}</option>
|
||||
{% for user_obj in assignable_users %}
|
||||
<option value="{{ user_obj.id }}" {% if filters.assigned_to == user_obj.id|stringformat:"s" %}selected{% endif %}>
|
||||
{{ user_obj.get_full_name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Date Range -->
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">{% trans "Date From" %}</label>
|
||||
<input type="date" class="form-control" name="date_from" value="{{ filters.date_from }}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">{% trans "Date To" %}</label>
|
||||
<input type="date" class="form-control" name="date_to" value="{{ filters.date_to }}">
|
||||
</div>
|
||||
</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-3">
|
||||
<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 }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2 d-flex align-items-end">
|
||||
<button type="submit" class="btn btn-primary me-2">{% trans "Apply" %}</button>
|
||||
<a href="{% url 'complaints:inquiry_list' %}" class="btn btn-secondary">{% trans "Clear" %}</a>
|
||||
|
||||
<div class="mt-3 d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-search me-1"></i> {{ _("Apply Filters")}}
|
||||
</button>
|
||||
<a href="{% url 'complaints:inquiry_list' %}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-x-circle me-1"></i> {{ _("Clear") }}
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Table Toolbar -->
|
||||
<div class="table-toolbar">
|
||||
<div>
|
||||
<span class="text-muted">
|
||||
Showing {{ page_obj.start_index }} to {{ page_obj.end_index }} of {{ page_obj.paginator.count }} inquiries
|
||||
</span>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button class="btn btn-sm btn-outline-primary" onclick="exportData('csv')">
|
||||
<i class="bi bi-file-earmark-spreadsheet me-1"></i> {{ _("Export CSV")}}
|
||||
</button>
|
||||
<button class="btn btn-sm btn-outline-primary" onclick="exportData('excel')">
|
||||
<i class="bi bi-file-earmark-excel me-1"></i> {{ _("Export Excel")}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Inquiries Table -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h6 class="m-0 font-weight-bold">{% trans "Inquiries List" %}</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<table class="table table-hover mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width: 50px;">
|
||||
<input type="checkbox" class="form-check-input" id="selectAll">
|
||||
</th>
|
||||
<th>{% trans "ID" %}</th>
|
||||
<th>{% trans "Subject" %}</th>
|
||||
<th>{% trans "Contact" %}</th>
|
||||
<th>{% trans "Category" %}</th>
|
||||
<th>{% trans "Status" %}</th>
|
||||
<th>{% trans "Priority" %}</th>
|
||||
<th>{% trans "Hospital" %}</th>
|
||||
<th>{% trans "Assigned To" %}</th>
|
||||
<th>{% trans "Due Date" %}</th>
|
||||
<th>{% trans "Created" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for inquiry in inquiries %}
|
||||
<tr>
|
||||
<td><small class="text-muted">{{ inquiry.id|truncatechars:8 }}</small></td>
|
||||
<tr class="inquiry-row" onclick="window.location='{% url 'complaints:inquiry_detail' inquiry.id %}'">
|
||||
<td onclick="event.stopPropagation();">
|
||||
<input type="checkbox" class="form-check-input inquiry-checkbox"
|
||||
value="{{ inquiry.id }}">
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'complaints:inquiry_detail' inquiry.id %}">{{ inquiry.subject }}</a>
|
||||
<small class="text-muted">#{{ inquiry.id|slice:":8" }}</small>
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
{{ inquiry.subject|truncatewords:8 }}
|
||||
{% if inquiry.is_overdue %}
|
||||
<span class="overdue-badge">{{ _("OVERDUE") }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{% if inquiry.patient %}
|
||||
{{ inquiry.patient.get_full_name }}
|
||||
<strong>{{ inquiry.patient.get_full_name }}</strong><br>
|
||||
<small class="text-muted">{{ _("MRN") }}: {{ inquiry.patient.mrn }}</small>
|
||||
{% else %}
|
||||
{{ inquiry.contact_name|default:inquiry.contact_email }}
|
||||
<strong>{{ inquiry.contact_name|default:inquiry.contact_email }}</strong><br>
|
||||
<small class="text-muted">{{ inquiry.contact_email }}</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><span class="badge bg-secondary">{{ inquiry.get_category_display }}</span></td>
|
||||
<td>
|
||||
{% if inquiry.status == 'open' %}
|
||||
<span class="badge bg-warning">{% trans "Open" %}</span>
|
||||
{% elif inquiry.status == 'in_progress' %}
|
||||
<span class="badge bg-info">{% trans "In Progress" %}</span>
|
||||
{% elif inquiry.status == 'resolved' %}
|
||||
<span class="badge bg-success">{% trans "Resolved" %}</span>
|
||||
<span class="badge bg-secondary">{{ inquiry.get_category_display }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="status-badge status-{{ inquiry.status }}">
|
||||
{{ inquiry.get_status_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{% if inquiry.priority %}
|
||||
<span class="priority-badge priority-{{ inquiry.priority }}">
|
||||
{{ inquiry.get_priority_display }}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">{{ inquiry.get_status_display }}</span>
|
||||
<span class="text-muted"><em>-</em></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ inquiry.hospital.name }}</td>
|
||||
<td>{{ inquiry.created_at|date:"Y-m-d H:i" }}</td>
|
||||
<td>
|
||||
<a href="{% url 'complaints:inquiry_detail' inquiry.id %}" class="btn btn-sm btn-primary">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
<small>{{ inquiry.hospital.name_en|truncatewords:3 }}</small>
|
||||
</td>
|
||||
<td>
|
||||
{% if inquiry.assigned_to %}
|
||||
<small>{{ inquiry.assigned_to.get_full_name }}</small>
|
||||
{% else %}
|
||||
<span class="text-muted"><em>{{ _("Unassigned") }}</em></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if inquiry.due_date %}
|
||||
<small class="{% if inquiry.is_overdue %}text-danger fw-bold{% endif %}">
|
||||
{{ inquiry.due_date|date:"M d, Y H:i" }}
|
||||
</small>
|
||||
{% else %}
|
||||
<span class="text-muted"><em>-</em></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<small class="text-muted">{{ inquiry.created_at|date:"M d, Y" }}</small>
|
||||
</td>
|
||||
<td onclick="event.stopPropagation();">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="{% url 'complaints:inquiry_detail' inquiry.id %}"
|
||||
class="btn btn-outline-primary" title="{% trans 'View' %}">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="8" class="text-center text-muted">{% trans "No inquiries found" %}</td>
|
||||
<td colspan="12" class="text-center py-5">
|
||||
<i class="bi bi-inbox" style="font-size: 3rem; color: #ccc;"></i>
|
||||
<p class="text-muted mt-3">{{ _("No inquiries found")}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Pagination -->
|
||||
{% if page_obj.has_other_pages %}
|
||||
<nav aria-label="Page navigation">
|
||||
<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 %}
|
||||
|
||||
{% for num in page_obj.paginator.page_range %}
|
||||
<li class="page-item {% if page_obj.number == num %}active{% endif %}">
|
||||
<a class="page-link" href="?page={{ num }}{% for key, value in filters.items %}&{{ key }}={{ value }}{% endfor %}">{{ num }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
{% 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>
|
||||
|
||||
<!-- Pagination -->
|
||||
{% if page_obj.has_other_pages %}
|
||||
<nav aria-label="Inquiries pagination" class="mt-4">
|
||||
<ul class="pagination justify-content-center">
|
||||
{% if page_obj.has_previous %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page=1{% for key, value in filters.items %}&{{ key }}={{ value }}{% endfor %}">
|
||||
<i class="bi bi-chevron-double-left"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.previous_page_number }}{% for key, value in filters.items %}&{{ key }}={{ value }}{% endfor %}">
|
||||
<i class="bi bi-chevron-left"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% for num in page_obj.paginator.page_range %}
|
||||
{% if page_obj.number == num %}
|
||||
<li class="page-item active"><span class="page-link">{{ num }}</span></li>
|
||||
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ num }}{% for key, value in filters.items %}&{{ key }}={{ value }}{% endfor %}">
|
||||
{{ num }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% 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 %}">
|
||||
<i class="bi bi-chevron-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.paginator.num_pages }}{% for key, value in filters.items %}&{{ key }}={{ value }}{% endfor %}">
|
||||
<i class="bi bi-chevron-double-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
function toggleFilters() {
|
||||
const panel = document.getElementById('filterPanel');
|
||||
const icon = document.getElementById('filterToggleIcon');
|
||||
panel.classList.toggle('collapsed');
|
||||
icon.classList.toggle('bi-chevron-up');
|
||||
icon.classList.toggle('bi-chevron-down');
|
||||
}
|
||||
|
||||
function exportData(format) {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
params.set('export', format);
|
||||
window.location.href = '{% url "complaints:inquiry_list" %}?' + params.toString();
|
||||
}
|
||||
|
||||
// Select all checkbox
|
||||
document.getElementById('selectAll')?.addEventListener('change', function() {
|
||||
const checkboxes = document.querySelectorAll('.inquiry-checkbox');
|
||||
checkboxes.forEach(cb => cb.checked = this.checked);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user