Files
project-managment/templates/dashboard/partials/project_timeline.html
T
sankalp 71b700388b feat(templates): add polished login UI with Tailwind and Alpine.js
Enhances user experience with dark‑mode detection, responsive layout, and streamlined role selection workflow
2026-06-28 14:15:39 +05:45

96 lines
6.0 KiB
HTML

<div id="project-timeline-widget" class="rounded-xl bg-white dark:bg-gray-950 shadow-sm ring-1 ring-gray-950/5 dark:ring-white/10 mb-6">
<div class="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4 px-6 py-4 border-b border-gray-100 dark:border-gray-600">
<div>
<h3 class="text-base font-semibold text-gray-900 dark:text-white">Project Timeline</h3>
<p class="text-sm text-gray-500 dark:text-gray-400 mt-0.5">Upcoming milestones and deadlines</p>
</div>
<div class="flex gap-2">
<button hx-get="/dashboard/project-timeline-widget/?filter=pinned" hx-target="#project-timeline-widget" hx-swap="outerHTML"
class="inline-flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg transition-colors
{% if current_filter == 'pinned' %}bg-blue-600 text-white{% else %}bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600{% endif %}">
Pinned
<span class="inline-flex items-center justify-center min-w-[18px] h-4 px-1 rounded-full text-[10px] font-semibold
{% if current_filter == 'pinned' %}bg-blue-500 text-white{% else %}bg-gray-300 dark:bg-gray-600 text-gray-700 dark:text-gray-200{% endif %}">{{ pinned_count }}</span>
</button>
<button hx-get="/dashboard/project-timeline-widget/?filter=all" hx-target="#project-timeline-widget" hx-swap="outerHTML"
class="inline-flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg transition-colors
{% if current_filter == 'all' %}bg-blue-600 text-white{% else %}bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600{% endif %}">
<i class="fas fa-list text-[10px]"></i>
All Projects
<span class="inline-flex items-center justify-center min-w-[18px] h-4 px-1 rounded-full text-[10px] font-semibold
{% if current_filter == 'all' %}bg-blue-500 text-white{% else %}bg-gray-300 dark:bg-gray-600 text-gray-700 dark:text-gray-200{% endif %}">{{ all_count }}</span>
</button>
</div>
</div>
{% if projects %}
<div class="p-6 space-y-4">
{% for p in projects %}
<div class="group rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-950 p-5 shadow-sm transition-all duration-200 hover:shadow-md hover:border-blue-300 dark:hover:border-blue-700">
<div class="flex items-start justify-between gap-4 mb-4">
<div class="min-w-0 flex-1">
<div class="flex items-center gap-3 mb-2">
<h3 class="text-base font-semibold text-gray-900 dark:text-white truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">{{ p.name }}</h3>
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-[11px] font-medium text-white shrink-0
{% if p.status_color == 'success' %}bg-emerald-600
{% elif p.status_color == 'danger' %}bg-red-600
{% elif p.status_color == 'warning' %}bg-amber-500
{% elif p.status_color == 'primary' %}bg-blue-600
{% else %}bg-gray-500{% endif %}">
{{ p.status }}
</span>
</div>
<div class="flex items-center gap-4 text-xs text-gray-500 dark:text-gray-400">
<span><i class="fas fa-calendar mr-1"></i> {{ p.start_date|date:"d/m/Y" }} - {{ p.end_date|date:"d/m/Y" }}</span>
<span><i class="fas fa-clock mr-1"></i> {{ p.total_days }} days</span>
</div>
</div>
</div>
<div class="space-y-2">
<div class="flex items-center gap-3">
<div class="flex-1 h-2.5 bg-gray-100 dark:bg-gray-800 rounded-full overflow-hidden">
{% if p.progress > 0 %}
<div class="h-full rounded-full transition-all duration-500 ease-in-out {% if p.remaining_days < 0 %}bg-red-500{% elif p.remaining_days <= 7 %}bg-amber-500{% else %}bg-blue-600{% endif %}" style="width:{{ p.progress|stringformat:".1f" }}%"></div>
{% endif %}
</div>
<span class="text-xs font-medium text-gray-600 dark:text-gray-400 w-12 text-right">{{ p.progress|stringformat:".0f" }}%</span>
</div>
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-4 text-gray-600 dark:text-gray-400">
{% if p.past_days > 0 %}
<span><i class="fas fa-check text-emerald-500 mr-1"></i> <span class="font-medium text-gray-900 dark:text-white">{{ p.past_days }}</span> day{{ p.past_days|pluralize }} done</span>
{% endif %}
</div>
<div class="text-right">
{% if p.remaining_days > 0 %}
<span class="font-medium text-gray-900 dark:text-white">{{ p.remaining_days }} day{{ p.remaining_days|pluralize }} left</span>
{% elif p.remaining_days < 0 %}
<span class="font-medium text-red-600 dark:text-red-400">{{ p.remaining_days|stringformat:"d"|cut:"-" }} day{{ p.remaining_days|pluralize }} overdue</span>
{% else %}
<span class="font-medium text-amber-600 dark:text-amber-400">Due today</span>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="flex flex-col items-center justify-center py-16">
<div class="flex h-14 w-14 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800 mb-4">
<i class="fas fa-calendar-days text-xl text-gray-400"></i>
</div>
<h3 class="text-sm font-medium text-gray-900 dark:text-white">
{% if current_filter == 'pinned' %}No pinned projects{% else %}No projects found{% endif %}
</h3>
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400 text-center max-w-sm">
{% if current_filter == 'pinned' %}
You haven't pinned any projects yet. Pin important projects to keep them easily accessible.
{% else %}
Create a new project or check your project permissions.
{% endif %}
</p>
</div>
{% endif %}
</div>