160 lines
9.7 KiB
HTML
160 lines
9.7 KiB
HTML
{% extends "layouts/base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% trans "Acknowledgement Checklist Items" %} - PX360{% 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-col md:flex-row justify-between items-start md:items-center gap-4 mb-8">
|
|
<div class="flex items-center gap-3">
|
|
<div class="flex items-center justify-center w-14 h-14 bg-gradient-to-br from-purple-500 to-indigo-500 rounded-2xl shadow-lg shadow-purple-200">
|
|
<i data-lucide="check-square" class="w-8 h-8 text-white"></i>
|
|
</div>
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-navy">
|
|
{% trans "Checklist Items" %}
|
|
</h1>
|
|
<p class="text-slate text-sm">
|
|
{% trans "Manage acknowledgement checklist items" %}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="flex gap-3">
|
|
<a href="{% url 'accounts:acknowledgements:ack_dashboard' %}" class="inline-flex items-center gap-2 px-5 py-2.5 bg-white border-2 border-slate-200 text-slate-700 rounded-xl font-semibold hover:bg-slate-50 transition">
|
|
<i data-lucide="arrow-left" class="w-4 h-4"></i>
|
|
{% trans "Back" %}
|
|
</a>
|
|
<a href="{% url 'accounts:acknowledgements:ack_checklist_create' %}" class="inline-flex items-center gap-2 px-5 py-2.5 bg-gradient-to-r from-purple-500 to-indigo-500 text-white rounded-xl font-semibold hover:from-indigo-500 hover:to-purple-500 transition shadow-lg shadow-purple-200">
|
|
<i data-lucide="plus" class="w-4 h-4"></i>
|
|
{% trans "New Item" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Filter Section -->
|
|
<div class="bg-white rounded-2xl shadow-sm border border-slate-100 p-4 mb-6">
|
|
<form method="get" class="flex flex-wrap gap-4 items-end">
|
|
<div>
|
|
<label class="block text-xs font-semibold text-slate mb-1">{% trans "Category" %}</label>
|
|
<select name="category" class="px-4 py-2 border border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-blue focus:border-blue">
|
|
<option value="">{% trans "All Categories" %}</option>
|
|
{% for cat in categories %}
|
|
<option value="{{ cat.id }}" {% if request.GET.category == cat.id|stringformat:"s" %}selected{% endif %}>{{ cat.name_en }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-semibold text-slate mb-1">{% trans "Status" %}</label>
|
|
<select name="is_active" class="px-4 py-2 border border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-blue focus:border-blue">
|
|
<option value="">{% trans "All" %}</option>
|
|
<option value="true" {% if request.GET.is_active == "true" %}selected{% endif %}>{% trans "Active" %}</option>
|
|
<option value="false" {% if request.GET.is_active == "false" %}selected{% endif %}>{% trans "Inactive" %}</option>
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="px-4 py-2 bg-blue text-white rounded-xl text-sm font-semibold hover:bg-navy transition">
|
|
<i data-lucide="filter" class="w-4 h-4 inline mr-1"></i>
|
|
{% trans "Filter" %}
|
|
</button>
|
|
<a href="{% url 'accounts:acknowledgements:ack_checklist_list' %}" class="px-4 py-2 text-slate hover:text-navy text-sm">
|
|
{% trans "Clear" %}
|
|
</a>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Checklist Items List -->
|
|
<div class="bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden">
|
|
<div class="px-6 py-5 border-b border-slate-100 bg-gradient-to-r from-purple-50 to-transparent">
|
|
<h2 class="text-lg font-bold text-navy flex items-center gap-2">
|
|
<i data-lucide="list" class="w-5 h-5 text-purple-500"></i>
|
|
{% trans "All Checklist Items" %}
|
|
<span class="ml-2 px-2 py-0.5 bg-slate-100 text-slate text-sm rounded-full">{{ items.count }}</span>
|
|
</h2>
|
|
</div>
|
|
<div class="p-6">
|
|
{% if items %}
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full">
|
|
<thead>
|
|
<tr class="border-b border-slate-200">
|
|
<th class="text-left py-3 px-4 text-xs font-semibold text-slate uppercase">{% trans "Item" %}</th>
|
|
<th class="text-left py-3 px-4 text-xs font-semibold text-slate uppercase">{% trans "Category" %}</th>
|
|
<th class="text-left py-3 px-4 text-xs font-semibold text-slate uppercase">{% trans "Code" %}</th>
|
|
<th class="text-left py-3 px-4 text-xs font-semibold text-slate uppercase">{% trans "Requires Signature" %}</th>
|
|
<th class="text-left py-3 px-4 text-xs font-semibold text-slate uppercase">{% trans "Status" %}</th>
|
|
<th class="text-right py-3 px-4 text-xs font-semibold text-slate uppercase">{% trans "Actions" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in items %}
|
|
<tr class="border-b border-slate-100 hover:bg-slate-50 transition">
|
|
<td class="py-4 px-4">
|
|
<div>
|
|
<p class="font-semibold text-navy">{{ item.text_en }}</p>
|
|
{% if item.text_ar %}
|
|
<p class="text-sm text-slate">{{ item.text_ar }}</p>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
<td class="py-4 px-4">
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-semibold" style="background-color: {{ item.category.color }}20; color: {{ item.category.color }}">
|
|
{{ item.category.name_en }}
|
|
</span>
|
|
</td>
|
|
<td class="py-4 px-4">
|
|
<span class="inline-flex items-center px-2 py-1 bg-slate-100 text-slate-700 rounded-lg text-xs font-mono">
|
|
{{ item.code|default:"-" }}
|
|
</span>
|
|
</td>
|
|
<td class="py-4 px-4">
|
|
{% if item.requires_signature %}
|
|
<span class="inline-flex items-center gap-1 px-2 py-1 bg-blue-100 text-blue-700 rounded-lg text-xs font-semibold">
|
|
<i data-lucide="pen-tool" class="w-3 h-3"></i>
|
|
{% trans "Yes" %}
|
|
</span>
|
|
{% else %}
|
|
<span class="inline-flex items-center px-2 py-1 bg-slate-100 text-slate-500 rounded-lg text-xs">
|
|
{% trans "No" %}
|
|
</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="py-4 px-4">
|
|
<span class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold {% if item.is_active %}bg-emerald-100 text-emerald-700{% else %}bg-red-100 text-red-700{% endif %}">
|
|
<i data-lucide="{% if item.is_active %}check-circle{% else %}x-circle{% endif %}" class="w-3.5 h-3.5"></i>
|
|
{% if item.is_active %}{% trans "Active" %}{% else %}{% trans "Inactive" %}{% endif %}
|
|
</span>
|
|
</td>
|
|
<td class="py-4 px-4 text-right">
|
|
<a href="{% url 'accounts:acknowledgements:ack_checklist_edit' item.id %}" class="inline-flex items-center gap-1 px-3 py-1.5 bg-purple-50 text-purple-700 rounded-lg text-sm font-semibold hover:bg-purple-100 transition">
|
|
<i data-lucide="edit-2" class="w-4 h-4"></i>
|
|
{% trans "Edit" %}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="text-center py-16">
|
|
<div class="w-20 h-20 bg-gradient-to-br from-purple-100 to-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
|
<i data-lucide="check-square" class="w-10 h-10 text-purple-500"></i>
|
|
</div>
|
|
<h3 class="text-lg font-bold text-navy mb-2">{% trans "No Checklist Items" %}</h3>
|
|
<p class="text-slate mb-6">{% trans "Create your first acknowledgement checklist item to get started." %}</p>
|
|
<a href="{% url 'accounts:acknowledgements:ack_checklist_create' %}" class="inline-flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-purple-500 to-indigo-500 text-white rounded-xl font-semibold hover:from-indigo-500 hover:to-purple-500 transition shadow-lg shadow-purple-200">
|
|
<i data-lucide="plus" class="w-5 h-5"></i>
|
|
{% trans "Create Item" %}
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
lucide.createIcons();
|
|
});
|
|
</script>
|
|
{% endblock %} |