Author SHA1 Message Date
Romulus21andClaude Opus 5.5 d2d8e94aba Met des pictos sur la page clients et aligne les contrôles
Ajouter / Enregistrer (primary), Réinitialiser la couleur, Archiver /
Réactiver et Supprimer deviennent des icônes groupées ; les SVG sont
centralisés dans la macro _icons.html. Hauteurs communes (--control,
--control-sm) pour champs, pastilles de couleur et boutons-icônes ; les
pastilles ne s'étirent plus. Tiret devant les projets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:36:44 +01:00
Romulus21andClaude Opus 5.5 80d22caea8 Merge branch 'feat/pictos-livereload-accueil'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:27:36 +01:00
Romulus21andClaude Opus 5.5 a3902c9662 Ajoute le déploiement en prod locale
Makefile (setup, deploy avec sauvegarde de la base, status, logs, dev),
vhost Apache en reverse proxy sur tempus.loc et service systemd
utilisateur, binaire installé dans /var/www/tempus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:27:16 +01:00
Romulus21andClaude Opus 5.5 467293a6bc Groupe les entrées par jour
/entries et « Dernières entrées » affichent un en-tête par jour avec son
total ; la colonne Jour disparaît des lignes. La liste de /entries se
recharge après une modification inline (date déplacée, totaux).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:27:16 +01:00
Romulus21andClaude Opus 5.5 6307be4f79 Affiche les entrées de l'accueil comme sur /entries
Les tableaux « Aujourd'hui » et « Dernières entrées » réutilisent
_entry_row.html : mêmes colonnes, en-tête et actions (modifier,
dupliquer, supprimer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:17:47 +01:00
Romulus21andClaude Opus 5.5 f4c94f9b5b Ajoute un livereload de développement
Feature cargo `livereload` (tower-livereload, désactivée par défaut) :
script injecté dans les pages hors requêtes htmx, assets en no-cache.
À lancer avec watchexec (cf. README).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:17:47 +01:00
Romulus21andClaude Opus 5.5 fdba078b51 Remplace les boutons des entrées par des pictos groupés
Modifier (crayon, primary), Dupliquer et Supprimer deviennent des icônes
SVG avec title/aria-label, réunies dans un .btn-group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:17:47 +01:00
20 changed files with 278 additions and 72 deletions

No files matched your search

Generated
+15
View File
@@ -1697,6 +1697,7 @@ dependencies = [
"tokio",
"tower",
"tower-http",
"tower-livereload",
"tracing",
"tracing-subscriber",
]
@@ -1824,6 +1825,20 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
[[package]]
name = "tower-livereload"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7df210bd982165dee3c20e31deed79a3585ee6b255c070d9c73ae015cc40d2f3"
dependencies = [
"bytes",
"http",
"http-body",
"pin-project-lite",
"tokio",
"tower",
]
[[package]]
name = "tower-service"
version = "0.3.3"
+5
View File
@@ -15,9 +15,14 @@ sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio",
thiserror = "2.0.21"
tokio = { version = "1.54.1", features = ["full"] }
tower-http = { version = "0.7.1", features = ["trace"] }
tower-livereload = { version = "0.10.3", optional = true }
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
[features]
# Recharge le navigateur au redémarrage du serveur (dev uniquement).
livereload = ["dep:tower-livereload"]
[dev-dependencies]
http-body-util = "0.1.5"
tower = { version = "0.5.3", features = ["util"] }
+53
View File
@@ -0,0 +1,53 @@
DEPLOY_DIR ?= /var/www/tempus
SERVICE ?= tempus
HOST ?= tempus.loc
ADDR ?= 127.0.0.1:3110
UNIT := $(HOME)/.config/systemd/user/$(SERVICE).service
SUBST := sed -e 's|@HOST@|$(HOST)|g' -e 's|@ADDR@|$(ADDR)|g' -e 's|@DEPLOY_DIR@|$(DEPLOY_DIR)|g'
.PHONY: build setup deploy backup status logs dev
## Compile le binaire (templates, CSS/JS et migrations sont embarqués).
build:
cargo build --release
## Une seule fois : dossier, vhost Apache et /etc/hosts (sudo), service systemd utilisateur.
setup:
sudo install -d -o $(USER) -g www-data -m 755 $(DEPLOY_DIR)
$(SUBST) deploy/vh_tempus.conf | sudo tee /etc/apache2/sites-available/vh_tempus.conf >/dev/null
sudo a2ensite -q vh_tempus
sudo systemctl reload apache2
grep -qw '$(HOST)' /etc/hosts || printf '127.0.0.1\t$(HOST)\n' | sudo tee -a /etc/hosts >/dev/null
install -d $(dir $(UNIT))
$(SUBST) deploy/tempus.service > $(UNIT)
systemctl --user daemon-reload
systemctl --user enable $(SERVICE)
## Sauvegarde la base, installe le nouveau binaire et redémarre le service.
deploy: build
systemctl --user stop $(SERVICE)
$(MAKE) --no-print-directory backup
install -m 755 target/release/tempus $(DEPLOY_DIR)/tempus
systemctl --user start $(SERVICE)
@for i in $$(seq 1 50); do \
curl -sf -o /dev/null http://$(ADDR)/health && echo "Déployé : http://$(HOST)" && exit 0; \
sleep 0.1; \
done; echo "Le service ne répond pas : make logs" >&2; exit 1
## Copie la base (service arrêté) dans $(DEPLOY_DIR)/backups, garde les 10 dernières.
backup:
@if [ -f $(DEPLOY_DIR)/tempus.db ]; then \
d=$(DEPLOY_DIR)/backups/$$(date +%Y%m%d-%H%M%S); mkdir -p $$d; \
cp $(DEPLOY_DIR)/tempus.db* $$d/ && echo "Sauvegarde : $$d"; \
ls -1dt $(DEPLOY_DIR)/backups/*/ | tail -n +11 | xargs -r rm -r; \
fi
status:
systemctl --user status $(SERVICE) --no-pager
logs:
journalctl --user -u $(SERVICE) -f
## Dev : recompile, redémarre et recharge le navigateur à chaque modif.
dev:
watchexec -r -e rs,html,css,js,sql -- cargo run --features livereload
+25
View File
@@ -51,8 +51,33 @@ curl -XPOST localhost:7878/api/clients -H 'content-type: application/json' -d '{
curl -XPOST localhost:7878/api/timer/start -H 'content-type: application/json' -d '{"project_id":1}'
```
## Production locale
Binaire dans `/var/www/tempus`, service systemd utilisateur, vhost Apache
(reverse proxy) sur http://tempus.loc → `127.0.0.1:3110`.
```sh
make setup # une fois (sudo) : dossier, vhost, /etc/hosts, service
make deploy # compile, sauvegarde la base, installe, redémarre
make status # / make logs
```
La base de prod est `/var/www/tempus/tempus.db` ; chaque `make deploy` la copie
dans `/var/www/tempus/backups/` (10 dernières conservées). Variables
surchargeables : `DEPLOY_DIR`, `HOST`, `ADDR`, `SERVICE`.
## Développement
Rechargement automatique (recompile, redémarre et rafraîchit le navigateur) :
```sh
cargo install watchexec-cli # une fois
make dev
```
La feature `livereload` injecte un script dans les pages (pas dans les fragments
htmx) et désactive le cache des assets ; elle n'est jamais active par défaut.
```sh
cargo test
cargo clippy --all-targets -- -D warnings
+15
View File
@@ -0,0 +1,15 @@
[Unit]
Description=Tempus (suivi du temps)
After=network.target
[Service]
Type=simple
WorkingDirectory=@DEPLOY_DIR@
Environment=TEMPUS_DB=@DEPLOY_DIR@/tempus.db
Environment=TEMPUS_ADDR=@ADDR@
ExecStart=@DEPLOY_DIR@/tempus
Restart=on-failure
RestartSec=3
[Install]
WantedBy=default.target
+8
View File
@@ -0,0 +1,8 @@
<VirtualHost *:80>
ServerName @HOST@
ProxyPreserveHost On
ProxyPass / http://@ADDR@/
ProxyPassReverse / http://@ADDR@/
ErrorLog /var/log/apache2/error.@HOST@.log
CustomLog /var/log/apache2/access.@HOST@.log combined
</VirtualHost>
+9 -1
View File
@@ -20,7 +20,15 @@ async fn main() -> anyhow::Result<()> {
.await
.with_context(|| format!("cannot listen on {}", config.addr))?;
tracing::info!(db = %config.database_url, "Tempus disponible sur http://{}", config.addr);
axum::serve(listener, routes::app(pool))
let app = routes::app(pool);
#[cfg(feature = "livereload")]
let app = app.layer(
// Les fragments htmx ne doivent pas recevoir le script injecté.
tower_livereload::LiveReloadLayer::new().request_predicate(
|req: &axum::http::Request<axum::body::Body>| !req.headers().contains_key("hx-request"),
),
);
axum::serve(listener, app)
.with_graceful_shutdown(async {
let _ = tokio::signal::ctrl_c().await;
})
+8 -1
View File
@@ -56,11 +56,18 @@ pub fn app(pool: SqlitePool) -> Router {
.with_state(pool)
}
// En livereload, le CSS/JS doit être relu à chaque rechargement.
const CACHE_CONTROL: &str = if cfg!(feature = "livereload") {
"no-cache"
} else {
"public, max-age=3600"
};
async fn asset(content_type: &'static str, body: &'static str) -> impl IntoResponse {
(
[
(header::CONTENT_TYPE, content_type),
(header::CACHE_CONTROL, "public, max-age=3600"),
(header::CACHE_CONTROL, CACHE_CONTROL),
],
body,
)
+39 -8
View File
@@ -212,7 +212,7 @@ struct DashboardTpl {
groups: Vec<ProjectGroup>,
today_entries: Vec<Entry>,
today_total: String,
recent_entries: Vec<Entry>,
recent_days: Vec<DayGroup>,
}
#[derive(Template)]
@@ -232,7 +232,36 @@ struct TodayTpl {
#[derive(Template)]
#[template(path = "_recent.html")]
struct RecentTpl {
recent_entries: Vec<Entry>,
recent_days: Vec<DayGroup>,
}
/// Entries started on the same local day, with their total.
struct DayGroup {
day: String,
total: String,
entries: Vec<Entry>,
}
/// Groups a list sorted by start time into consecutive days.
fn group_by_day(list: Vec<Entry>) -> Vec<DayGroup> {
let mut days: Vec<(NaiveDate, i64, Vec<Entry>)> = Vec::new();
for e in list {
let date = clock::local_date(&e.started_at);
match days.last_mut() {
Some((d, secs, entries)) if *d == date => {
*secs += e.seconds;
entries.push(e);
}
_ => days.push((date, e.seconds, vec![e])),
}
}
days.into_iter()
.map(|(date, secs, entries)| DayGroup {
day: clock::fmt_day(date),
total: clock::hhmm(secs),
entries,
})
.collect()
}
/// How many entries the dashboard lists under "Dernières entrées".
@@ -266,8 +295,10 @@ async fn today_state(pool: &SqlitePool) -> PageResult<TodayTpl> {
}
async fn recent_state(pool: &SqlitePool) -> PageResult<RecentTpl> {
let recent_entries = entries::recent(pool, RECENT_LIMIT, clock::now()).await?;
Ok(RecentTpl { recent_entries })
let recent = entries::recent(pool, RECENT_LIMIT, clock::now()).await?;
Ok(RecentTpl {
recent_days: group_by_day(recent),
})
}
async fn dashboard(State(pool): State<SqlitePool>) -> PageResult {
@@ -276,14 +307,14 @@ async fn dashboard(State(pool): State<SqlitePool>) -> PageResult {
today_entries,
today_total,
} = today_state(&pool).await?;
let RecentTpl { recent_entries } = recent_state(&pool).await?;
let RecentTpl { recent_days } = recent_state(&pool).await?;
render(DashboardTpl {
nav: "dashboard",
running,
groups,
today_entries,
today_total,
recent_entries,
recent_days,
})
}
@@ -499,7 +530,7 @@ struct EntriesTpl {
clients: Vec<ClientOption>,
filter_groups: Vec<ProjectGroup>,
groups: Vec<ProjectGroup>,
entries: Vec<Entry>,
days: Vec<DayGroup>,
total: String,
default_start: String,
default_end: String,
@@ -552,7 +583,7 @@ async fn entries_page(
clients: client_options(clients::list(&pool, true).await?, filter.client_id),
filter_groups: group_projects(projects::list(&pool, None, true).await?, filter.project_id),
groups: group_projects(projects::list(&pool, None, false).await?, last_project),
entries: list,
days: group_by_day(list),
total,
default_start: format!("{today}T09:00"),
default_end: format!("{today}T10:00"),
+23 -3
View File
@@ -1,4 +1,7 @@
:root {
/* Hauteur commune des champs, pastilles de couleur et boutons-icônes. */
--control: 2.5rem;
--control-sm: 1.9rem;
--bg: #f6f5f2;
--surface: #ffffff;
--text: #1d1d1f;
@@ -64,7 +67,8 @@ main { max-width: 960px; margin: 1.5rem auto; padding: 0 16px; display: grid; ga
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.row.grow input { flex: 1; min-width: 0; }
.row.grow input:not([type="color"]) { flex: 1; min-width: 0; }
.row input, .row select { height: var(--control); }
.stack { display: grid; gap: .35rem; }
.muted, .empty { color: var(--muted); }
.empty { margin: .25rem 0; }
@@ -87,6 +91,18 @@ label { display: flex; align-items: center; gap: .35rem; color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
.btn.icon {
display: inline-flex; align-items: center; justify-content: center; flex: none;
width: var(--control); height: var(--control); padding: 0; line-height: 0;
}
.btn.small.icon { width: var(--control-sm); height: var(--control-sm); }
.btn.icon svg { display: block; }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group > .btn:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.btn-group > .btn:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.btn-group > .btn:hover { position: relative; z-index: 1; }
.htmx-request .btn, .btn.htmx-request { opacity: .6; }
.badge { font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--bg); color: var(--muted); }
@@ -111,6 +127,8 @@ tr:last-child td { border-bottom: 0; }
.time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.client { color: var(--muted); }
tr.running { background: var(--running); }
tr.day-head th { color: var(--text); font-weight: 600; font-size: .9rem; padding-top: 1.1rem; }
tbody:first-of-type tr.day-head th { padding-top: .6rem; }
tr.editing td { background: var(--bg); }
tr.editing input, tr.editing select { width: 100%; }
td.actions { text-align: right; white-space: nowrap; }
@@ -123,9 +141,10 @@ td.actions { text-align: right; white-space: nowrap; }
}
.client-card { border-left: 6px solid var(--color); }
input[type="color"] {
width: 2.2rem; height: 2.2rem; padding: .15rem; flex: none; cursor: pointer;
width: var(--control); height: var(--control); padding: .15rem; flex: none; cursor: pointer;
}
.projects input[type="color"] { width: 1.8rem; height: 1.8rem; }
.projects input { height: var(--control-sm); padding-block: 0; }
.projects input[type="color"] { width: var(--control-sm); padding: .1rem; }
/* Projects list */
.projects { list-style: none; margin: 0 0 1rem; padding: 0; }
@@ -134,6 +153,7 @@ input[type="color"] {
padding: .4rem 0; border-bottom: 1px solid var(--border);
}
.projects li.archived { opacity: .6; }
.projects li > form::before { content: "-"; color: var(--muted); flex: none; }
/* Periods & reports */
.presets { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .75rem; }
+6
View File
@@ -0,0 +1,6 @@
{% for d in days %}
<tbody>
<tr class="day-head"><th colspan="3">{{ d.day }}</th><th class="num">{{ d.total }}</th><th></th></tr>
{% for e in d.entries %}{% include "_entry_row.html" %}{% endfor %}
</tbody>
{% endfor %}
+1 -1
View File
@@ -1,5 +1,5 @@
<tr class="editing">
<td colspan="2">
<td>
<div class="stack">
<input type="datetime-local" name="started_at" value="{{ e.start_input() }}" required aria-label="Début">
<input type="datetime-local" name="ended_at" value="{{ end }}" required aria-label="Fin">
+1 -1
View File
@@ -1,5 +1,5 @@
<tr id="entry-{{ e.id }}" class="editing">
<td colspan="2">
<td>
<div class="stack">
<input type="datetime-local" name="started_at" value="{{ e.start_input() }}" required aria-label="Début">
{% if e.running() %}
+6 -4
View File
@@ -1,5 +1,5 @@
{% import "_icons.html" as icons %}
<tr id="entry-{{ e.id }}"{% if e.running() %} class="running"{% endif %}>
<td class="nowrap">{{ e.day() }}</td>
<td class="time">
{{ e.start_time() }} – {{ e.end_time() }}
{% if e.overlaps %}<span class="warn" title="Chevauche une autre entrée">⚠</span>{% endif %}
@@ -8,8 +8,10 @@
<td class="note">{{ e.note }}</td>
<td class="num">{{ e.duration() }}</td>
<td class="actions">
<button class="btn small" hx-get="/ui/entries/{{ e.id }}/edit" hx-target="closest tr" hx-swap="outerHTML">Modifier</button>
<button class="btn small" hx-get="/ui/entries/{{ e.id }}/dupliquer" hx-target="closest tr" hx-swap="afterend">Dupliquer</button>
<button class="btn small danger" hx-delete="/ui/entries/{{ e.id }}" hx-target="closest tr" hx-swap="outerHTML" hx-confirm="Supprimer cette entrée ?">Suppr.</button>
<div class="btn-group">
<button class="btn small icon primary" title="Modifier" aria-label="Modifier" hx-get="/ui/entries/{{ e.id }}/edit" hx-target="closest tr" hx-swap="outerHTML">{% call icons::icon("edit") %}{% endcall %}</button>
<button class="btn small icon" title="Dupliquer" aria-label="Dupliquer" hx-get="/ui/entries/{{ e.id }}/dupliquer" hx-target="closest tr" hx-swap="afterend">{% call icons::icon("copy") %}{% endcall %}</button>
<button class="btn small icon danger" title="Supprimer" aria-label="Supprimer" hx-delete="/ui/entries/{{ e.id }}" hx-target="closest tr" hx-swap="outerHTML" hx-confirm="Supprimer cette entrée ?">{% call icons::icon("trash") %}{% endcall %}</button>
</div>
</td>
</tr>
+12
View File
@@ -0,0 +1,12 @@
{# Icônes SVG (tracés Lucide), en couleur du texte. #}
{% macro icon(name) %}<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
{%- if name == "edit" -%}<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>
{%- else if name == "copy" -%}<rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
{%- else if name == "trash" -%}<path d="M3 6h18"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><path d="M10 11v6"/><path d="M14 11v6"/>
{%- else if name == "check" -%}<path d="M20 6 9 17l-5-5"/>
{%- else if name == "plus" -%}<path d="M5 12h14"/><path d="M12 5v14"/>
{%- else if name == "reset" -%}<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/>
{%- else if name == "archive" -%}<rect x="2" y="3" width="20" height="5" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="M10 12h4"/>
{%- else if name == "unarchive" -%}<rect x="2" y="3" width="20" height="5" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h2"/><path d="M20 8v11a2 2 0 0 1-2 2h-2"/><path d="m9 15 3-3 3 3"/><path d="M12 12v9"/>
{%- endif -%}
</svg>{% endmacro %}
+3 -14
View File
@@ -3,24 +3,13 @@
<h2>Dernières entrées</h2>
<a href="/entries">Tout voir</a>
</div>
{% if recent_entries.is_empty() %}
{% if recent_days.is_empty() %}
<p class="empty">Aucune entrée pour l'instant.</p>
{% else %}
<div class="table-wrap">
<table class="entries">
<tbody>
{% for e in recent_entries %}
<tr{% if e.running() %} class="running"{% endif %}>
<td class="nowrap">{{ e.day() }}</td>
<td class="time">{{ e.start_time() }} – {{ e.end_time() }}</td>
<td>
<span class="dot" style="--color: {{ e.color }}"></span><span class="client">{{ e.client_name }}</span> / {{ e.project_name }}
{% if !e.note.is_empty() %}<div class="note">{{ e.note }}</div>{% endif %}
</td>
<td class="num">{{ e.duration() }}</td>
</tr>
{% endfor %}
</tbody>
<thead><tr><th>Horaire</th><th>Projet</th><th>Note</th><th class="num">Durée</th><th></th></tr></thead>
{% let days = recent_days %}{% include "_entry_days.html" %}
</table>
</div>
{% endif %}
+8 -14
View File
@@ -6,19 +6,13 @@
{% if today_entries.is_empty() %}
<p class="empty">Rien de saisi pour l'instant.</p>
{% else %}
<table class="entries">
<tbody>
{% for e in today_entries %}
<tr{% if e.running() %} class="running"{% endif %}>
<td class="time">{{ e.start_time() }} – {{ e.end_time() }}</td>
<td>
<span class="dot" style="--color: {{ e.color }}"></span><span class="client">{{ e.client_name }}</span> / {{ e.project_name }}
{% if !e.note.is_empty() %}<div class="note">{{ e.note }}</div>{% endif %}
</td>
<td class="num">{{ e.duration() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="table-wrap">
<table class="entries">
<thead><tr><th>Horaire</th><th>Projet</th><th>Note</th><th class="num">Durée</th><th></th></tr></thead>
<tbody>
{% for e in today_entries %}{% include "_entry_row.html" %}{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</section>
+30 -17
View File
@@ -1,4 +1,5 @@
{% extends "base.html" %}
{% import "_icons.html" as icons %}
{% block title %}Clients{% endblock %}
{% block content %}
<section class="card">
@@ -6,7 +7,7 @@
<form method="post" action="/ui/clients" class="row">
<input type="color" name="color" value="{{ next_color }}" aria-label="Couleur du client">
<input name="name" required placeholder="Nom du client" aria-label="Nom du client" class="grow">
<button class="btn primary">Ajouter</button>
<button class="btn icon primary" title="Ajouter le client" aria-label="Ajouter le client">{% call icons::icon("plus") %}{% endcall %}</button>
</form>
</section>
@@ -20,17 +21,22 @@
<form method="post" action="/ui/clients/{{ c.client.id }}" class="row grow">
<input type="color" name="color" value="{{ c.client.color }}" aria-label="Couleur du client">
<input name="name" value="{{ c.client.name }}" required aria-label="Nom du client" class="title-input">
<button class="btn">Enregistrer</button>
<button class="btn icon primary" title="Enregistrer" aria-label="Enregistrer">{% call icons::icon("check") %}{% endcall %}</button>
</form>
<div class="row">
{% if c.client.archived %}<span class="badge">archivé</span>{% endif %}
<form method="post" action="/ui/clients/{{ c.client.id }}/archive">
<form id="archive-client-{{ c.client.id }}" method="post" action="/ui/clients/{{ c.client.id }}/archive" hidden>
<input type="hidden" name="archived" value="{{ !c.client.archived }}">
<button class="btn">{% if c.client.archived %}Réactiver{% else %}Archiver{% endif %}</button>
</form>
<form method="post" action="/ui/clients/{{ c.client.id }}/delete" data-confirm="Supprimer ce client, ses projets et tout le temps saisi ?">
<button class="btn danger">Supprimer</button>
</form>
<form id="delete-client-{{ c.client.id }}" method="post" action="/ui/clients/{{ c.client.id }}/delete" data-confirm="Supprimer ce client, ses projets et tout le temps saisi ?" hidden></form>
<div class="btn-group">
{% if c.client.archived %}
<button class="btn icon" form="archive-client-{{ c.client.id }}" title="Réactiver" aria-label="Réactiver">{% call icons::icon("unarchive") %}{% endcall %}</button>
{% else %}
<button class="btn icon" form="archive-client-{{ c.client.id }}" title="Archiver" aria-label="Archiver">{% call icons::icon("archive") %}{% endcall %}</button>
{% endif %}
<button class="btn icon danger" form="delete-client-{{ c.client.id }}" title="Supprimer" aria-label="Supprimer">{% call icons::icon("trash") %}{% endcall %}</button>
</div>
</div>
</div>
@@ -41,20 +47,27 @@
<input type="color" name="color" value="{{ p.effective_color }}" aria-label="Couleur du projet"
title="{% if p.color.is_some() %}Couleur propre au projet{% else %}Couleur du client{% endif %}">
<input name="name" value="{{ p.name }}" required aria-label="Nom du projet">
<button class="btn small">Enregistrer</button>
{% if p.color.is_some() %}
<button class="btn small" name="inherit" value="true" title="Reprendre la couleur du client">↺</button>
{% endif %}
<div class="btn-group">
<button class="btn small icon primary" title="Enregistrer" aria-label="Enregistrer">{% call icons::icon("check") %}{% endcall %}</button>
{% if p.color.is_some() %}
<button class="btn small icon" name="inherit" value="true" title="Reprendre la couleur du client" aria-label="Reprendre la couleur du client">{% call icons::icon("reset") %}{% endcall %}</button>
{% endif %}
</div>
</form>
<div class="row">
{% if p.archived %}<span class="badge">archivé</span>{% endif %}
<form method="post" action="/ui/projects/{{ p.id }}/archive">
<form id="archive-project-{{ p.id }}" method="post" action="/ui/projects/{{ p.id }}/archive" hidden>
<input type="hidden" name="archived" value="{{ !p.archived }}">
<button class="btn small">{% if p.archived %}Réactiver{% else %}Archiver{% endif %}</button>
</form>
<form method="post" action="/ui/projects/{{ p.id }}/delete" data-confirm="Supprimer ce projet et tout le temps saisi dessus ?">
<button class="btn small danger">Supprimer</button>
</form>
<form id="delete-project-{{ p.id }}" method="post" action="/ui/projects/{{ p.id }}/delete" data-confirm="Supprimer ce projet et tout le temps saisi dessus ?" hidden></form>
<div class="btn-group">
{% if p.archived %}
<button class="btn small icon" form="archive-project-{{ p.id }}" title="Réactiver" aria-label="Réactiver">{% call icons::icon("unarchive") %}{% endcall %}</button>
{% else %}
<button class="btn small icon" form="archive-project-{{ p.id }}" title="Archiver" aria-label="Archiver">{% call icons::icon("archive") %}{% endcall %}</button>
{% endif %}
<button class="btn small icon danger" form="delete-project-{{ p.id }}" title="Supprimer" aria-label="Supprimer">{% call icons::icon("trash") %}{% endcall %}</button>
</div>
</div>
</li>
{% endfor %}
@@ -63,7 +76,7 @@
<form method="post" action="/ui/clients/{{ c.client.id }}/projects" class="row">
<input type="color" name="color" value="{{ c.client.color }}" aria-label="Couleur du projet" title="Garder la couleur du client ou en choisir une autre">
<input name="name" required placeholder="Nouveau projet" aria-label="Nouveau projet" class="grow">
<button class="btn">Ajouter le projet</button>
<button class="btn icon primary" title="Ajouter le projet" aria-label="Ajouter le projet">{% call icons::icon("plus") %}{% endcall %}</button>
</form>
</section>
{% endfor %}
+4 -6
View File
@@ -16,7 +16,7 @@
{% endif %}
</section>
<section class="card">
<section id="entries-list" class="card" hx-get="/entries?from={{ from }}&to={{ to }}{{ extra_query }}" hx-select="#entries-list" hx-trigger="entries-changed from:body" hx-swap="outerHTML">
<div class="card-head">
<h2>Entrées</h2>
<span class="total">{{ total }}</span>
@@ -40,15 +40,13 @@
<button class="btn">Filtrer</button>
</form>
{% if entries.is_empty() %}
{% if days.is_empty() %}
<p class="empty">Aucune entrée sur cette période.</p>
{% else %}
<div class="table-wrap">
<table class="entries">
<thead><tr><th>Jour</th><th>Horaire</th><th>Projet</th><th>Note</th><th class="num">Durée</th><th></th></tr></thead>
<tbody>
{% for e in entries %}{% include "_entry_row.html" %}{% endfor %}
</tbody>
<thead><tr><th>Horaire</th><th>Projet</th><th>Note</th><th class="num">Durée</th><th></th></tr></thead>
{% include "_entry_days.html" %}
</table>
</div>
{% endif %}
+7 -2
View File
@@ -467,7 +467,7 @@ async fn dashboard_lists_20_most_recent_entries() {
let (status, html) = get_html(&app, "/ui/dernieres-entrees").await;
assert_eq!(status, StatusCode::OK);
assert_eq!(html.matches("<tr").count(), 20);
assert_eq!(html.matches("<tr id=\"entry-").count(), 20);
assert!(html.contains("25/03/2026") && html.contains("06/03/2026"));
assert!(!html.contains("05/03/2026"));
}
@@ -649,7 +649,12 @@ async fn duplicate_entry() {
)
.await;
assert_eq!(status, StatusCode::OK);
assert!(html.contains("id=\"entry-2\"") && html.contains("mer. 11/03/2026"));
assert!(html.contains("id=\"entry-2\"") && html.contains("09:00 – 10:15"));
// /entries groups rows under one header per day, with the day total.
let (_, html) = get_html(&app, "/entries?from=2026-03-09&to=2026-03-15").await;
assert_eq!(html.matches("class=\"day-head\"").count(), 2);
assert!(html.contains("mer. 11/03/2026") && html.contains("mar. 10/03/2026"));
let (_, list) = send(
&app,