HH/templates/projects/focus_phase_detail.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

246 lines
14 KiB
HTML

{% extends "layouts/base.html" %}
{% load i18n %}
{% load hospital_filters %}
{% block title %}{{ phase_label }} - {{ project.name }} - PX360{% endblock %}
{% block extra_css %}
<style>
.status-active { background-color: #e0f2fe; color: #075985; }
.status-pending { background-color: #fef9c3; color: #854d0e; }
.status-completed { background-color: #dcfce7; color: #166534; }
.status-cancelled { background-color: #fee2e2; color: #991b1b; }
.task-status-pending { background-color: #f1f5f9; color: #475569; }
.task-status-in_progress { background-color: #e0f2fe; color: #075985; }
.task-status-completed { background-color: #dcfce7; color: #166534; }
.task-status-blocked { background-color: #fee2e2; color: #991b1b; }
</style>
{% endblock %}
{% block content %}
<!-- Breadcrumb -->
<div class="mb-6">
<a href="{% url 'projects:project_detail' pk=project.pk %}" class="inline-flex items-center gap-2 text-slate hover:text-navy transition">
<i data-lucide="arrow-left" class="w-4 h-4"></i>
<span class="text-sm font-medium">{% trans "Back to Project" %}</span>
</a>
</div>
<!-- Header -->
<header class="mb-6">
<div class="flex justify-between items-start">
<div>
<div class="flex items-center gap-3 mb-2">
<div class="w-12 h-12 rounded-xl flex items-center justify-center
{% if focus_phase.status == 'completed' %}bg-green-200 text-green-700
{% elif focus_phase.status == 'active' %}bg-blue-200 text-blue-700
{% else %}bg-slate-200 text-slate-500{% endif %}">
{% if phase_key == 'find' %}<i data-lucide="search" class="w-6 h-6"></i>
{% elif phase_key == 'organize' %}<i data-lucide="folder" class="w-6 h-6"></i>
{% elif phase_key == 'clarify' %}<i data-lucide="eye" class="w-6 h-6"></i>
{% elif phase_key == 'understand' %}<i data-lucide="brain" class="w-6 h-6"></i>
{% elif phase_key == 'select' %}<i data-lucide="check-circle" class="w-6 h-6"></i>
{% endif %}
</div>
<div>
<h1 class="text-2xl font-bold text-navy">{{ focus_phase.title|default:phase_label }}</h1>
<p class="text-sm text-slate">{{ project.name }}</p>
</div>
</div>
</div>
<div class="flex items-center gap-3">
{% if can_edit %}
<a href="{% url 'projects:focus_phase_edit' pk=project.pk phase=phase_key %}" class="bg-white text-blue border-2 border-blue/30 px-4 py-2 rounded-xl text-sm font-bold hover:bg-blue hover:text-white flex items-center gap-2 transition">
<i data-lucide="pencil" class="w-4 h-4"></i> {% trans "Edit Phase" %}
</a>
<a href="{% url 'projects:focus_phase_task_create' project_pk=project.pk phase=phase_key %}" class="bg-navy text-white px-4 py-2 rounded-xl text-sm font-bold hover:bg-blue flex items-center gap-2 transition">
<i data-lucide="plus" class="w-4 h-4"></i> {% trans "Add Task" %}
</a>
{% endif %}
</div>
</div>
</header>
<div class="grid grid-cols-3 gap-6">
<!-- Main Content -->
<div class="col-span-2 space-y-6">
<!-- Phase Info -->
<div class="bg-white rounded-2xl border shadow-sm overflow-hidden">
<div class="px-6 py-4 border-b">
<h2 class="text-sm font-bold text-navy flex items-center gap-2">
<i data-lucide="info" class="w-4 h-4"></i>
{% trans "Phase Information" %}
</h2>
</div>
<div class="p-6 space-y-4">
<div class="grid grid-cols-3 gap-4">
<div>
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Status" %}</p>
<span class="status-{{ focus_phase.status }} px-2.5 py-1 rounded-full text-[10px] font-bold uppercase">
{{ focus_phase.get_status_display }}
</span>
</div>
<div>
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Owner" %}</p>
<p class="text-sm text-navy font-medium">{{ focus_phase.owner.get_full_name|default:"—" }}</p>
</div>
<div>
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Dates" %}</p>
<p class="text-sm text-navy font-medium">
{% if focus_phase.start_date %}{{ focus_phase.start_date|date:"M d, Y" }}{% else %}—{% endif %}
<span class="text-slate"></span>
{% if focus_phase.due_date %}{{ focus_phase.due_date|date:"M d, Y" }}{% else %}—{% endif %}
</p>
</div>
</div>
{% if focus_phase.description %}
<div>
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Description" %}</p>
<p class="text-sm text-slate">{{ focus_phase.description|linebreaksbr }}</p>
</div>
{% endif %}
{% if focus_phase.findings %}
<div>
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Findings" %}</p>
<p class="text-sm text-slate">{{ focus_phase.findings|linebreaksbr }}</p>
</div>
{% endif %}
</div>
</div>
<!-- Tasks Section -->
<div class="bg-white rounded-2xl border shadow-sm overflow-hidden">
<div class="px-6 py-4 border-b flex justify-between items-center">
<h2 class="text-sm font-bold text-navy flex items-center gap-2">
<i data-lucide="check-square" class="w-4 h-4"></i>
{% trans "Phase Tasks" %}
<span class="ml-2 bg-slate-200 text-slate px-2 py-0.5 rounded-full text-[10px]">{{ tasks.count }}</span>
</h2>
{% if can_edit %}
<a href="{% url 'projects:focus_phase_task_create' project_pk=project.pk phase=phase_key %}" class="bg-navy text-white px-3 py-1.5 rounded-lg text-xs font-bold flex items-center gap-1 hover:bg-blue transition">
<i data-lucide="plus" class="w-3 h-3"></i> {% trans "Add Task" %}
</a>
{% endif %}
</div>
{% if tasks %}
<div class="divide-y divide-slate-100">
{% for task in tasks %}
<div class="px-6 py-4 hover:bg-slate-50 transition-colors">
<div class="flex justify-between items-start">
<div class="flex-grow">
<div class="flex items-center gap-3 mb-1">
<form method="post" action="{% url 'projects:focus_phase_task_toggle_status' project_pk=project.pk phase=phase_key task_pk=task.pk %}" class="inline">
{% csrf_token %}
<button type="submit" class="p-0 bg-transparent border-none cursor-pointer">
{% if task.status == 'completed' %}
<i data-lucide="check-square" class="w-5 h-5 text-green-600"></i>
{% else %}
<i data-lucide="square" class="w-5 h-5 text-slate-300"></i>
{% endif %}
</button>
</form>
<h3 class="font-semibold text-navy {% if task.status == 'completed' %}line-through text-slate{% endif %}">
{{ task.title }}
</h3>
</div>
{% if task.description %}
<p class="text-xs text-slate ml-8 mb-2">{{ task.description }}</p>
{% endif %}
<div class="flex items-center gap-4 ml-8 text-xs text-slate">
{% if task.assigned_to %}
<span class="flex items-center gap-1">
<i data-lucide="user" class="w-3 h-3"></i>
{{ task.assigned_to.get_full_name }}
</span>
{% endif %}
{% if task.due_date %}
<span class="flex items-center gap-1">
<i data-lucide="calendar" class="w-3 h-3"></i>
{% if task.due_date < today and task.status != 'completed' %}
<span class="text-red-600 font-semibold">{{ task.due_date|date:"M d, Y" }}</span>
{% else %}
{{ task.due_date|date:"M d, Y" }}
{% endif %}
</span>
{% endif %}
<span class="task-status-{{ task.status }} px-2 py-0.5 rounded-full text-[10px] font-bold uppercase">
{{ task.get_status_display }}
</span>
</div>
</div>
{% if can_edit %}
<div class="flex items-center gap-1 ml-4">
<a href="{% url 'projects:focus_phase_task_edit' project_pk=project.pk phase=phase_key task_pk=task.pk %}"
class="p-2 text-blue hover:bg-blue/10 rounded-lg transition" title="{% trans 'Edit' %}">
<i data-lucide="pencil" class="w-4 h-4"></i>
</a>
<a href="{% url 'projects:focus_phase_task_delete' project_pk=project.pk phase=phase_key task_pk=task.pk %}"
class="p-2 text-red-600 hover:bg-red-50 rounded-lg transition" title="{% trans 'Delete' %}">
<i data-lucide="trash-2" class="w-4 h-4"></i>
</a>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="px-6 py-12 text-center">
<i data-lucide="check-square" class="w-12 h-12 mx-auto text-slate-300 mb-3"></i>
<p class="text-slate mb-3">{% trans "No tasks in this phase yet" %}</p>
{% if can_edit %}
<a href="{% url 'projects:focus_phase_task_create' project_pk=project.pk phase=phase_key %}" class="bg-navy text-white px-4 py-2 rounded-xl text-sm font-bold inline-flex items-center gap-2 hover:bg-blue transition">
<i data-lucide="plus" class="w-4 h-4"></i> {% trans "Add First Task" %}
</a>
{% endif %}
</div>
{% endif %}
</div>
</div>
<!-- Sidebar: FOCUS Phase Navigation -->
<div class="col-span-1">
<div class="bg-white rounded-2xl border shadow-sm overflow-hidden mb-6">
<div class="px-6 py-4 border-b">
<h2 class="text-sm font-bold text-navy flex items-center gap-2">
<i data-lucide="target" class="w-4 h-4"></i>
{% trans "FOCUS Methodology" %}
</h2>
</div>
<div class="p-2">
{% for ph_key, ph_label in focus_phase_choices %}
<a href="{% url 'projects:focus_phase_detail' pk=project.pk phase=ph_key %}"
class="flex items-center gap-3 px-4 py-3 rounded-xl transition
{% if ph_key == phase_key %}bg-navy text-white{% else %}text-slate hover:bg-slate-50{% endif %}">
<div class="w-8 h-8 rounded-lg flex items-center justify-center text-sm
{% if ph_key == phase_key %}bg-white/20{% else %}
{% if ph_key == 'find' %}bg-amber-100 text-amber-700
{% elif ph_key == 'organize' %}bg-blue-100 text-blue-700
{% elif ph_key == 'clarify' %}bg-purple-100 text-purple-700
{% elif ph_key == 'understand' %}bg-cyan-100 text-cyan-700
{% elif ph_key == 'select' %}bg-green-100 text-green-700{% endif %}
{% endif %}">
{% if ph_key == 'find' %}<i data-lucide="search" class="w-4 h-4"></i>
{% elif ph_key == 'organize' %}<i data-lucide="folder" class="w-4 h-4"></i>
{% elif ph_key == 'clarify' %}<i data-lucide="eye" class="w-4 h-4"></i>
{% elif ph_key == 'understand' %}<i data-lucide="brain" class="w-4 h-4"></i>
{% elif ph_key == 'select' %}<i data-lucide="check-circle" class="w-4 h-4"></i>
{% endif %}
</div>
<span class="text-sm font-medium">{{ ph_label }}</span>
{% if ph_key != phase_key %}
<span class="ml-auto text-[10px] bg-slate-200 text-slate px-1.5 py-0.5 rounded-full">
{{ phase_task_counts|key:ph_key|default:0 }}
</span>
{% endif %}
</a>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %}