Merge branch 'feat/clients-pictos'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Romulus21andClaude Opus 5.5 committed 2026-11-13 18:36:44 +01:00
commit b4702fdf71
4 files changed
+60 -24

No files matched your search

+16 -6
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,13 +91,17 @@ 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; padding: .3rem; line-height: 0; }
.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-radius: 8px 0 0 8px; }
.btn-group > .btn:last-child { border-radius: 0 8px 8px 0; }
.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; }
@@ -133,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; }
@@ -144,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; }
+4 -3
View File
@@ -1,3 +1,4 @@
{% import "_icons.html" as icons %}
<tr id="entry-{{ e.id }}"{% if e.running() %} class="running"{% endif %}>
<td class="time">
{{ e.start_time() }} – {{ e.end_time() }}
@@ -8,9 +9,9 @@
<td class="num">{{ e.duration() }}</td>
<td class="actions">
<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"><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"><path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/></svg></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"><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"><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"/></svg></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 ?"><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"><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"/></svg></button>
<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 %}
+28 -15
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>
<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" name="inherit" value="true" title="Reprendre la couleur du client">↺</button>
<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 %}