feat(frontend): filtres, création d'issues, vue Focus, CDN vendorés

- vendor: HTMX/Alpine/SortableJS servis depuis /static/vendor (M3)
- board.js: jeton CSRF, ordres source/destination envoyés, carte
  replacée + toast rouge en cas d'échec (M8), filtres texte/étiquette,
  formulaire de création d'issue
- dashboard: 3 onglets Actifs/Inactifs/Archivés, recherche via
  data-search échappé au lieu d'une interpolation JS (M9)
- board: cartes liées vers l'issue Gitea, méta CSRF, notes protégées
- nouvelles pages focus.html et error.html
- CSS: fond des badges en color-mix, l'ancien var(--accent)20 était
  invalide (M1); styles toolbar/focus/erreur/toast erreur
This commit is contained in:
Spark
2026-10-11 09:31:48 -04:00
parent d267df01fa
commit 9ae961f50f
9 changed files with 310 additions and 61 deletions
+25 -25
View File
@@ -6,40 +6,44 @@
<title>Kanbante — Dashboard</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📋</text></svg>">
<link rel="stylesheet" href="/static/css/style.css">
<script src="https://unpkg.com/[email protected]"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
<script defer src="/static/vendor/alpine.min.js"></script>
</head>
<body>
<header>
<h1><a href="/">📋 <span class="gradient-text">Kanbante</span></a></h1>
<nav>
<a href="/focus" class="btn-sm">🎯 Focus</a>
<span class="badge">{{ active_repos|length }} actifs</span>
<span class="badge secondary">{{ inactive_repos|length }} archivés</span>
<span class="badge secondary">{{ archived_repos|length }} archivés</span>
</nav>
</header>
<main x-data="{ tab: 'active', search: '' }">
<!-- Tabs -->
<!-- Tabs: "actif" = mis à jour dans la fenêtre glissante;
"archivé" = le vrai drapeau Gitea (repo.archived). -->
<div class="tabs">
<button :class="{ active: tab === 'active' }" @click="tab = 'active'">
🟢 Actifs ({{ active_repos|length }})
</button>
<button :class="{ active: tab === 'inactive' }" @click="tab = 'inactive'">
⚪ Archivés ({{ inactive_repos|length }})
💤 Inactifs ({{ inactive_repos|length }})
</button>
<button :class="{ active: tab === 'archived' }" @click="tab = 'archived'">
🗄️ Archivés ({{ archived_repos|length }})
</button>
</div>
<!-- Search -->
<!-- Search: the repo name lives in a data-* attribute (HTML-escaped
by Jinja), never interpolated into a JS string literal. -->
<div class="search-bar">
<input type="text" placeholder="🔍 Filtrer les projets..." x-model="search">
</div>
<!-- Active Projects -->
<div x-show="tab === 'active'" class="project-grid">
{% for repo in active_repos %}
{% macro project_card(repo, archived=False) %}
{% set full = repo.full_name %}
<div class="project-card"
x-show="search === '' || '{{ repo.name.lower() }}{{ repo.full_name.lower() }}'.includes(search.toLowerCase())">
<div class="project-card{% if archived %} archived{% endif %}"
data-search="{{ (repo.name ~ ' ' ~ repo.full_name ~ ' ' ~ (repo.description or ''))|lower }}"
x-show="search === '' || $el.dataset.search.includes(search.toLowerCase())">
<div class="card-header">
<span class="org-tag">{{ repo.owner.login }}</span>
<span class="date">{{ repo.updated_at[:10] }}</span>
@@ -64,27 +68,23 @@
{% endif %}
</div>
</div>
{% endfor %}
{% endmacro %}
<div x-show="tab === 'active'" class="project-grid">
{% for repo in active_repos %}{{ project_card(repo) }}{% endfor %}
</div>
<!-- Inactive Projects -->
<div x-show="tab === 'inactive'" class="project-grid">
{% for repo in inactive_repos %}
<div class="project-card archived"
x-show="search === '' || '{{ repo.name.lower() }}'.includes(search.toLowerCase())">
<div class="card-header">
<span class="org-tag">{{ repo.owner.login }}</span>
<span class="date">{{ repo.updated_at[:10] }}</span>
</div>
<h3>{{ repo.name }}</h3>
<p class="desc">{{ repo.description or '—' }}</p>
</div>
{% endfor %}
{% for repo in inactive_repos %}{{ project_card(repo) }}{% endfor %}
</div>
<div x-show="tab === 'archived'" class="project-grid">
{% for repo in archived_repos %}{{ project_card(repo, archived=True) }}{% endfor %}
</div>
</main>
<footer>
Kanbante v0.1 · {{ active_repos|length + inactive_repos|length }} projets sur Gitea
Kanbante v{{ version }} · {{ active_repos|length + inactive_repos|length + archived_repos|length }} projets sur Gitea · actifs = mis à jour depuis {{ active_window_days }} jours
</footer>
</body>
</html>