HH/templates/complaints/inquiry_department_response.html
ismail adff7dd8b5
All checks were successful
Build and Push Docker Image / build (push) Successful in 2m15s
fix: token-response forms, inquiry dept-response 500, get_email_header_html, lucide
Bugs 4-8 from the QA audit, all re-verified (re-run: 0 FAIL):
- token-response form pages (inquiry + observation, 8 templates) extended the
  static dashboard base (no {% block content %}) -> form was dropped. Switched
  to layouts/public_base.html; form + csrf now render, anonymous token POST works
- inquiry dept-response GET 500 (missing template) -> created
  complaints/inquiry_department_response.html (mirrors the observation one)
- NameError get_email_header_html in notifications/settings_service.py
  (send_inquiry_department_assigned/_resolved/_reopened) -> added to the imports
- "lucide is not defined" -> guarded the unguarded lucide.createIcons() in
  layouts/base.html and added a guarded init to layouts/public_base.html
- dept analytics XHR ERR_ABORTED -> verified endpoint returns 200 (test artifact)

Report updated: §13 issues marked fixed.
2026-06-14 20:13:45 +03:00

88 lines
4.3 KiB
HTML

{% extends "layouts/base.html" %}
{% load i18n %}
{% block title %}{{ inquiry.reference_number }} - {% trans "Department Response" %} - PX360{% endblock %}
{% block content %}
<header class="mb-6">
<div class="flex items-center gap-2 text-sm text-slate mb-2">
<a href="{% url 'inquiries:inquiry_list' %}" class="hover:text-navy">{% trans "Inquiries" %}</a>
<i data-lucide="chevron-right" class="w-4 h-4"></i>
<a href="{% url 'inquiries:inquiry_detail' pk=inquiry.pk %}" class="hover:text-navy">{{ inquiry.reference_number }}</a>
<i data-lucide="chevron-right" class="w-4 h-4"></i>
<span class="font-bold text-navy">{% trans "Department Response" %}</span>
</div>
<h1 class="text-2xl font-bold text-navy">
{{ inquiry.subject }}
</h1>
</header>
<div class="bg-white rounded-2xl shadow-sm border border-slate-100 p-6">
<div class="flex items-center gap-2 mb-4">
<i data-lucide="message-square" class="w-5 h-5 text-navy"></i>
<h2 class="text-lg font-bold text-navy">{% trans "Submit Department Response" %}</h2>
</div>
<div class="bg-slate-50 rounded-xl p-4 border border-slate-200 mb-6">
<p class="text-[10px] text-slate-500 uppercase font-bold mb-1">{% trans "Reference" %}</p>
<p class="font-mono text-sm font-bold text-navy">{{ inquiry.reference_number }}</p>
{% if inquiry.contact_name %}
<p class="text-[10px] text-slate-500 uppercase font-bold mb-1 mt-3">{% trans "From" %}</p>
<p class="text-sm text-slate-700">{{ inquiry.contact_name }}</p>
{% endif %}
<p class="text-[10px] text-slate-500 uppercase font-bold mb-1 mt-3">{% trans "Message" %}</p>
<p class="text-sm text-slate-700 leading-relaxed">{{ inquiry.message|truncatewords:50 }}</p>
</div>
{% if messages %}
<div class="mb-4">
{% for message in messages %}
<div class="px-4 py-3 rounded-lg text-sm font-semibold {% if message.tags == 'error' %}bg-red-50 text-red-700 border border-red-200{% else %}bg-green-50 text-green-700 border border-green-200{% endif %}">
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}
<form method="post" action="{% url 'inquiries:inquiry_department_response' pk=inquiry.pk %}">
{% csrf_token %}
<div class="space-y-4">
<div>
<label class="block text-sm font-semibold text-slate-700 mb-2">
{% trans "Response (English)" %}
</label>
<textarea name="response_en" rows="5"
class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-slate-700 focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20 resize-none text-sm"
placeholder="{% trans 'Enter your response in English...' %}">{{ inquiry.department_response_en|default:'' }}</textarea>
</div>
<div>
<label class="block text-sm font-semibold text-slate-700 mb-2">
{% trans "Response (Arabic)" %}
</label>
<textarea name="response_ar" rows="5" dir="rtl"
class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-slate-700 focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20 resize-none text-sm"
placeholder="{% trans 'أدخل ردك باللغة العربية...' %}">{{ inquiry.department_response_ar|default:'' }}</textarea>
</div>
<p class="text-xs text-slate-500">
<i data-lucide="info" class="w-3 h-3 inline mr-1"></i>
{% trans "At least one language is required." %}
</p>
</div>
<div class="flex items-center gap-3 mt-6 pt-4 border-t border-slate-100">
<button type="submit"
class="px-6 py-2.5 bg-navy text-white font-semibold rounded-xl hover:bg-blue transition flex items-center gap-2 text-sm">
<i data-lucide="send" class="w-4 h-4"></i>
{% trans "Submit Response" %}
</button>
<a href="{% url 'inquiries:inquiry_detail' pk=inquiry.pk %}"
class="px-6 py-2.5 bg-slate-100 text-slate-700 font-medium rounded-xl hover:bg-slate-200 transition text-sm">
{% trans "Cancel" %}
</a>
</div>
</form>
</div>
{% endblock %}