HH/templates/complaints/send_to_department_preview.html
ismail 7369d08012
All checks were successful
Build and Push Docker Image / build (push) Successful in 4m14s
feat: unified reference numbers + feedback modules QA audit
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.
2026-06-14 14:29:23 +03:00

83 lines
4.4 KiB
HTML

{% extends "layouts/base.html" %}
{% load i18n %}
{% block title %}{% trans "Preview Department Requests" %} - {{ complaint.reference_number }} - PX360{% endblock %}
{% block content %}
<div class="max-w-4xl mx-auto px-4 py-6">
<div class="bg-gradient-to-r from-navy to-blue rounded-2xl p-6 text-white mb-6 shadow-lg">
<h1 class="text-2xl font-bold">{% trans "Preview Department Requests" %}</h1>
<p class="text-white/80 text-sm mt-1">{{ complaint.reference_number }} - {% trans "Review messages before sending to department champions" %}</p>
</div>
<div class="bg-amber-50 border border-amber-200 rounded-xl p-4 mb-6 flex items-start gap-3">
<i data-lucide="info" class="w-5 h-5 text-amber-600 mt-0.5"></i>
<div>
<p class="text-sm font-semibold text-amber-800">{% trans "Review each message below" %}</p>
<p class="text-xs text-amber-700 mt-1">{% trans "Department requests will be sent to department champions. Department managers will receive notification." %}</p>
</div>
</div>
<form method="post">
{% csrf_token %}
{% for dept_id in selected_dept_ids %}
<input type="hidden" name="selected_departments" value="{{ dept_id }}">
{% endfor %}
<input type="hidden" name="action" value="send">
<input type="hidden" name="request_message" value="{{ request_message }}">
{% for dept_id, contact_person_id in contact_person_map.items %}
<input type="hidden" name="contact_person_{{ dept_id }}" value="{{ contact_person_id }}">
{% endfor %}
{% for dept_info in preview_depts %}
<div class="bg-white rounded-2xl border border-slate-200 shadow-sm mb-4 overflow-hidden">
<div class="bg-slate-50 px-5 py-3 border-b border-slate-200 flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-10 h-10 bg-navy rounded-full flex items-center justify-center text-white font-bold text-sm">
{{ dept_info.department_name|truncatechars:2 }}
</div>
<div>
<p class="font-bold text-navy text-sm">{{ dept_info.department_name }}</p>
<div class="flex items-center gap-2">
<i data-lucide="crown" class="w-3 h-3 text-amber-500"></i>
<span class="text-xs text-slate">{% trans "Send To:" %} {{ dept_info.contact_person_name }} ({{ dept_info.contact_person_role }})</span>
</div>
</div>
</div>
<span class="text-xs text-slate">{{ dept_info.champion_email|default:"No email" }}</span>
</div>
<div class="p-5">
<div class="mb-3">
<p class="text-xs font-semibold text-slate uppercase tracking-wide mb-2">{% trans "Involved Staff" %}</p>
<div class="flex flex-wrap gap-2">
{% for s in dept_info.staff_list %}
<span class="px-2.5 py-1 bg-slate-100 rounded-lg text-xs font-bold text-navy">
{{ s.staff_name }} <span class="text-slate font-normal">({{ s.role }})</span>
</span>
{% endfor %}
</div>
</div>
{% if dept_info.dept_manager %}
<p class="text-xs text-slate mt-2">
<i data-lucide="user-check" class="w-3 h-3 inline"></i>
{% trans "Manager notification:" %} {{ dept_info.dept_manager_name }} ({{ dept_info.dept_manager_email|default:"No email" }})
</p>
{% endif %}
</div>
</div>
{% endfor %}
<div class="flex gap-3 justify-end mt-6 mb-8">
<a href="{% url 'complaints:send_to_department_form' pk=complaint.pk %}"
class="px-6 py-3 border border-slate-200 rounded-xl font-semibold text-slate hover:bg-slate-50 transition">
{% trans "Back to Selection" %}
</a>
<button type="submit" class="px-6 py-3 bg-navy text-white rounded-xl font-semibold hover:bg-blue transition flex items-center gap-2">
<i data-lucide="send" class="w-5 h-5"></i>
{% trans "Send All Requests" %} ({{ preview_depts|length }})
</button>
</div>
</form>
</div>
{% endblock %}