Reflow home shortcuts and support article deletion
This commit is contained in:
@@ -51,3 +51,14 @@ $e = View::escape(...);
|
||||
<button class="button button-primary" type="submit">保存文章</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php if ($articleId !== null): ?>
|
||||
<details class="admin-panel admin-options">
|
||||
<summary>删除文章</summary>
|
||||
<form method="post" action="/admin/articles/<?= $e($articleId) ?>/delete">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($article['version']) ?>">
|
||||
<p class="field-note">删除后,文章及其目录卡片会从网站移除,且无法恢复。</p>
|
||||
<button class="button button-danger" type="submit">永久删除</button>
|
||||
</form>
|
||||
</details>
|
||||
<?php endif ?>
|
||||
|
||||
@@ -12,6 +12,7 @@ $filters = $category ? 'category=' . rawurlencode($category) . '&' : '';
|
||||
<a class="button button-primary" href="/admin/articles/new<?= $category ? '?category=' . $e($category) : '' ?>">新建文章</a>
|
||||
</div>
|
||||
</header>
|
||||
<?php if ($deleted): ?><p class="feedback success" role="status">文章已删除。</p><?php endif ?>
|
||||
<nav class="filter-nav" aria-label="筛选文章">
|
||||
<a href="/admin/articles" <?= $category === null ? 'aria-current="page"' : '' ?>>全部</a>
|
||||
<?php foreach ($categories as $key => $name): ?>
|
||||
|
||||
Reference in New Issue
Block a user