231 lines
12 KiB
HTML
231 lines
12 KiB
HTML
{% extends "layouts/base.html" %}
|
|
{% load i18n %}
|
|
{% load hospital_filters %}
|
|
|
|
{% block title %}{{ 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 %}
|
|
<!-- Back Button -->
|
|
<div class="mb-6">
|
|
<a href="{% url 'projects:project_list' %}" 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 Projects" %}</span>
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Header -->
|
|
<header class="mb-6">
|
|
<div class="flex justify-between items-start">
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-navy">{{ project.name }}</h1>
|
|
{% if project.description %}
|
|
<p class="text-sm text-slate mt-1 max-w-2xl">{{ project.description|linebreaksbr }}</p>
|
|
{% endif %}
|
|
</div>
|
|
<div class="flex items-center gap-3">
|
|
{% if can_edit %}
|
|
<a href="{% url 'projects:project_edit' pk=project.pk %}" 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" %}
|
|
</a>
|
|
{% endif %}
|
|
{% if user.is_px_admin or user.is_hospital_admin %}
|
|
<a href="{% url 'projects:project_export_excel' pk=project.pk %}" class="bg-white text-green-600 border-2 border-green-200 px-4 py-2 rounded-xl text-sm font-bold hover:bg-green-600 hover:text-white flex items-center gap-2 transition">
|
|
<i data-lucide="file-spreadsheet" class="w-4 h-4"></i> {% trans "Export Excel" %}
|
|
</a>
|
|
<a href="{% url 'projects:project_save_as_template' pk=project.pk %}" class="bg-white text-purple-600 border-2 border-purple-200 px-4 py-2 rounded-xl text-sm font-bold hover:bg-purple-600 hover:text-white flex items-center gap-2 transition">
|
|
<i data-lucide="copy" class="w-4 h-4"></i> {% trans "Save as Template" %}
|
|
</a>
|
|
<a href="{% url 'projects:project_delete' pk=project.pk %}" class="bg-white text-red-600 border-2 border-red-200 px-4 py-2 rounded-xl text-sm font-bold hover:bg-red-600 hover:text-white flex items-center gap-2 transition">
|
|
<i data-lucide="trash-2" class="w-4 h-4"></i> {% trans "Delete" %}
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="grid grid-cols-3 gap-6">
|
|
<!-- Main Content -->
|
|
<div class="col-span-2">
|
|
<!-- PDCA Cycle Section -->
|
|
<div class="bg-white rounded-2xl border shadow-sm overflow-hidden mb-6">
|
|
<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="refresh-cw" class="w-4 h-4"></i>
|
|
{% trans "PDCA Cycle" %}
|
|
</h2>
|
|
<span class="text-xs text-slate">{% trans "Click a phase to view tasks and details" %}</span>
|
|
</div>
|
|
<div class="p-6">
|
|
<div class="grid grid-cols-4 gap-4">
|
|
{% for phase_key, phase_label in pdca_phase_choices %}
|
|
{% with phase_obj=pdca_phases|key:phase_key %}
|
|
<a href="{% url 'projects:pdca_phase_detail' pk=project.pk phase=phase_key %}"
|
|
class="block rounded-2xl border-2 p-4 text-center transition hover:shadow-md relative
|
|
{% if phase_obj %}
|
|
{% if phase_obj.status == 'completed' %}border-green-300 bg-green-50 hover:border-green-400
|
|
{% elif phase_obj.status == 'active' %}border-blue-300 bg-blue-50 hover:border-blue-400
|
|
{% else %}border-slate-200 bg-slate-50 hover:border-slate-300{% endif %}
|
|
{% else %}border-dashed border-slate-300 bg-slate-50 hover:border-navy hover:bg-navy/5{% endif %}">
|
|
{% if phase_obj %}
|
|
<span class="absolute -top-2 -right-2 bg-navy text-white text-[10px] font-bold w-5 h-5 rounded-full flex items-center justify-center">
|
|
{{ phase_obj.tasks.count }}
|
|
</span>
|
|
{% endif %}
|
|
<div class="w-12 h-12 mx-auto rounded-xl flex items-center justify-center mb-3
|
|
{% if phase_obj %}
|
|
{% if phase_obj.status == 'completed' %}bg-green-200 text-green-700
|
|
{% elif phase_obj.status == 'active' %}bg-blue-200 text-blue-700
|
|
{% else %}bg-slate-200 text-slate-500{% endif %}
|
|
{% else %}bg-slate-100 text-slate-400{% endif %}">
|
|
{% if phase_key == 'plan' %}<i data-lucide="lightbulb" class="w-6 h-6"></i>
|
|
{% elif phase_key == 'do' %}<i data-lucide="play" class="w-6 h-6"></i>
|
|
{% elif phase_key == 'check' %}<i data-lucide="search" class="w-6 h-6"></i>
|
|
{% elif phase_key == 'act' %}<i data-lucide="rocket" class="w-6 h-6"></i>
|
|
{% endif %}
|
|
</div>
|
|
<h3 class="font-bold text-navy text-sm mb-1">{{ phase_label }}</h3>
|
|
{% if phase_obj %}
|
|
<span class="inline-block px-2 py-0.5 rounded-full text-[10px] font-bold uppercase
|
|
{% if phase_obj.status == 'completed' %}bg-green-200 text-green-700
|
|
{% elif phase_obj.status == 'active' %}bg-blue-200 text-blue-700
|
|
{% else %}bg-slate-200 text-slate-500{% endif %}">
|
|
{{ phase_obj.get_status_display }}
|
|
</span>
|
|
{% if phase_obj.owner %}
|
|
<p class="text-[10px] text-slate mt-1">{{ phase_obj.owner.get_full_name }}</p>
|
|
{% endif %}
|
|
{% else %}
|
|
<span class="text-[10px] text-slate-400">{% trans "Click to setup" %}</span>
|
|
{% endif %}
|
|
</a>
|
|
{% endwith %}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Outcome Section -->
|
|
{% if project.outcome_description %}
|
|
<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="trophy" class="w-4 h-4"></i>
|
|
{% trans "Outcomes" %}
|
|
</h2>
|
|
</div>
|
|
<div class="px-6 py-4">
|
|
<p class="text-sm text-slate">{{ project.outcome_description|linebreaksbr }}</p>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Sidebar -->
|
|
<div class="col-span-1">
|
|
<!-- Project Info -->
|
|
<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="info" class="w-4 h-4"></i>
|
|
{% trans "Project Info" %}
|
|
</h2>
|
|
</div>
|
|
<div class="px-6 py-4 space-y-4">
|
|
<div>
|
|
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Status" %}</p>
|
|
<span class="status-{{ project.status }} px-2.5 py-1 rounded-full text-[10px] font-bold uppercase">
|
|
{{ project.get_status_display }}
|
|
</span>
|
|
</div>
|
|
<div>
|
|
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Hospital" %}</p>
|
|
<p class="text-sm text-navy font-medium">{{ project.hospital.name }}</p>
|
|
</div>
|
|
{% if project.department %}
|
|
<div>
|
|
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Department" %}</p>
|
|
<p class="text-sm text-navy font-medium">{{ project.department.name }}</p>
|
|
</div>
|
|
{% endif %}
|
|
{% if project.project_lead %}
|
|
<div>
|
|
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Project Lead" %}</p>
|
|
<p class="text-sm text-navy font-medium">{{ project.project_lead.get_full_name }}</p>
|
|
</div>
|
|
{% endif %}
|
|
{% if project.start_date %}
|
|
<div>
|
|
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Start Date" %}</p>
|
|
<p class="text-sm text-navy font-medium">{{ project.start_date|date:"M d, Y" }}</p>
|
|
</div>
|
|
{% endif %}
|
|
{% if project.target_completion_date %}
|
|
<div>
|
|
<p class="text-[10px] font-bold text-slate uppercase tracking-wider mb-1">{% trans "Target Date" %}</p>
|
|
<p class="text-sm text-navy font-medium">{{ project.target_completion_date|date:"M d, Y" }}</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Team Members -->
|
|
{% if project.team_members.count > 0 %}
|
|
<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="users" class="w-4 h-4"></i>
|
|
{% trans "Team Members" %}
|
|
</h2>
|
|
</div>
|
|
<div class="px-6 py-4">
|
|
<ul class="space-y-2">
|
|
{% for member in project.team_members.all %}
|
|
<li class="flex items-center gap-2 text-sm text-slate">
|
|
<i data-lucide="user" class="w-3 h-3"></i>
|
|
{{ member.get_full_name }}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Related Actions -->
|
|
{% if related_actions.count > 0 %}
|
|
<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="zap" class="w-4 h-4"></i>
|
|
{% trans "Related Actions" %}
|
|
</h2>
|
|
</div>
|
|
<div class="px-6 py-4">
|
|
<ul class="space-y-2">
|
|
{% for action in related_actions %}
|
|
<li>
|
|
<a href="{% url 'actions:action_detail' pk=action.pk %}" class="flex items-center gap-2 text-sm text-slate hover:text-navy transition">
|
|
<i data-lucide="zap" class="w-3 h-3 text-yellow-500"></i>
|
|
{{ action.title|truncatechars:30 }}
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %} |