Pastille à droite du header sur toutes les pages (fragment /ui/timer/entete) : description ou projet, chrono et bouton stop, bordée à la couleur du projet. L'arrêt émet timer-changed pour rafraîchir le timer de l'accueil (GET /ui/timer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
722 B
HTML
11 lines
722 B
HTML
{% import "_icons.html" as icons %}
|
|
<div id="mini-timer" hx-get="/ui/timer/entete" hx-trigger="entries-changed from:body, every 30s" hx-swap="outerHTML">
|
|
{% if let Some(e) = running %}
|
|
<div class="mini-timer" style="--color: {{ e.color }}" title="{{ e.client_name }} / {{ e.project_name }}">
|
|
<span class="mini-timer-label">{% if e.note.is_empty() %}{{ e.project_name }}{% else %}{{ e.note }}{% endif %}</span>
|
|
<span class="clock" data-started="{{ e.started_rfc3339() }}">{{ e.duration() }}</span>
|
|
<button class="btn small icon danger" hx-post="/ui/timer/stop" hx-swap="none" title="Arrêter" aria-label="Arrêter le timer">{% call icons::icon("stop") %}{% endcall %}</button>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|