Prepare LaySite 1.5.0 canvas and publishing improvements

This commit is contained in:
2026-11-28 01:32:59 +08:00
parent cfa1f02912
commit 044da13a8c
25 changed files with 891 additions and 171 deletions
+17 -5
View File
@@ -6,6 +6,7 @@ $e = View::escape(...);
<a class="back-link" href="/admin/articles">返回文章列表</a>
<header class="admin-heading"><h1>文章分类</h1></header>
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
<?php if ($deleted): ?><p class="feedback success" data-save-confirmation role="status">分类已删除。</p><?php endif ?>
<form class="admin-form admin-panel" method="post" action="/admin/article-categories">
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
<div class="form-grid">
@@ -14,8 +15,19 @@ $e = View::escape(...);
</div>
<div class="form-submit"><button class="button button-primary" type="submit">创建分类</button></div>
</form>
<nav class="filter-nav" aria-label="查看分类">
<?php foreach ($categories as $key => $label): ?>
<a href="/admin/articles?category=<?= $e($key) ?>"><?= $e($label) ?></a>
<?php endforeach ?>
</nav>
<section class="admin-panel">
<h2>已有分类</h2>
<?php if (!$categories): ?><p class="field-note">暂无文章分类。</p><?php endif ?>
<ul class="admin-list">
<?php foreach ($categories as $key => $label): ?>
<li>
<a href="/admin/articles?category=<?= $e($key) ?>"><?= $e($label) ?></a>
<form method="post" action="/admin/article-categories/<?= $e($key) ?>/delete">
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
<button type="submit" class="button button-outline destructive-action"
data-confirm="<?= $e('删除「' . $label . '」后,文章会保留,引用该分类的动态组件将移除这个分类。') ?>"><?= View::fragment('studio-icon', ['icon' => 'delete']) ?>删除分类</button>
</form>
</li>
<?php endforeach ?>
</ul>
</section>