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>
This commit is contained in:
1 parent
80d22caea8
commit
d2d8e94aba
4 files changed
+62
-26
No files matched your search
@@ -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>
|
||||
@@ -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 %}
|
||||
+30
-17
@@ -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 %}
|
||||
|
||||
Reference in new issue
Block a user