Champ « Début » sur le timer en cours (POST /ui/timer/debut) ; le chrono continue. Une heure dans le futur est refusée. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.6 KiB
HTML
27 lines
1.6 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 %}
|
|
<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 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>
|