Merge pull request '恢复原站页脚和独立资源链接' (#11) from ChatGPT/laysense.cn:restore-original-footer into main
This commit was merged in pull request #11.
This commit is contained in:
+25
-15
@@ -8,7 +8,7 @@ $e = View::escape(...);
|
||||
<div class="footer-grid">
|
||||
<div class="footer-company" itemscope itemtype="https://schema.org/Organization">
|
||||
<?php if ($footer['logo'] !== ''): ?>
|
||||
<a href="/" itemprop="url" aria-label="来笙 Laysense 首页">
|
||||
<a class="footer-logo" href="/" itemprop="url" aria-label="来笙 Laysense 首页">
|
||||
<img src="<?= $e($footer['logo']) ?>" alt="<?= $e($footer['alt']) ?>" width="130" height="33" itemprop="logo" loading="lazy">
|
||||
</a>
|
||||
<?php endif ?>
|
||||
@@ -17,31 +17,41 @@ $e = View::escape(...);
|
||||
<?php if ($footer['email']): ?>
|
||||
<a itemprop="email" href="mailto:<?= $e($footer['email']) ?>"><?= $e($footer['email']) ?></a>
|
||||
<?php endif ?>
|
||||
<p class="footer-payment-label">支持的付款方式</p>
|
||||
<div class="payment-methods" aria-label="支持的付款方式">
|
||||
<img src="/assets/original/payment-taobao.png" alt="淘宝" width="26" height="26" loading="lazy">
|
||||
<img src="/assets/original/payment-alipay.png" alt="支付宝" width="26" height="26" loading="lazy">
|
||||
<img src="/assets/original/payment-wechat.png" alt="微信支付" width="26" height="26" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach (['products', 'company'] as $group): ?>
|
||||
<?php if (!$footer[$group] && $footer[$group . '_title'] === '') { continue; } ?>
|
||||
<div>
|
||||
<?php if ($footer[$group . '_title'] !== ''): ?><p class="footer-label"><?= $e($footer[$group . '_title']) ?></p><?php endif ?>
|
||||
<?php foreach ($footer[$group] as [$url, $label]): ?><a href="<?= $e($url) ?>"><?= $e($label) ?></a><?php endforeach ?>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<nav class="footer-links" aria-label="页脚导航">
|
||||
<?php foreach (['products', 'company', 'resources'] as $group): ?>
|
||||
<?php if (!$footer[$group] && $footer[$group . '_title'] === '') { continue; } ?>
|
||||
<div>
|
||||
<?php if ($footer[$group . '_title'] !== ''): ?><h2 class="footer-label"><?= $e($footer[$group . '_title']) ?></h2><?php endif ?>
|
||||
<?php if ($footer[$group]): ?>
|
||||
<ul>
|
||||
<?php foreach ($footer[$group] as [$url, $label]): ?><li><a href="<?= $e($url) ?>"><?= $e($label) ?></a></li><?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="footer-meta">
|
||||
<?php if ($footer['copyright']): ?><p><?= $e($footer['copyright']) ?> 2024–<?= $e(date('Y')) ?></p><?php endif ?>
|
||||
<?php if ($footer['phones']): ?>
|
||||
<p>全球号码
|
||||
<?php foreach ($footer['phones'] as $index => [$url, $label]): ?>
|
||||
<?= $index ? ' / ' : '' ?><a href="<?= $e($url) ?>"><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
<?php if ($footer['copyright']): ?><p><?= $e($footer['copyright']) ?></p><?php endif ?>
|
||||
<?php if ($footer['email'] || $footer['phones']): ?>
|
||||
<p>
|
||||
<?php if ($footer['email']): ?><a href="mailto:<?= $e($footer['email']) ?>"><?= $e($footer['email']) ?></a><?php endif ?>
|
||||
<?php if ($footer['phones']): ?>全球号码:
|
||||
<?php foreach ($footer['phones'] as $index => [$url, $label]): ?>
|
||||
<?= $index ? ' / ' : '' ?><a href="<?= $e($url) ?>"><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
<?php if ($footer['registration']): ?><a href="https://beian.miit.gov.cn/"><?= $e($footer['registration']) ?></a><?php endif ?>
|
||||
<?php if ($footer['terms']): ?><p class="footer-terms"><?= $e($footer['terms']) ?></p><?php endif ?>
|
||||
<?php if ($footer['registration']): ?><p><a href="https://beian.miit.gov.cn/"><?= $e($footer['registration']) ?></a></p><?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ if (str_starts_with($imageUrl, '/')) {
|
||||
$kind = in_array($page['slug'] ?? '', ['sc', 'shnu-sc'], true) ? 'service' : 'software';
|
||||
$siteKind = $kind === 'service' ? 'other' : 'software';
|
||||
$header = ($site['header'] ?? []) + SiteDesign::DEFAULT_HEADER;
|
||||
$footer = ($site['footer'] ?? []) + SiteDesign::DEFAULT_FOOTER + $site;
|
||||
$footer = SiteDesign::footer($site);
|
||||
$nav = $header['links'];
|
||||
$contact = $header['button'];
|
||||
?>
|
||||
|
||||
@@ -36,7 +36,7 @@ $e = View::escape(...);
|
||||
<small>每行填写「显示号码 | tel:号码」。</small>
|
||||
</label>
|
||||
<div class="form-grid">
|
||||
<?php foreach (['products' => '第一列', 'company' => '第二列'] as $key => $text): ?>
|
||||
<?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>
|
||||
@@ -50,3 +50,11 @@ $e = View::escape(...);
|
||||
<?php endif ?>
|
||||
<div class="form-submit"><button class="button button-primary" type="submit">保存设置</button></div>
|
||||
</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