158 lines
8.4 KiB
HTML
158 lines
8.4 KiB
HTML
{% extends 'layouts/base.html' %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{{ title }} - PX360{% endblock %}
|
|
|
|
{% block extra_css %}
|
|
<style>
|
|
.form-select {
|
|
@apply w-full px-4 py-3 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-navy focus:border-transparent transition bg-white text-sm;
|
|
}
|
|
.form-textarea {
|
|
@apply w-full px-4 py-3 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-navy focus:border-transparent transition resize-none text-sm;
|
|
}
|
|
.form-checkbox {
|
|
@apply w-5 h-5 text-navy border-slate-300 rounded focus:ring-navy;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<!-- Back Button -->
|
|
<div class="mb-6">
|
|
<a href="{% url 'complaints:complaint_detail' pk=complaint.pk %}" class="inline-flex items-center gap-2 px-4 py-2 border border-slate-200 rounded-xl text-slate hover:bg-light transition text-sm font-semibold">
|
|
<i data-lucide="arrow-left" class="w-4 h-4"></i> {% trans "Back to Complaint" %}
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Header -->
|
|
<div class="mb-6">
|
|
<h1 class="text-2xl font-bold text-navy">{{ title }}</h1>
|
|
<p class="text-slate mt-1">
|
|
{% trans "Complaint:" %} <span class="font-medium">{{ complaint.reference_number }}</span> - {{ complaint.title|truncatechars:50 }}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Form Card -->
|
|
<div class="bg-white rounded-2xl shadow-sm border border-slate-100 p-8 max-w-3xl">
|
|
<form method="post" class="space-y-6">
|
|
{% csrf_token %}
|
|
|
|
<!-- Department -->
|
|
<div>
|
|
<label for="{{ form.department.id_for_label }}" class="block text-sm font-semibold text-navy mb-2">
|
|
{% trans "Department" %} <span class="text-red-500">*</span>
|
|
</label>
|
|
<select name="{{ form.department.name }}" id="{{ form.department.id_for_label }}" class="w-full px-4 py-3 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-navy focus:border-transparent transition bg-white text-sm" required>
|
|
<option value="">{% trans "Select Department" %}</option>
|
|
{% for choice in form.department.field.choices %}
|
|
<option value="{{ choice.0 }}" {% if form.department.value == choice.0 %}selected{% endif %}>{{ choice.1 }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
{% if form.department.errors %}
|
|
<div class="text-red-500 text-sm mt-2 flex items-center gap-1">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{{ form.department.errors }}
|
|
</div>
|
|
{% endif %}
|
|
<p class="text-slate text-xs mt-2">{% trans "Select the department to involve in this complaint." %}</p>
|
|
</div>
|
|
|
|
<!-- Role -->
|
|
<div>
|
|
<label for="{{ form.role.id_for_label }}" class="block text-sm font-semibold text-navy mb-2">
|
|
{% trans "Role" %} <span class="text-red-500">*</span>
|
|
</label>
|
|
<select name="{{ form.role.name }}" id="{{ form.role.id_for_label }}" class="w-full px-4 py-3 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-navy focus:border-transparent transition bg-white text-sm" required>
|
|
<option value="">{% trans "Select Role" %}</option>
|
|
{% for choice in form.role.field.choices %}
|
|
<option value="{{ choice.0 }}" {% if form.role.value == choice.0 %}selected{% endif %}>{{ choice.1 }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
{% if form.role.errors %}
|
|
<div class="text-red-500 text-sm mt-2 flex items-center gap-1">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{{ form.role.errors }}
|
|
</div>
|
|
{% endif %}
|
|
<div class="mt-3 bg-light/50 rounded-xl p-4 text-sm text-slate space-y-2">
|
|
<p class="flex items-start gap-2">
|
|
<span class="font-semibold text-navy min-w-[80px]">{% trans "Primary:" %}</span>
|
|
<span>{% trans "Main responsible department for resolution" %}</span>
|
|
</p>
|
|
<p class="flex items-start gap-2">
|
|
<span class="font-semibold text-navy min-w-[80px]">{% trans "Secondary:" %}</span>
|
|
<span>{% trans "Assisting the primary department" %}</span>
|
|
</p>
|
|
<p class="flex items-start gap-2">
|
|
<span class="font-semibold text-navy min-w-[80px]">{% trans "Coordination:" %}</span>
|
|
<span>{% trans "Only for coordination purposes" %}</span>
|
|
</p>
|
|
<p class="flex items-start gap-2">
|
|
<span class="font-semibold text-navy min-w-[80px]">{% trans "Investigating:" %}</span>
|
|
<span>{% trans "Leading the investigation" %}</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Is Primary -->
|
|
<div class="flex items-start gap-3 p-4 bg-light/30 rounded-xl border border-slate-100">
|
|
<input type="checkbox" name="{{ form.is_primary.name }}" id="{{ form.is_primary.id_for_label }}" class="w-5 h-5 mt-0.5 text-navy border-slate-300 rounded focus:ring-navy" {% if form.is_primary.value %}checked{% endif %}>
|
|
<div>
|
|
<label for="{{ form.is_primary.id_for_label }}" class="text-sm font-semibold text-navy">
|
|
{% trans "Mark as Primary Department" %}
|
|
</label>
|
|
<p class="text-slate text-xs mt-1">{% trans "The primary department takes lead responsibility for this complaint." %}</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Assigned To -->
|
|
<div>
|
|
<label for="{{ form.assigned_to.id_for_label }}" class="block text-sm font-semibold text-navy mb-2">
|
|
{% trans "Assign To" %} <span class="text-slate font-normal">({% trans "Optional" %})</span>
|
|
</label>
|
|
<select name="{{ form.assigned_to.name }}" id="{{ form.assigned_to.id_for_label }}" class="w-full px-4 py-3 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-navy focus:border-transparent transition bg-white text-sm">
|
|
<option value="">{% trans "Select User (Optional)" %}</option>
|
|
{% for choice in form.assigned_to.field.choices %}
|
|
{% if choice.0 %}
|
|
<option value="{{ choice.0 }}" {% if form.assigned_to.value == choice.0 %}selected{% endif %}>{{ choice.1 }}</option>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</select>
|
|
{% if form.assigned_to.errors %}
|
|
<div class="text-red-500 text-sm mt-2 flex items-center gap-1">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{{ form.assigned_to.errors }}
|
|
</div>
|
|
{% endif %}
|
|
<p class="text-slate text-xs mt-2">{% trans "Optionally assign a specific user from this department." %}</p>
|
|
</div>
|
|
|
|
<!-- Notes -->
|
|
<div>
|
|
<label for="{{ form.notes.id_for_label }}" class="block text-sm font-semibold text-navy mb-2">
|
|
{% trans "Notes" %} <span class="text-slate font-normal">({% trans "Optional" %})</span>
|
|
</label>
|
|
<textarea name="{{ form.notes.name }}" id="{{ form.notes.id_for_label }}" rows="3" class="w-full px-4 py-3 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-navy focus:border-transparent transition resize-none text-sm" placeholder="{% trans 'Enter any additional notes...' %}">{{ form.notes.value|default:'' }}</textarea>
|
|
{% if form.notes.errors %}
|
|
<div class="text-red-500 text-sm mt-2 flex items-center gap-1">
|
|
<i data-lucide="alert-circle" class="w-4 h-4"></i>
|
|
{{ form.notes.errors }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Actions -->
|
|
<div class="flex items-center gap-4 pt-6 border-t border-slate-100">
|
|
<button type="submit" class="bg-gradient-to-r from-navy to-blue text-white px-8 py-3 rounded-xl hover:opacity-90 transition font-semibold flex items-center gap-2 shadow-md">
|
|
<i data-lucide="save" class="w-5 h-5"></i>
|
|
{% trans "Save" %}
|
|
</button>
|
|
<a href="{% url 'complaints:complaint_detail' pk=complaint.pk %}" class="px-8 py-3 border border-slate-200 rounded-xl text-slate hover:bg-light transition font-semibold">
|
|
{% trans "Cancel" %}
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|