feat: roles, permissions, grille full-width, SSO display name
- Admin/roles : tableau des roles avec edition par role (/admin/role/<nom>) - Permissions par role : cases a cocher groupees (Articles, Acces & lecture) - Nouvelles capacites : propose/validate/publish articles (own/all), view_previews - Nom technique auto-genere depuis le label (JS + fallback serveur) - Blocage suppression du dernier administrateur - user_capabilities table ajoutee en DB - Navbar : dropdown unique (nom + Mon identite + Administration + Deconnexion) - SSO callback : preserve le nom personnalise, ne l ecrase plus a la connexion - Grille articles : CSS Grid auto-fill full-width, hauteur uniforme par ligne - CSP : add_files.js et post_confirm.js externalises
This commit is contained in:
+5
-57
@@ -43,6 +43,9 @@ $dateValue = isset($published_at)
|
||||
value="<?= htmlspecialchars($title ?? '') ?>">
|
||||
</div>
|
||||
|
||||
<?php if ($action === 'edit'): ?>
|
||||
<input type="hidden" id="slug" name="slug" value="<?= htmlspecialchars($postSlug ?? '') ?>">
|
||||
<?php else: ?>
|
||||
<div class="mb-3">
|
||||
<label for="slug" class="form-label">
|
||||
Slug <small class="text-muted">(URL : /post/<span id="slug-preview"><?= htmlspecialchars($postSlug ?? '') ?></span>)</small>
|
||||
@@ -52,6 +55,7 @@ $dateValue = isset($published_at)
|
||||
pattern="[a-z0-9][a-z0-9\-]*"
|
||||
placeholder="généré automatiquement depuis le titre">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($action === 'create'): ?>
|
||||
<div class="mb-3">
|
||||
@@ -130,63 +134,6 @@ $dateValue = isset($published_at)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="revision_comment" class="form-label">Commentaire de révision <small class="text-muted">(optionnel)</small></label>
|
||||
<input type="text" class="form-control" id="revision_comment" name="revision_comment"
|
||||
placeholder="ex. Correction typos, ajout section X…">
|
||||
</div>
|
||||
|
||||
<div class="card mb-3 border-secondary">
|
||||
<div class="card-header bg-transparent py-2">
|
||||
<button class="btn btn-sm btn-link text-secondary text-decoration-none p-0 fw-semibold"
|
||||
type="button" data-bs-toggle="collapse" data-bs-target="#seoPanel" aria-expanded="false">
|
||||
▸ SEO — titre, description, image
|
||||
</button>
|
||||
</div>
|
||||
<div class="collapse" id="seoPanel">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="seo_title" class="form-label">
|
||||
Titre SEO
|
||||
<small class="text-muted">(balise <title> et og:title)</small>
|
||||
</label>
|
||||
<input type="text" class="form-control" id="seo_title" name="seo_title"
|
||||
maxlength="70"
|
||||
value="<?= htmlspecialchars($seoTitle ?? '') ?>"
|
||||
placeholder="Généré automatiquement depuis le titre">
|
||||
<div class="d-flex justify-content-between mt-1">
|
||||
<small class="text-muted">Idéal : 30–60 caractères</small>
|
||||
<small id="seo_title_counter" class="text-muted">0 / 60</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="seo_description" class="form-label">
|
||||
Description SEO
|
||||
<small class="text-muted">(meta description et og:description)</small>
|
||||
</label>
|
||||
<textarea class="form-control" id="seo_description" name="seo_description"
|
||||
rows="3" maxlength="200"
|
||||
placeholder="Générée automatiquement depuis le début du contenu"><?= htmlspecialchars($seoDescription ?? '') ?></textarea>
|
||||
<div class="d-flex justify-content-between mt-1">
|
||||
<small class="text-muted">Idéal : 120–155 caractères</small>
|
||||
<small id="seo_desc_counter" class="text-muted">0 / 155</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<label for="og_image" class="form-label">
|
||||
Image Open Graph
|
||||
<small class="text-muted">(URL absolue, optionnel)</small>
|
||||
</label>
|
||||
<input type="url" class="form-control font-monospace" id="og_image" name="og_image"
|
||||
value="<?= htmlspecialchars($ogImage ?? '') ?>"
|
||||
placeholder="https://varlog.a5l.fr/…">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center gap-3 flex-wrap mb-4">
|
||||
<button type="submit" class="btn btn-success">Enregistrer</button>
|
||||
<a href="/" class="btn btn-secondary">Annuler</a>
|
||||
@@ -365,6 +312,7 @@ if ($hasSources):
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if (!empty($article['revisions'])): ?>
|
||||
<hr class="my-4">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user