Files
folio/templates/wizard/step2.php
T
cedricAbonnel 6895a3bf65 feat #58 : wizard multi-étapes création/édition d'article
Remplace le formulaire unique par un wizard 5 étapes (création) et
6 étapes (édition) avec auto-sauvegarde en brouillon, détection de
tags depuis le texte (TagSuggester), aperçu SEO, diff avant validation
et plan Markdown dynamique dans l'éditeur.

Détail des changements :
- ArticleManager : +6 méthodes (updatePartialMeta, saveDraftOverlay,
  getDraftOverlay, hasDraftOverlay, discardDraftOverlay, commitDraftOverlay)
- .htaccess : routes /new/{uuid}/{1-5} et /edit/{uuid}/{1-6}
- index.php : cases create et edit réécrits en switch($step),
  nouveau case autosave_draft et edit_discard_draft
- assets/js/wizard.js : autosave debounce, auto-resize textarea,
  scroll curseur, plan TOC dynamique, toggle pills tags
- templates/wizard/ : nav.php + step1..6.php

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 21:46:11 +02:00

59 lines
2.6 KiB
PHP

<?php
ob_start();
$_dateVal = isset($published_at)
? (str_contains((string)$published_at, ' ')
? date('Y-m-d\TH:i', strtotime((string)$published_at))
: (string)$published_at)
: date('Y-m-d\TH:i');
$_backUrl = $mode === 'create' ? '/new/' . rawurlencode($uuid) . '/1' : '/edit/' . rawurlencode($uuid) . '/1';
$_formAction = $mode === 'create' ? '/new/' . rawurlencode($uuid) . '/2' : '/edit/' . rawurlencode($uuid) . '/2';
?>
<form method="POST" action="<?= htmlspecialchars($_formAction) ?>">
<div class="d-flex align-items-center justify-content-between gap-3 mb-4 flex-wrap">
<h1 class="h4 mb-0">Publication</h1>
<div class="d-flex gap-2">
<a href="<?= htmlspecialchars($_backUrl) ?>" class="btn btn-outline-secondary btn-sm">← Retour</a>
<button type="submit" class="btn btn-primary">Suivant →</button>
</div>
</div>
<?php include __DIR__ . '/nav.php'; ?>
<div class="row justify-content-start">
<div class="col-lg-6">
<div class="card mb-4">
<div class="card-body">
<div class="mb-4">
<p class="fw-semibold mb-2">Visibilité</p>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="published" id="pub-yes" value="1"
<?= ($published ?? false) ? 'checked' : '' ?>>
<label class="form-check-label" for="pub-yes">Public</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="published" id="pub-no" value=""
<?= !($published ?? false) ? 'checked' : '' ?>>
<label class="form-check-label" for="pub-no">Brouillon (privé)</label>
</div>
<div class="form-text mt-1">Un brouillon n'est visible que par les utilisateurs authentifiés.</div>
</div>
<div>
<label for="published_at" class="form-label fw-semibold">Date de publication</label>
<input type="datetime-local" class="form-control" id="published_at" name="published_at"
value="<?= htmlspecialchars($_dateVal) ?>">
<div class="form-text">Une date future crée une avant-première (visible aux utilisateurs avec la capacité <code>view_previews</code>).</div>
</div>
</div>
</div>
</div>
</div>
</form>
<?php
$content = ob_get_clean();
$title = 'Publication — Étape 2/' . $totalSteps;
include BASE_PATH . '/templates/layout.php';