HH/templates/complaints/inquiry_department_response.html
ismail c5f76b3855
Some checks are pending
Build and Push Docker Image / build (push) Waiting to run
updates
2026-05-11 14:45:30 +03:00

114 lines
6.7 KiB
HTML

{% extends "layouts/base.html" %}
{% load i18n %}
{% block title %}{% trans "Department Response" %} - {{ inquiry.reference_number }} - PX360{% endblock %}
{% block content %}
<div class="max-w-3xl mx-auto px-4 py-6">
<div class="mb-6">
<a href="{% url 'inquiries:inquiry_detail' pk=inquiry.pk %}" class="inline-flex items-center gap-2 px-4 py-2 border border-slate-200 rounded-xl text-slate-600 hover:bg-slate-50 transition text-sm font-semibold">
<i data-lucide="arrow-left" class="w-4 h-4"></i> {% trans "Back to Inquiry" %}
</a>
</div>
<div class="bg-navy rounded-2xl p-6 text-white mb-6">
<h1 class="text-2xl font-bold mb-2">{% trans "Submit Department Response" %}</h1>
{% if not request.user.is_department_respondent %}
<p class="text-white/80 text-sm">{{ inquiry.reference_number }} - {{ inquiry.subject }}</p>
{% endif %}
</div>
<div class="bg-white rounded-2xl border border-slate-200 shadow-sm p-6 mb-6">
<h3 class="font-bold text-navy mb-3">{% trans "Original Inquiry" %}</h3>
<p class="text-slate-700 text-sm leading-relaxed">{{ inquiry.message|linebreaks }}</p>
{% if not request.user.is_department_respondent and inquiry.category %}
<div class="mt-3">
<span class="px-2.5 py-1 rounded-full text-[10px] font-bold uppercase bg-slate-100 text-slate-600">{{ inquiry.get_category_display }}</span>
</div>
{% endif %}
</div>
{% if not request.user.is_department_respondent %}
{% if inquiry.department_response_en or inquiry.department_response_ar %}
<div class="bg-green-50 border border-green-200 rounded-2xl p-6 mb-6">
<h3 class="font-bold text-green-800 mb-3 flex items-center gap-2">
<i data-lucide="check-circle" class="w-5 h-5"></i> {% trans "Existing Department Response" %}
</h3>
{% if inquiry.department_response_en %}
<p class="text-sm text-slate-700 mb-2">{{ inquiry.department_response_en|linebreaks }}</p>
{% endif %}
{% if inquiry.department_response_ar %}
<p class="text-sm text-slate-700" dir="rtl">{{ inquiry.department_response_ar|linebreaks }}</p>
{% endif %}
<p class="text-xs text-green-600 mt-2">{% trans "Submitted by" %} {{ inquiry.department_responded_by.get_full_name|default:"-" }} {% trans "on" %} {{ inquiry.department_responded_at|date:"Y-m-d H:i"|default:"-" }}</p>
</div>
{% endif %}
{% endif %}
{% if not request.user.is_department_respondent %}
{% if inquiry.short_description_en or inquiry.short_description_ar or inquiry.ai_brief_en or inquiry.ai_brief_ar %}
<div class="bg-light/50 border border-slate-200 rounded-2xl p-6 mb-6">
<div class="flex items-center justify-between mb-3">
<h3 class="font-bold text-navy flex items-center gap-2">
<i data-lucide="sparkles" class="w-4 h-4"></i> {% trans "AI Summary" %}
</h3>
<span class="px-2 py-0.5 bg-light rounded-md text-[10px] font-bold text-navy uppercase">
{% trans "Editable" %}
</span>
</div>
{% if inquiry.short_description_en or inquiry.ai_brief_en %}
<div class="mb-3">
<p class="text-xs font-bold text-slate uppercase tracking-wider mb-1">English</p>
<div id="deptAiSummaryEn" class="text-sm text-slate-700 leading-relaxed bg-white border-2 border-slate-200 rounded-xl p-4 focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20" contenteditable="true">{% if inquiry.short_description_en %}{{ inquiry.short_description_en }}{% elif inquiry.ai_brief_en %}{{ inquiry.ai_brief_en }}{% endif %}</div>
</div>
{% endif %}
{% if inquiry.short_description_ar or inquiry.ai_brief_ar %}
<div>
<p class="text-xs font-bold text-slate uppercase tracking-wider mb-1">العربية</p>
<div id="deptAiSummaryAr" class="text-sm text-slate-700 leading-relaxed bg-white border-2 border-slate-200 rounded-xl p-4 focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20" contenteditable="true" dir="rtl">{% if inquiry.short_description_ar %}{{ inquiry.short_description_ar }}{% elif inquiry.ai_brief_ar %}{{ inquiry.ai_brief_ar }}{% endif %}</div>
</div>
{% endif %}
<p class="text-xs text-slate mt-2">{% trans "This AI-generated summary provides context. You can use it as a reference when writing your response." %}</p>
</div>
{% endif %}
{% endif %}
<form method="post">
{% csrf_token %}
<div class="bg-white rounded-2xl border border-slate-200 shadow-sm p-6">
<h3 class="font-bold text-navy mb-4 flex items-center gap-2">
<i data-lucide="message-square" class="w-5 h-5"></i> {% trans "Your Response" %}
</h3>
<div class="mb-4">
<label class="block text-sm font-semibold text-navy mb-2">{% trans "Response (English)" %}</label>
<textarea name="response_en" rows="6"
class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl 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 class="mb-4">
<label class="block text-sm font-semibold text-navy mb-2">{% trans "Response (Arabic)" %}</label>
<textarea name="response_ar" rows="6" dir="rtl"
class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl 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 mb-4">
<i data-lucide="info" class="w-3 h-3 inline mr-1"></i>
{% trans "At least one language is required. This response will be recorded as the department's official response." %}
</p>
<div class="flex gap-3">
<button type="submit" class="flex-1 px-6 py-3 bg-navy text-white rounded-xl font-semibold hover:bg-blue transition flex items-center justify-center gap-2">
<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-3 border border-slate-200 rounded-xl font-semibold text-slate hover:bg-slate-50 transition">
{% trans "Cancel" %}
</a>
</div>
</div>
</form>
</div>
{% endblock %}