Files
tempus/templates/clients.html
Romulus21andClaude Opus 5.5 63ddfd39d9 Ajoute l'URL du repo sur les projets
Colonne projects.repo_url (migration 0003), exposée par l'API
(repo_url à la création, "" ou null pour l'effacer) et éditable sur la
page clients ; une icône ouvre le repo dans un nouvel onglet. Seules les
URL http(s) sont acceptées.

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

89 lines
5.5 KiB
HTML

{% extends "base.html" %}
{% import "_icons.html" as icons %}
{% block title %}Clients{% endblock %}
{% block content %}
<section class="card">
<h2>Nouveau client</h2>
<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 icon primary" title="Ajouter le client" aria-label="Ajouter le client">{% call icons::icon("plus") %}{% endcall %}</button>
</form>
</section>
{% if clients.is_empty() %}
<p class="empty">Aucun client pour l'instant.</p>
{% endif %}
{% for c in clients %}
<section class="card client-card{% if c.client.archived %} archived{% endif %}" style="--color: {{ c.client.color }}">
<div class="card-head">
<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 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 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 }}">
</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>
<ul class="projects">
{% for p in c.projects %}
<li{% if p.archived %} class="archived"{% endif %}>
<form method="post" action="/ui/projects/{{ p.id }}" class="row grow">
<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">
<input type="url" name="repo_url" value="{% if let Some(u) = p.repo_url %}{{ u }}{% endif %}" placeholder="URL du repo" aria-label="URL du repo" class="repo-url">
<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 id="archive-project-{{ p.id }}" method="post" action="/ui/projects/{{ p.id }}/archive" hidden>
<input type="hidden" name="archived" value="{{ !p.archived }}">
</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 let Some(u) = p.repo_url %}
<a class="btn small icon" href="{{ u }}" target="_blank" rel="noopener noreferrer" title="Ouvrir le repo" aria-label="Ouvrir le repo">{% call icons::icon("link") %}{% endcall %}</a>
{% endif %}
{% 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 %}
</ul>
<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">
<input type="url" name="repo_url" placeholder="URL du repo (facultatif)" aria-label="URL du repo" class="grow">
<button class="btn icon primary" title="Ajouter le projet" aria-label="Ajouter le projet">{% call icons::icon("plus") %}{% endcall %}</button>
</form>
</section>
{% endfor %}
{% endblock %}