All checks were successful
Build and Push Docker Image / build (push) Successful in 4m14s
Reference numbers (unified scheme PREFIX-YYYYMM-HOSP-NNNN, e.g. CMP-202606-HHN-0001): - new ReferenceSequence model + generate_reference() helper (apps/core) - Complaint/Inquiry/Observation/Appreciation/Suggestion emit unified refs via save() - prefix-based auto-routing in public track API (CMP/INQ/OBS trackable; APR/SGT internal-only) - removed legacy CMP-/INQ- generators in ui_views, integrations, px_sources - migrations: core.0003_referencesequence, appreciation.0006, feedback.0008, observations.0012 - unit tests (format, sanitization, monthly reset, 40-thread concurrency) QA audit: - isolated E2E hospital sandbox mirroring HH-N + 10 role users (create_e2e_isolated_env) - feedback-modules-audit.spec.ts + audit helper (headed, run-to-completion) - reports/feedback-modules-qa-report.md Also bundles accumulated in-progress work across complaints, observations, organizations, templates, and other modules.
219 lines
10 KiB
HTML
219 lines
10 KiB
HTML
{% extends "layouts/source_user_base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% trans "Create Inquiry" %} - {{ source.get_localized_name }}{% endblock %}
|
|
|
|
{% block extra_css %}
|
|
<style>
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(20px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
.animate-in {
|
|
animation: fadeIn 0.5s ease-out forwards;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="p-6 md:p-8 bg-gradient-to-br from-light to-blue-50 min-h-screen">
|
|
<!-- Page Header -->
|
|
<div class="flex flex-wrap justify-between items-center gap-4 mb-8 animate-in">
|
|
<div class="flex items-center gap-3">
|
|
<div class="flex items-center justify-center w-14 h-14 bg-gradient-to-br from-cyan-500 to-blue-500 rounded-2xl shadow-lg shadow-cyan-200">
|
|
<i data-lucide="plus-circle" class="w-8 h-8 text-white"></i>
|
|
</div>
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-navy">
|
|
{% trans "Create Inquiry" %}
|
|
</h1>
|
|
<p class="text-slate text-sm">
|
|
{% trans "Submit a new inquiry from" %} <strong>{{ source.get_localized_name }}</strong>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<a href="{% url 'px_sources:source_user_inquiry_list' %}"
|
|
class="inline-flex items-center gap-2 px-5 py-2.5 bg-white border-2 border-blue-200 text-navy rounded-xl font-semibold hover:bg-blue-50 transition">
|
|
<i data-lucide="arrow-left" class="w-4 h-4"></i>
|
|
{% trans "Back to Inquiries" %}
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Info Banner -->
|
|
<div class="bg-cyan-50 border border-cyan-200 rounded-2xl p-4 mb-8 animate-in">
|
|
<div class="flex items-start gap-3">
|
|
<i data-lucide="info" class="w-5 h-5 text-cyan-600 mt-0.5 flex-shrink-0"></i>
|
|
<div>
|
|
<p class="text-sm font-bold text-cyan-800 mb-1">{% trans "Source Information" %}</p>
|
|
<p class="text-sm text-cyan-700">
|
|
{% trans "This inquiry will be automatically linked to" %} <strong>{{ source.get_localized_name }}</strong>.
|
|
{% trans "All required fields are marked with" %} <span class="text-red-500">*</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Form -->
|
|
<div class="bg-white rounded-2xl shadow-sm border border-blue-100 overflow-hidden animate-in">
|
|
<form method="post" novalidate data-loading data-loading-text="{% trans 'Submitting...' %}">
|
|
{% csrf_token %}
|
|
|
|
<div class="p-6 md:p-8">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
<!-- Contact Name -->
|
|
<div>
|
|
<label for="{{ form.contact_name.id_for_label }}" class="block text-sm font-bold text-navy mb-2">
|
|
{{ form.contact_name.label }} <span class="text-red-500">*</span>
|
|
</label>
|
|
{{ form.contact_name }}
|
|
{% if form.contact_name.errors %}
|
|
<div class="flex items-center gap-2 mt-2 text-red-600 text-sm">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{% for error in form.contact_name.errors %}{{ error }}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Contact Phone -->
|
|
<div>
|
|
<label for="{{ form.contact_phone.id_for_label }}" class="block text-sm font-bold text-navy mb-2">
|
|
{{ form.contact_phone.label }} <span class="text-red-500">*</span>
|
|
</label>
|
|
{{ form.contact_phone }}
|
|
{% if form.contact_phone.errors %}
|
|
<div class="flex items-center gap-2 mt-2 text-red-600 text-sm">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{% for error in form.contact_phone.errors %}{{ error }}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Contact Email -->
|
|
<div>
|
|
<label for="{{ form.contact_email.id_for_label }}" class="block text-sm font-bold text-navy mb-2">
|
|
{{ form.contact_email.label }}
|
|
</label>
|
|
{{ form.contact_email }}
|
|
{% if form.contact_email.errors %}
|
|
<div class="flex items-center gap-2 mt-2 text-red-600 text-sm">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{% for error in form.contact_email.errors %}{{ error }}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Inquiry Type -->
|
|
<div>
|
|
<label for="{{ form.category.id_for_label }}" class="block text-sm font-bold text-navy mb-2">
|
|
{{ form.category.label }} <span class="text-red-500">*</span>
|
|
</label>
|
|
{{ form.category }}
|
|
{% if form.category.errors %}
|
|
<div class="flex items-center gap-2 mt-2 text-red-600 text-sm">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{% for error in form.category.errors %}{{ error }}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Section -->
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mt-6">
|
|
<div>
|
|
<label for="{{ form.section.id_for_label }}" class="block text-sm font-bold text-navy mb-2">
|
|
{{ form.section.label }}
|
|
</label>
|
|
{{ form.section }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
|
|
|
|
<!-- Subject -->
|
|
<div class="md:col-span-2">
|
|
<label for="{{ form.subject.id_for_label }}" class="block text-sm font-bold text-navy mb-2">
|
|
{{ form.subject.label }} <span class="text-red-500">*</span>
|
|
</label>
|
|
{{ form.subject }}
|
|
{% if form.subject.errors %}
|
|
<div class="flex items-center gap-2 mt-2 text-red-600 text-sm">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{% for error in form.subject.errors %}{{ error }}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Message -->
|
|
<div class="md:col-span-2">
|
|
<label for="{{ form.message.id_for_label }}" class="block text-sm font-bold text-navy mb-2">
|
|
{{ form.message.label }} <span class="text-red-500">*</span>
|
|
</label>
|
|
{{ form.message }}
|
|
{% if form.message.errors %}
|
|
<div class="flex items-center gap-2 mt-2 text-red-600 text-sm">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{% for error in form.message.errors %}{{ error }}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Form Actions -->
|
|
<div class="px-6 md:px-8 py-4 bg-slate-50 border-t border-slate-100 flex gap-3">
|
|
<button type="submit"
|
|
class="inline-flex items-center gap-2 px-6 py-3 bg-blue-600 text-white rounded-xl font-semibold hover:bg-blue-700 transition">
|
|
<i data-lucide="check" class="w-5 h-5"></i>
|
|
{% trans "Submit Inquiry" %}
|
|
</button>
|
|
<a href="{% url 'px_sources:source_user_inquiry_list' %}"
|
|
class="inline-flex items-center gap-2 px-6 py-3 bg-white border-2 border-slate-200 text-slate-700 rounded-xl font-semibold hover:bg-slate-50 transition">
|
|
<i data-lucide="x" class="w-5 h-5"></i>
|
|
{% trans "Cancel" %}
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
lucide.createIcons();
|
|
|
|
const deptSelect = document.getElementById('id_department');
|
|
const sectionSelect = document.getElementById('id_section');
|
|
|
|
if (deptSelect && sectionSelect) {
|
|
deptSelect.addEventListener('change', function() {
|
|
const deptId = this.value;
|
|
sectionSelect.innerHTML = '<option value="">{% trans "Loading..." %}</option>';
|
|
if (!deptId) {
|
|
sectionSelect.innerHTML = '<option value="">{% trans "Select Section" %}</option>';
|
|
return;
|
|
}
|
|
fetch('/organizations/api/sections/?department=' + deptId)
|
|
.then(r => r.json())
|
|
.then(data => {
|
|
const sections = data.results || data;
|
|
sectionSelect.innerHTML = '<option value="">{% trans "Select Section" %}</option>';
|
|
sections.forEach(s => {
|
|
const opt = document.createElement('option');
|
|
opt.value = s.id;
|
|
opt.textContent = s.name;
|
|
sectionSelect.appendChild(opt);
|
|
});
|
|
})
|
|
.catch(err => {
|
|
console.error('Error loading sections:', err);
|
|
sectionSelect.innerHTML = '<option value="">{% trans "Error loading sections" %}</option>';
|
|
});
|
|
});
|
|
|
|
if (deptSelect.value) {
|
|
deptSelect.dispatchEvent(new Event('change'));
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %}
|