Migrate Laysense to upstream LaySite 1.4.3 with external site data
This commit is contained in:
@@ -1,60 +1,31 @@
|
||||
<?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>
|
||||
<a class="back-link" href="/admin/design">返回站点设计</a>
|
||||
<header class="admin-heading"><h1>站点设置</h1></header>
|
||||
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
|
||||
<form class="admin-form admin-panel settings-form" method="post" action="/admin/settings/<?= $e($part) ?>">
|
||||
<form class="admin-form admin-panel" method="post" action="/admin/settings">
|
||||
<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>
|
||||
<input type="hidden" name="version" value="<?= $e($version) ?>">
|
||||
<label>站点名称<input name="name" value="<?= $e($name) ?>" maxlength="100" required></label>
|
||||
<label>静态资源 CDN<input name="cdn" value="<?= $e($cdn) ?>" placeholder="https://cdn.example.com"><small>填写后,公开页面的 /assets/ 文件从该地址加载。</small></label>
|
||||
<fieldset class="settings-stack">
|
||||
<legend>系统页面</legend>
|
||||
<?php foreach (['maintenance' => ['maintenance_page', '维护页', '选择已发布的维护页'], 'not-found' => ['not_found_page', '404 页', '使用系统 404 页']] as $type => [$field, $label, $placeholder]): ?>
|
||||
<label><?= $e($label) ?><select name="<?= $e($field) ?>">
|
||||
<option value=""><?= $e($placeholder) ?></option>
|
||||
<?php foreach ($systemChoices[$type] ?? [] as $slug => $name): ?>
|
||||
<option value="<?= $e($slug) ?>"<?= ($systemPages[$type] ?? null) === $slug ? ' selected' : '' ?>><?= $e($name) ?></option>
|
||||
<?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' => '第二列', 'resources' => '第三列'] 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>
|
||||
</select></label>
|
||||
<?php if (empty($systemChoices[$type])): ?>
|
||||
<a class="back-link" href="/admin/new-page?type=<?= $e($type) ?>">新建<?= $e($label) ?></a>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
<label><input type="checkbox" name="maintenance_enabled" value="1"<?= $maintenance ? ' checked' : '' ?>> 开启维护模式</label>
|
||||
<p class="field-note">开启后,访客会看到维护页。后台仍可登录和编辑。</p>
|
||||
</fieldset>
|
||||
<button type="submit" class="button button-primary"><?= View::fragment('studio-icon', ['icon' => 'save']) ?>保存设置</button>
|
||||
</form>
|
||||
<?php if ($part === 'footer'): ?>
|
||||
<form method="post" action="/admin/settings/footer">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($revision) ?>">
|
||||
<input type="hidden" name="operation" value="restore-footer">
|
||||
<button class="button button-outline" type="submit" data-confirm="用原站的页脚内容覆盖当前页脚设置?">恢复原站页脚</button>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
|
||||
Reference in New Issue
Block a user