- Add generic move_in_order() to BaseRepository for reorder support - Add reusable reorder_arrows.html partial with grip dot handles - Add reorder routes to all 9 list routers (tasks, notes, links, contacts, meetings, decisions, appointments, lists, focus) - Compact row padding (6px 12px, gap 8px) on .list-row and .focus-item - Reduce font size to 0.80rem on row titles, sidebar nav, domain tree Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
109 lines
5.6 KiB
HTML
109 lines
5.6 KiB
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
<div class="page-header">
|
|
<h1 class="page-title">All Tasks<span class="page-count">{{ items|length }}</span></h1>
|
|
<a href="/tasks/create" class="btn btn-primary">+ New Task</a>
|
|
</div>
|
|
|
|
<!-- Quick Add -->
|
|
<form class="quick-add" action="/tasks/quick-add" method="post">
|
|
<input type="text" name="title" placeholder="Quick add task..." required>
|
|
<button type="submit" class="btn btn-primary btn-sm">Add</button>
|
|
</form>
|
|
|
|
<!-- Filters -->
|
|
<form class="filters-bar" method="get" action="/tasks">
|
|
<select name="status" class="filter-select" data-auto-submit onchange="this.form.submit()">
|
|
<option value="">All Statuses</option>
|
|
<option value="open" {{ 'selected' if current_status == 'open' }}>Open</option>
|
|
<option value="in_progress" {{ 'selected' if current_status == 'in_progress' }}>In Progress</option>
|
|
<option value="blocked" {{ 'selected' if current_status == 'blocked' }}>Blocked</option>
|
|
<option value="done" {{ 'selected' if current_status == 'done' }}>Done</option>
|
|
</select>
|
|
<select name="priority" class="filter-select" onchange="this.form.submit()">
|
|
<option value="">All Priorities</option>
|
|
<option value="1" {{ 'selected' if current_priority == '1' }}>Critical</option>
|
|
<option value="2" {{ 'selected' if current_priority == '2' }}>High</option>
|
|
<option value="3" {{ 'selected' if current_priority == '3' }}>Normal</option>
|
|
<option value="4" {{ 'selected' if current_priority == '4' }}>Low</option>
|
|
</select>
|
|
<select name="domain_id" class="filter-select" onchange="this.form.submit()">
|
|
<option value="">All Domains</option>
|
|
{% for d in domains %}
|
|
<option value="{{ d.id }}" {{ 'selected' if current_domain_id == d.id|string }}>{{ d.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
<select name="project_id" class="filter-select" onchange="this.form.submit()">
|
|
<option value="">All Projects</option>
|
|
{% for p in projects %}
|
|
<option value="{{ p.id }}" {{ 'selected' if current_project_id == p.id|string }}>{{ p.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
<select name="sort" class="filter-select" onchange="this.form.submit()">
|
|
<option value="sort_order" {{ 'selected' if current_sort == 'sort_order' }}>Manual Order</option>
|
|
<option value="priority" {{ 'selected' if current_sort == 'priority' }}>Priority</option>
|
|
<option value="due_date" {{ 'selected' if current_sort == 'due_date' }}>Due Date</option>
|
|
<option value="created_at" {{ 'selected' if current_sort == 'created_at' }}>Newest</option>
|
|
<option value="title" {{ 'selected' if current_sort == 'title' }}>Title</option>
|
|
</select>
|
|
</form>
|
|
|
|
<!-- Task List -->
|
|
{% if items %}
|
|
<div class="card">
|
|
{% for item in items %}
|
|
<div class="list-row {{ 'completed' if item.status in ['done', 'cancelled'] }} {{ 'timer-active' if running_task_id and item.id|string == running_task_id }}">
|
|
{% with reorder_url="/tasks/reorder", item_id=item.id %}
|
|
{% include 'partials/reorder_arrows.html' %}
|
|
{% endwith %}
|
|
<div class="row-check">
|
|
<form action="/tasks/{{ item.id }}/toggle" method="post" style="display:inline">
|
|
<input type="checkbox" id="check-{{ item.id }}" {{ 'checked' if item.status == 'done' }}
|
|
onchange="this.form.submit()">
|
|
<label for="check-{{ item.id }}"></label>
|
|
</form>
|
|
</div>
|
|
{% if item.status not in ['done', 'cancelled'] %}
|
|
<div class="row-timer">
|
|
{% if running_task_id and item.id|string == running_task_id %}
|
|
<form action="/time/stop" method="post" style="display:inline">
|
|
<button type="submit" class="timer-btn timer-btn-stop" title="Stop timer">■</button>
|
|
</form>
|
|
{% else %}
|
|
<form action="/time/start" method="post" style="display:inline">
|
|
<input type="hidden" name="task_id" value="{{ item.id }}">
|
|
<button type="submit" class="timer-btn timer-btn-play" title="Start timer">▶</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
<span class="priority-dot priority-{{ item.priority }}"></span>
|
|
<span class="row-title"><a href="/tasks/{{ item.id }}">{{ item.title }}</a></span>
|
|
{% if item.project_name %}
|
|
<span class="row-tag">{{ item.project_name }}</span>
|
|
{% endif %}
|
|
{% if item.domain_name %}
|
|
<span class="row-domain-tag" style="background: {{ item.domain_color or '#4F6EF7' }}22; color: {{ item.domain_color or '#4F6EF7' }}">{{ item.domain_name }}</span>
|
|
{% endif %}
|
|
{% if item.due_date %}
|
|
<span class="row-meta {{ 'overdue' if item.due_date|string < now_date|default('9999') }}">{{ item.due_date }}</span>
|
|
{% endif %}
|
|
<span class="status-badge status-{{ item.status }}">{{ item.status|replace('_', ' ') }}</span>
|
|
<div class="row-actions">
|
|
<a href="/tasks/{{ item.id }}/edit" class="btn btn-ghost btn-xs">Edit</a>
|
|
<form action="/tasks/{{ item.id }}/delete" method="post" data-confirm="Delete this task?" style="display:inline">
|
|
<button type="submit" class="btn btn-ghost btn-xs" style="color: var(--red)">Del</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="empty-state">
|
|
<div class="empty-state-icon">☑</div>
|
|
<div class="empty-state-text">No tasks found</div>
|
|
<a href="/tasks/create" class="btn btn-primary">Create First Task</a>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|