Files
tempus/templates/_timer.html
T
2026-10-26 13:21:14 +01:00

23 lines
1.3 KiB
HTML

<section id="timer" class="card timer{% if running.is_some() %} is-running{% endif %}"{% if let Some(e) = running %} style="--color: {{ e.color }}"{% endif %}>
{% if let Some(e) = running %}
<div class="current">
<div class="current-label">
<div class="muted"><span class="dot" style="--color: {{ e.client_color }}"></span>{{ e.client_name }}</div>
<div class="current-project">{{ e.project_name }}</div>
{% if !e.note.is_empty() %}<div class="note">{{ e.note }}</div>{% endif %}
</div>
<div class="clock" data-started="{{ e.started_rfc3339() }}">{{ e.duration() }}</div>
<button class="btn danger" hx-post="/ui/timer/stop" hx-target="#timer" hx-swap="outerHTML">Arrêter</button>
</div>
{% endif %}
{% if groups.is_empty() %}
<p class="empty">Aucun projet actif. <a href="/clients">Crée un client et un projet</a> pour commencer.</p>
{% else %}
<form class="start" hx-post="/ui/timer/start" hx-target="#timer" hx-swap="outerHTML">
<select name="project_id" required aria-label="Projet">{% include "_project_select.html" %}</select>
<input name="note" placeholder="Sur quoi travailles-tu ?" aria-label="Note">
<button class="btn primary">{% if running.is_some() %}Basculer{% else %}Démarrer{% endif %}</button>
</form>
{% endif %}
</section>