135 lines
9.8 KiB
HTML
135 lines
9.8 KiB
HTML
{% extends "base.html" %}
|
|
{% import "components/macros.html" as ui %}
|
|
|
|
{% block title %}Tasks Dashboard - Stick{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="grow py-12 px-4 sm:px-6 lg:px-8 max-w-5xl mx-auto w-full">
|
|
|
|
<!-- Welcome Header -->
|
|
<div class="flex flex-col md:flex-row md:items-center md:justify-between mb-8 pb-6 border-b border-slate-900 gap-4">
|
|
<div>
|
|
<h1 class="text-3xl font-extrabold text-slate-100 tracking-tight">Your Tasks</h1>
|
|
<p class="text-slate-400 text-sm mt-1">Add and manage your workflow tasks</p>
|
|
</div>
|
|
<div class="flex items-center gap-3">
|
|
<span class="text-xs font-semibold px-3 py-1.5 rounded-xl bg-slate-900 border border-slate-800 text-slate-300">
|
|
Total Tasks: {{ tasks.len() }}
|
|
</span>
|
|
<!-- Info trigger button -->
|
|
{{ ui::modal_trigger(target_id="task-info-modal", label="<svg class='w-4 h-4' fill='none' stroke='currentColor' viewBox='0 0 24 24'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/></svg>", variant="outline", extra_class="px-2.5 py-2.5") }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
|
|
|
<!-- Add Task Form Container -->
|
|
<div class="lg:col-span-1">
|
|
<div class="bg-[#1e293b]/40 backdrop-blur-xl border border-slate-900 rounded-3xl p-6 shadow-xl sticky top-24">
|
|
<h3 class="text-lg font-bold text-slate-100 mb-4 flex items-center gap-2">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-5 h-5 text-sky-400">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7-7H5" />
|
|
</svg>
|
|
New Task
|
|
</h3>
|
|
<form action="/tasks/create" method="post" class="space-y-4">
|
|
<!-- Task Title Input using macro -->
|
|
{{ ui::text_input(id="title", name="title", label="Title", type="text", placeholder="Task name", required=true) }}
|
|
|
|
<!-- Task Description TextArea using macro -->
|
|
{{ ui::textarea(id="description", name="description", label="Description (Optional)", placeholder="Add some context...") }}
|
|
|
|
<!-- Interactive Assignee Search using macro -->
|
|
{{ ui::search_combobox(name="assignee_id", label="Assignee (Optional)", placeholder="Search developer...", search_url="/developers/search", input_id="assignee-search", value_id="assignee-id") }}
|
|
|
|
<!-- Create Task submit button using macro -->
|
|
{{ ui::button(label="Create Task", variant="indigo", type="submit", extra_class="w-full py-3 bg-gradient-to-r from-sky-500 to-indigo-600 hover:opacity-95 transition shadow-md shadow-sky-500/10") }}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tasks Listing -->
|
|
<div class="lg:col-span-2 space-y-4">
|
|
{% if tasks.is_empty() %}
|
|
<div class="bg-slate-900/20 border border-dashed border-slate-800 rounded-3xl p-12 text-center">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-12 h-12 text-slate-600 mx-auto mb-4">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.03 0 1.9.693 2.166 1.638m-7.3 8.35h.008v.008H10v-.008Zm0 3h.008v.008H10v-.008Zm0 3h.008v.008H10v-.008Z" />
|
|
</svg>
|
|
<h3 class="text-base font-bold text-slate-350 mb-1">No tasks yet</h3>
|
|
<p class="text-sm text-slate-500">Your task board is clean. Use the form on the left to add your first task.</p>
|
|
</div>
|
|
{% else %}
|
|
{% for item in tasks %}
|
|
<div class="bg-[#1e293b]/30 hover:bg-[#1e293b]/40 border border-slate-900 rounded-2xl p-5 flex items-start gap-4 transition duration-300 {% if item.task.is_completed %} opacity-60 {% endif %} relative overflow-hidden group">
|
|
|
|
<!-- Checkmark Indicator -->
|
|
<div class="flex-shrink-0 mt-0.5">
|
|
{% if item.task.is_completed %}
|
|
<div class="w-5 h-5 rounded-full bg-emerald-500/20 border border-emerald-500/50 flex items-center justify-center text-emerald-400">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-3.5 h-3.5">
|
|
<path fill-rule="evenodd" d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clip-rule="evenodd" />
|
|
</svg>
|
|
</div>
|
|
{% else %}
|
|
<div class="w-5 h-5 rounded-full border border-slate-700"></div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Task Text -->
|
|
<div class="grow">
|
|
<h4 class="text-sm font-semibold text-slate-200 {% if item.task.is_completed %} line-through text-slate-500 {% endif %}">
|
|
{{ item.task.title }}
|
|
</h4>
|
|
{% if let Some(desc) = item.task.description %}
|
|
{% if !desc.is_empty() %}
|
|
<p class="text-xs text-slate-400 mt-1 {% if item.task.is_completed %} line-through text-slate-500 {% endif %}">
|
|
{{ desc }}
|
|
</p>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
<div class="flex items-center flex-wrap gap-x-3 gap-y-1.5 mt-3 text-[10px] text-slate-500">
|
|
<span>Created {{ item.task.created_at.format("%Y-%m-%d %H:%M") }}</span>
|
|
{% if let Some(dev_name) = item.developer_name %}
|
|
<span class="w-1 h-1 rounded-full bg-slate-700"></span>
|
|
<span class="px-2 py-0.5 rounded-full bg-sky-950/40 text-sky-400 border border-sky-900/30 flex items-center gap-1 font-medium">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" class="w-2.5 h-2.5">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z" />
|
|
</svg>
|
|
Assigned to: {{ dev_name }}
|
|
</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Action Buttons -->
|
|
<div class="flex items-center gap-2 flex-shrink-0 opacity-100 md:opacity-0 group-hover:opacity-100 transition-opacity duration-200">
|
|
{% if !item.task.is_completed %}
|
|
<form action="/tasks/{{ item.task.id.unwrap().to_hex() }}/complete" method="post" class="inline">
|
|
<button type="submit" class="p-2 rounded-lg bg-emerald-500/10 hover:bg-emerald-500/20 border border-emerald-500/20 text-emerald-400 transition" title="Mark Completed">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" class="w-4 h-4">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
|
|
</svg>
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
<form action="/tasks/{{ item.task.id.unwrap().to_hex() }}/delete" method="post" class="inline">
|
|
<button type="submit" class="p-2 rounded-lg bg-rose-500/10 hover:bg-rose-500/20 border border-rose-500/20 text-rose-400 transition" title="Delete Task">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-4 h-4">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.34 9m-4.72 0-.34-9m9.03-3.03-.58 17.5A2.25 2.25 0 0 1 17.11 21H6.9a2.25 2.25 0 0 1-2.18-2.13L4.1 6.57m3.07-7.94h14.98m-14.98 0A1.75 1.75 0 0 1 7.25 1.5H16.75A1.75 1.75 0 0 1 18 3m-12 0h12" />
|
|
</svg>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Reusable Task Info Modal defined via macro -->
|
|
{{ ui::modal(id="task-info-modal", title="Tasks Guide", content="Welcome to the task board! You can add new tasks, assign them to registered developers, mark them complete, or delete them. This board is dynamic and updates automatically.", close_label="Got it") }}
|
|
|
|
{% endblock %}
|