Files
Romulus21andClaude Opus 5.5 3164fa8048 Corrige l'édition inline sur /entries
La section qui se recharge seule transmettait hx-select="#entries-list"
aux boutons des lignes : la réponse de « modifier » / « dupliquer » était
filtrée à vide et la ligne disparaissait. hx-disinherit="*" sur les
conteneurs auto-rafraîchis (liste, aujourd'hui, dernières entrées, timer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:31:00 +01:00

28 lines
1.8 KiB
HTML

{% import "_icons.html" as icons %}
<section id="timer" hx-disinherit="*" hx-get="/ui/timer" hx-trigger="timer-changed from:body" hx-swap="outerHTML" 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 %}
<form class="row timer-start" hx-post="/ui/timer/debut" hx-target="#timer" hx-swap="outerHTML">
<label>Début <input type="datetime-local" name="started_at" value="{{ e.start_input() }}" required aria-label="Heure de début"></label>
<button class="btn small">Modifier</button>
</form>
</div>
<div class="clock" data-started="{{ e.started_rfc3339() }}">{{ e.duration() }}</div>
<button class="btn icon danger timer-stop" hx-post="/ui/timer/stop" hx-target="#timer" hx-swap="outerHTML" title="Arrêter" aria-label="Arrêter le timer">{% call icons::icon("stop") %}{% endcall %}</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>