first commit

This commit is contained in:
julien
2026-03-20 22:16:20 +01:00
commit 42a4ba3e9a
136 changed files with 10141 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
{% extends "@Kernel/layout.twig" %}
{% block title %}{{ status }} {{ site.title }}{% endblock %}
{% block content %}
<div class="error-page">
<h2 class="error-page__code">{{ status }}</h2>
<p class="error-page__message">{{ message }}</p>
<p><a href="/">← Retour à l'accueil</a></p>
</div>
{% endblock %}

View File

@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{{ site.title }}{% endblock %}</title>
{% block meta %}
<meta name="description" content="{{ site.metaDescription }}">
{% endblock %}
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="stylesheet" href="/assets/css/main.css">
{% block styles %}{% endblock %}
</head>
<body>
{% include '@Kernel/partials/_header.twig' %}
<main class="site-main">
<div class="site-main__inner">
{% block content %}{% endblock %}
</div>
</main>
{% include '@Kernel/partials/_footer.twig' %}
{% block scripts %}{% endblock %}
</body>
</html>

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{{ site.title }} Médiathèque{% endblock %}</title>
{% block meta %}
<meta name="description" content="Sélecteur de médias de {{ site.title }}.">
{% endblock %}
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="stylesheet" href="/assets/css/main.css">
{% block styles %}{% endblock %}
</head>
<body class="picker-layout">
<main class="picker-layout__inner">
{% block content %}{% endblock %}
</main>
{% block scripts %}{% endblock %}
</body>
</html>

View File

@@ -0,0 +1,41 @@
{#
Boîte d'ajout réutilisable dans l'admin.
Usage type :
{% embed '@Kernel/partials/_admin_create_box.twig' with {
title: 'Ajouter un élément',
hint: 'Le contenu de la boîte est piloté par le module consommateur.',
form: { action: '/admin/items/create' }
} %}
{% block fields %}...{% endblock %}
{% block actions %}...{% endblock %}
{% endembed %}
#}
{% set form = form|default({}) %}
{% set extra = form.extra|default({}) %}
<div class="admin-create">
<h3 class="admin-create__title">{{ title }}</h3>
<form
{% if form.id is defined %}id="{{ form.id }}"{% endif %}
method="{{ form.method|default('post') }}"
{% if form.action is defined %}action="{{ form.action }}"{% endif %}
{% if form.enctype is defined %}enctype="{{ form.enctype }}"{% endif %}
class="admin-create__form{% if form.class is defined %} {{ form.class }}{% endif %}"
{% for name, value in extra %} {{ name }}="{{ value }}"{% endfor %}
>
{% include '@Kernel/partials/_csrf_fields.twig' %}
{% block fields %}{% endblock %}
<div class="admin-create__actions">
{% block actions %}{% endblock %}
</div>
</form>
{% if hint is defined and hint %}
<p class="admin-create__hint">{{ hint }}</p>
{% endif %}
</div>

View File

@@ -0,0 +1,7 @@
<form method="post" action="{{ action }}" class="admin-table__form"{% if confirm is defined and confirm %} onsubmit="return confirm('{{ confirm|e('js') }}')"{% endif %}>
{% include '@Kernel/partials/_csrf_fields.twig' %}
<button type="submit" class="btn btn--sm btn--danger"
{% if disabled is defined and disabled %}disabled{% if disabled_title is defined and disabled_title %} title="{{ disabled_title }}"{% endif %}{% endif %}>
{{ label|default('Supprimer') }}
</button>
</form>

View File

@@ -0,0 +1,22 @@
{#
Convention canonique : primary_label / secondary_href / secondary_label.
Compatibilité conservée avec submit_label / cancel_href / cancel_label.
#}
{% set resolved_primary_label = primary_label|default(submit_label|default(null)) %}
{% set resolved_secondary_href = secondary_href|default(cancel_href|default(null)) %}
{% set resolved_secondary_label = secondary_label|default(cancel_label|default(null)) %}
<div class="form-container__actions">
{% if resolved_primary_label %}
<div class="form-container__action">
<button type="submit" class="btn btn--primary btn--lg btn--full">{{ resolved_primary_label }}</button>
</div>
{% endif %}
{% if resolved_secondary_href and resolved_secondary_label %}
<div class="form-container__action">
<a href="{{ resolved_secondary_href }}" class="btn btn--secondary btn--lg btn--full">{{ resolved_secondary_label }}</a>
</div>
{% endif %}
</div>

View File

@@ -0,0 +1,14 @@
<nav class="admin-nav">
<a href="/admin">Vue densemble</a>
{% if session.role is defined and session.role in ['admin', 'editor'] %}
| <a href="/admin/posts">Articles</a>
| <a href="/admin/media">Médias</a>
| <a href="/admin/categories">Taxonomie</a>
{% endif %}
{% if session.role is defined and session.role == 'admin' %}
| <a href="/admin/settings">Réglages</a>
| <a href="/admin/audit-log">Audit</a>
| <a href="/admin/notifications">Notifications</a>
| <a href="/admin/users">Utilisateurs</a>
{% endif %}
</nav>

View File

@@ -0,0 +1,23 @@
<div class="admin-page-header">
<div class="admin-page-header__body">
<h2 class="admin-page-header__title">{{ title }}</h2>
{% if intro is defined and intro %}
<p class="admin-page-header__intro">{{ intro }}</p>
{% endif %}
</div>
{% if (primary_action_href is defined and primary_action_href and primary_action_label is defined and primary_action_label)
or (secondary_action_href is defined and secondary_action_href and secondary_action_label is defined and secondary_action_label) %}
<div class="admin-page-header__actions">
{% if secondary_action_href is defined and secondary_action_href and secondary_action_label is defined and secondary_action_label %}
<a href="{{ secondary_action_href }}" class="btn btn--secondary">{{ secondary_action_label }}</a>
{% endif %}
{% if primary_action_href is defined and primary_action_href and primary_action_label is defined and primary_action_label %}
<a href="{{ primary_action_href }}" class="btn btn--primary">{{ primary_action_label }}</a>
{% endif %}
</div>
{% endif %}
</div>
{% include '@Kernel/partials/_admin_nav.twig' %}

View File

@@ -0,0 +1,6 @@
<div class="form-container__header">
<h2 class="form-container__title">{{ title }}</h2>
{% if intro is defined and intro %}
<p class="form-container__intro">{{ intro }}</p>
{% endif %}
</div>

View File

@@ -0,0 +1,6 @@
{% set tag = href is defined and href ? 'a' : 'span' %}
{% set classes = ['badge'] %}
{% if modifier is defined and modifier %}
{% set classes = classes|merge(['badge--' ~ modifier]) %}
{% endif %}
<{{ tag }}{% if href is defined and href %} href="{{ href }}"{% endif %} class="{{ classes|join(' ') }}">{{ label }}</{{ tag }}>

View File

@@ -0,0 +1,2 @@
<input type="hidden" name="{{ csrf.keys.name }}" value="{{ csrf.name }}">
<input type="hidden" name="{{ csrf.keys.value }}" value="{{ csrf.value }}">

View File

@@ -0,0 +1,13 @@
<div class="empty-state">
{% if title is defined and title %}
<h3 class="empty-state__title">{{ title }}</h3>
{% endif %}
<p class="empty-state__message">{{ message }}</p>
{% if action_href is defined and action_href and action_label is defined and action_label %}
<div class="empty-state__actions">
<a href="{{ action_href }}" class="btn btn--secondary">{{ action_label }}</a>
</div>
{% endif %}
</div>

View File

@@ -0,0 +1,7 @@
{% if error is defined and error %}
<div class="alert alert--danger" role="alert">{{ error }}</div>
{% endif %}
{% if success is defined and success %}
<div class="alert alert--success" role="status">{{ success }}</div>
{% endif %}

View File

@@ -0,0 +1,6 @@
<footer class="site-footer">
<p>
&copy; {{ "now"|date("Y") }} {{ site.title }} Propulsé par <a href="https://netig.net">NETig</a>
<a href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr" rel="license">CC BY-SA 4.0</a>
</p>
</footer>

View File

@@ -0,0 +1,28 @@
<header class="site-header">
<div class="site-header__inner">
<div>
<h1 class="site-header__logo">
<a href="/" class="site-header__logo-link">{{ site.title }}</a>
</h1>
{% if site.tagline %}
<p class="site-header__tagline">{{ site.tagline }}</p>
{% endif %}
</div>
<nav class="site-header__nav">
{% if session.user_id is defined and session.user_id %}
<span class="site-header__user">
Connecté en tant que : <strong>{{ session.username }}</strong>
</span>
<a href="/admin" class="site-header__action">Administration</a>
<a href="/account/password" class="site-header__action">Mon compte</a>
<form method="post" action="/auth/logout" class="u-inline-form">
{% include '@Kernel/partials/_csrf_fields.twig' %}
<button type="submit" class="site-header__action">Déconnexion</button>
</form>
{% else %}
<a href="/auth/login" class="site-header__action">Connexion</a>
{% endif %}
</nav>
</div>
</header>

View File

@@ -0,0 +1,29 @@
{% if pagination.totalPages > 1 %}
<nav class="pagination" aria-label="Pagination">
{% if pagination.hasPrevious %}
<a href="{{ pagination.previousUrl }}" class="pagination__control pagination__control--previous btn btn--sm btn--secondary">← Précédent</a>
{% else %}
<span class="pagination__control pagination__control--disabled" aria-disabled="true">← Précédent</span>
{% endif %}
<span class="pagination__summary">
Page {{ pagination.currentPage }} sur {{ pagination.totalPages }}
</span>
<span class="pagination__pages" aria-label="Pages">
{% for page in pagination.pages %}
{% if page.current %}
<span class="pagination__link pagination__link--current" aria-current="page">{{ page.number }}</span>
{% else %}
<a href="{{ page.url }}" class="pagination__link">{{ page.number }}</a>
{% endif %}
{% endfor %}
</span>
{% if pagination.hasNext %}
<a href="{{ pagination.nextUrl }}" class="pagination__control pagination__control--next btn btn--sm btn--secondary">Suivant →</a>
{% else %}
<span class="pagination__control pagination__control--disabled" aria-disabled="true">Suivant →</span>
{% endif %}
</nav>
{% endif %}