forked from laysense/laysense.cn
Manage dynamic blocks and expand the editor library
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
use App\Content\BlockTemplates;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<details class="studio-anchor-create">
|
||||
<summary>按锚点新建区块</summary>
|
||||
<form class="admin-form" method="post" action="/admin/page-blocks/<?= $e($slug) ?>">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="operation" value="create">
|
||||
<label>锚点<input name="key" pattern="[a-z0-9]+(-[a-z0-9]+)*" maxlength="70" placeholder="overview" required></label>
|
||||
<label>模板<select name="preset">
|
||||
<?php foreach (BlockTemplates::groups() as [$category, $templates]): ?>
|
||||
<optgroup label="<?= $e($category) ?>">
|
||||
<?php foreach ($templates as $preset => [$label]): ?>
|
||||
<option value="<?= $e($preset) ?>"><?= $e($label) ?></option>
|
||||
<?php endforeach ?>
|
||||
</optgroup>
|
||||
<?php endforeach ?>
|
||||
</select></label>
|
||||
<button type="submit" class="button button-outline">新建</button>
|
||||
</form>
|
||||
</details>
|
||||
Reference in New Issue
Block a user