Add page publication history and reusable blocks

This commit is contained in:
2026-11-28 18:12:30 +08:00
parent 1c927d360c
commit 3b13f6533d
40 changed files with 1239 additions and 165 deletions
+3 -2
View File
@@ -49,7 +49,7 @@ $live = count(array_filter($regular, static fn (array $page): bool => $page['sta
$deleteNote .= '删除后,此页面将从首页候选中移除。';
}
$published = $page['status'] === 'published';
$public = ($kind === null || $home) && $published;
$public = $page['public_slug'] !== null;
?>
<li data-page-item="<?= $e($kind ?? $page['status']) ?>" data-page-public-status="<?= $e($kind === null || $home ? $page['status'] : '') ?>" data-page-label="<?= $e($page['name'] . ' ' . $page['title'] . ' ' . ($kind ? $label : $path)) ?>">
<div class="dashboard-page-label"><strong><?= $e($page['name']) ?></strong>
@@ -61,10 +61,11 @@ $live = count(array_filter($regular, static fn (array $page): bool => $page['sta
<div class="dashboard-page-actions">
<a class="button button-outline" href="/admin/pages/<?= $e($page['slug']) ?>"><?= View::fragment('studio-icon', ['icon' => 'edit']) ?>编辑页面</a>
<?= View::fragment('admin-view-link', [
'href' => $public ? $path : '/admin/pages/' . $page['slug'] . '/preview',
'href' => $public ? '/' . $page['public_slug'] : '/admin/pages/' . $page['slug'] . '/preview',
'icon' => $public ? 'external' : 'preview',
'label' => ($public ? '查看公开页面' : '预览页面') . ' · ' . $page['name'],
]) ?>
<?= View::fragment('admin-view-link', ['href' => '/admin/copy-page/' . $page['slug'], 'icon' => 'copy', 'label' => '复制页面 · ' . $page['name'], 'newTab' => false]) ?>
<form method="post" action="/admin/pages/<?= $e($page['slug']) ?>/delete">
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
<input type="hidden" name="version" value="<?= $e($page['version']) ?>">