Add visual CMS, media library and product directory
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
use App\Content\SiteDesign;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<header class="admin-heading"><h1><?= $e($title) ?></h1><a class="button button-outline" href="/" target="_blank" rel="noopener">查看公开网站</a></header>
|
||||
<nav class="filter-nav" aria-label="网站设置">
|
||||
<?php foreach (['header' => '页头', 'footer' => '页脚', 'cdn' => 'CDN'] as $key => $text): ?>
|
||||
<a href="/admin/settings/<?= $key ?>" <?= $key === $part ? 'aria-current="page"' : '' ?>><?= $text ?></a>
|
||||
<?php endforeach ?>
|
||||
</nav>
|
||||
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
|
||||
<form class="admin-form admin-panel settings-form" method="post" action="/admin/settings/<?= $e($part) ?>">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($revision) ?>">
|
||||
<?php if ($part === 'cdn'): ?>
|
||||
<label>CDN 源站地址<input name="origin" type="url" value="<?= $e($config['origin']) ?>" placeholder="https://cdn.laysense.cn">
|
||||
<small>留空时直接从站点提供资源。配置后,公开页面中的 /assets/ 路径会改用此域名。</small>
|
||||
</label>
|
||||
<?php else: ?>
|
||||
<?= View::fragment('studio-asset-field', ['label' => '站点标志', 'name' => 'logo', 'value' => $config['logo']]) ?>
|
||||
<label>标志替代文本<input name="alt" value="<?= $e($config['alt']) ?>" maxlength="200"></label>
|
||||
<?php if ($part === 'header'): ?>
|
||||
<label>主导航<textarea name="links" rows="6" placeholder="产品与服务 | /services"><?= $e(SiteDesign::linkText($config['links'])) ?></textarea>
|
||||
<small>每行填写「文案 | 链接」,按输入顺序展示。</small>
|
||||
</label>
|
||||
<label>右侧按钮<input name="button" value="<?= $e($config['button'] ? SiteDesign::linkText([$config['button']]) : '') ?>" placeholder="联系来笙 | #contact"></label>
|
||||
<?php else: ?>
|
||||
<div class="form-grid">
|
||||
<?php foreach (['name' => '公司名称', 'address' => '联系地址', 'email' => '邮箱', 'registration' => '备案号', 'copyright' => '版权信息'] as $key => $text): ?>
|
||||
<label><?= $text ?><input name="<?= $key ?>" value="<?= $e($config[$key] ?? '') ?>" <?= $key === 'name' ? 'required' : '' ?>></label>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<label>联系号码<textarea name="phones" rows="3"><?= $e(SiteDesign::linkText($config['phones'])) ?></textarea>
|
||||
<small>每行填写「显示号码 | tel:号码」。</small>
|
||||
</label>
|
||||
<div class="form-grid">
|
||||
<?php foreach (['products' => '第一列', 'company' => '第二列'] as $key => $text): ?>
|
||||
<div class="admin-form">
|
||||
<label><?= $text ?>标题<input name="<?= $key ?>_title" value="<?= $e($config[$key . '_title']) ?>"></label>
|
||||
<label><?= $text ?>链接<textarea name="<?= $key ?>" rows="6"><?= $e(SiteDesign::linkText($config[$key])) ?></textarea>
|
||||
<small>每行填写「文案 | 链接」。</small>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<label>页脚备注<textarea name="terms" rows="2"><?= $e($config['terms'] ?? '') ?></textarea></label>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<div class="form-submit"><button class="button button-primary" type="submit">保存设置</button></div>
|
||||
</form>
|
||||
Reference in New Issue
Block a user