148 lines
8.6 KiB
HTML
148 lines
8.6 KiB
HTML
{% extends 'layouts/base.html' %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% trans "Action Plans" %} - PX360{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="mb-8">
|
|
<div class="flex justify-between items-center">
|
|
<div>
|
|
<h1 class="text-3xl font-bold text-gray-800 mb-2">{% trans "Action Plans" %}</h1>
|
|
<p class="text-gray-400">{% trans "Manage improvement action plans" %}</p>
|
|
</div>
|
|
<a href="{% url 'actions:action_create' %}" class="bg-light0 text-white px-6 py-3 rounded-2xl font-bold flex items-center gap-2 shadow-lg shadow-blue-200 hover:bg-navy transition">
|
|
<i data-lucide="plus" class="w-5 h-5"></i> {% trans "Create Action Plan" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Filters -->
|
|
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-50 mb-6">
|
|
<form method="get" class="grid grid-cols-1 md:grid-cols-4 gap-4">
|
|
<div class="md:col-span-2">
|
|
<label class="block text-sm font-semibold text-gray-700 mb-2">{% trans "Search" %}</label>
|
|
<input type="text" class="w-full px-4 py-3 border border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-navy focus:border-transparent transition" name="search" placeholder="{% trans 'Search action plans...' %}" value="{{ filters.search }}">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-semibold text-gray-700 mb-2">{% trans "Status" %}</label>
|
|
<select class="w-full px-4 py-3 border border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-navy focus:border-transparent transition" name="status">
|
|
<option value="">{% trans "All Status" %}</option>
|
|
<option value="pending" {% if filters.status == 'pending' %}selected{% endif %}>{% trans "Pending" %}</option>
|
|
<option value="in_progress" {% if filters.status == 'in_progress' %}selected{% endif %}>{% trans "In Progress" %}</option>
|
|
<option value="completed" {% if filters.status == 'completed' %}selected{% endif %}>{% trans "Completed" %}</option>
|
|
<option value="cancelled" {% if filters.status == 'cancelled' %}selected{% endif %}>{% trans "Cancelled" %}</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-semibold text-gray-700 mb-2">{% trans "Priority" %}</label>
|
|
<select class="w-full px-4 py-3 border border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-navy focus:border-transparent transition" name="priority">
|
|
<option value="">{% trans "All Priorities" %}</option>
|
|
<option value="high" {% if filters.priority == 'high' %}selected{% endif %}>{% trans "High" %}</option>
|
|
<option value="medium" {% if filters.priority == 'medium' %}selected{% endif %}>{% trans "Medium" %}</option>
|
|
<option value="low" {% if filters.priority == 'low' %}selected{% endif %}>{% trans "Low" %}</option>
|
|
</select>
|
|
</div>
|
|
<div class="md:col-span-2 flex items-end">
|
|
<div class="flex gap-2 w-full">
|
|
<button type="submit" class="flex-1 bg-light0 text-white px-4 py-3 rounded-xl font-semibold hover:bg-navy transition flex items-center justify-center gap-2">
|
|
<i data-lucide="search" class="w-4 h-4"></i> {% trans "Filter" %}
|
|
</button>
|
|
<a href="{% url 'actions:action_list' %}" class="bg-gray-100 text-gray-600 px-4 py-3 rounded-xl font-semibold hover:bg-gray-200 transition flex items-center justify-center gap-2">
|
|
<i data-lucide="x-circle" class="w-4 h-4"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Action Plans Grid -->
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
{% for action in actions %}
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-50 overflow-hidden hover:shadow-md transition">
|
|
<div class="p-6">
|
|
<div class="flex justify-between items-start mb-4">
|
|
<div class="flex gap-2">
|
|
{% if action.priority == 'high' %}
|
|
<span class="px-2.5 py-1 rounded-lg text-xs font-bold bg-red-100 text-red-600">{% trans "High" %}</span>
|
|
{% elif action.priority == 'medium' %}
|
|
<span class="px-2.5 py-1 rounded-lg text-xs font-bold bg-orange-100 text-orange-600">{% trans "Medium" %}</span>
|
|
{% else %}
|
|
<span class="px-2.5 py-1 rounded-lg text-xs font-bold bg-green-100 text-green-600">{% trans "Low" %}</span>
|
|
{% endif %}
|
|
|
|
{% if action.status == 'completed' %}
|
|
<span class="px-2.5 py-1 rounded-lg text-xs font-bold bg-green-100 text-green-600">{% trans "Completed" %}</span>
|
|
{% elif action.status == 'in_progress' %}
|
|
<span class="px-2.5 py-1 rounded-lg text-xs font-bold bg-blue-100 text-blue-600">{% trans "In Progress" %}</span>
|
|
{% elif action.status == 'cancelled' %}
|
|
<span class="px-2.5 py-1 rounded-lg text-xs font-bold bg-gray-100 text-gray-600">{% trans "Cancelled" %}</span>
|
|
{% else %}
|
|
<span class="px-2.5 py-1 rounded-lg text-xs font-bold bg-yellow-100 text-yellow-600">{% trans "Pending" %}</span>
|
|
{% endif %}
|
|
</div>
|
|
<span class="text-xs text-gray-400">{{ action.created_at|date:"M d, Y" }}</span>
|
|
</div>
|
|
|
|
<h3 class="font-bold text-gray-800 mb-2">{{ action.title }}</h3>
|
|
<p class="text-gray-500 text-sm mb-4 line-clamp-2">{{ action.description|truncatewords:20 }}</p>
|
|
|
|
<div class="space-y-2 text-sm">
|
|
{% if action.due_date %}
|
|
<div class="flex items-center gap-2 text-gray-600">
|
|
<i data-lucide="calendar" class="w-4 h-4"></i>
|
|
<span>{% trans "Due:" %} {{ action.due_date|date:"M d, Y" }}</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if action.assigned_to %}
|
|
<div class="flex items-center gap-2 text-gray-600">
|
|
<i data-lucide="user" class="w-4 h-4"></i>
|
|
<span>{{ action.assigned_to.get_full_name|default:action.assigned_to.username }}</span>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="px-6 py-4 bg-gray-50 border-t border-gray-100 flex justify-between items-center">
|
|
<a href="{% url 'actions:action_detail' action.id %}" class="text-navy text-sm font-bold hover:underline flex items-center gap-1">
|
|
{% trans "View Details" %} <i data-lucide="arrow-right" class="w-4 h-4"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% empty %}
|
|
<div class="col-span-full">
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-50 p-12 text-center">
|
|
<i data-lucide="check-square" class="w-16 h-16 mx-auto mb-4 text-gray-300"></i>
|
|
<h3 class="text-xl font-bold text-gray-800 mb-2">{% trans "No Action Plans Found" %}</h3>
|
|
<p class="text-gray-500 mb-6">{% trans "Get started by creating your first action plan" %}</p>
|
|
<a href="{% url 'actions:action_create' %}" class="inline-flex items-center gap-2 bg-light0 text-white px-6 py-3 rounded-2xl font-bold shadow-lg shadow-blue-200 hover:bg-navy transition">
|
|
<i data-lucide="plus" class="w-5 h-5"></i> {% trans "Create Action Plan" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
{% if page_obj.has_other_pages %}
|
|
<div class="mt-6 flex justify-center">
|
|
<div class="flex gap-2">
|
|
{% if page_obj.has_previous %}
|
|
<a href="?page={{ page_obj.previous_page_number }}&{{ filters|urlencode }}" class="px-4 py-2 border border-gray-200 rounded-xl text-sm font-semibold hover:bg-gray-50 transition">
|
|
<i data-lucide="chevron-left" class="w-4 h-4"></i> {% trans "Previous" %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
<span class="px-4 py-2 bg-light0 text-white rounded-xl text-sm font-bold">
|
|
{% blocktrans with current=page_obj.number total=page_obj.paginator.num_pages %}Page {{ current }} of {{ total }}{% endblocktrans %}
|
|
</span>
|
|
|
|
{% if page_obj.has_next %}
|
|
<a href="?page={{ page_obj.next_page_number }}&{{ filters|urlencode }}" class="px-4 py-2 border border-gray-200 rounded-xl text-sm font-semibold hover:bg-gray-50 transition">
|
|
{% trans "Next" %} <i data-lucide="chevron-right" class="w-4 h-4"></i>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %} |