Add canvas element tools and categorized article editing
This commit is contained in:
+13
-7
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
use App\Content\Html;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
@@ -15,17 +16,22 @@ $e = View::escape(...);
|
||||
<?php if (!$products): ?><p class="empty-state">暂无可查看的产品和服务。</p><?php endif ?>
|
||||
<div class="catalog-grid">
|
||||
<?php foreach ($products as $product): ?>
|
||||
<?php $card = $product['card']; $articlePath = '/articles/' . $product['slug']; ?>
|
||||
<article class="catalog-card">
|
||||
<?php if ($product['image']): ?>
|
||||
<div class="catalog-image"><img src="<?= $e($product['image']) ?>" alt="<?= $e($product['alt']) ?>" loading="lazy"></div>
|
||||
<?php if (!empty($card['image'])): ?>
|
||||
<div class="catalog-image"><img src="<?= $e($card['image']) ?>" alt="<?= $e($card['alt'] ?? '') ?>" loading="lazy"></div>
|
||||
<?php endif ?>
|
||||
<div class="catalog-content">
|
||||
<p class="overline"><?= $e($product['category']) ?></p>
|
||||
<h2><?= $e($product['name']) ?></h2>
|
||||
<div class="rich"><?= $product['body'] ?></div>
|
||||
<?php if (!empty($card['category_label'])): ?><p class="overline"><?= $e($card['category_label']) ?></p><?php endif ?>
|
||||
<h2><a href="<?= $e($articlePath) ?>"><?= $e($product['title']) ?></a></h2>
|
||||
<?php if ($product['summary']): ?>
|
||||
<p><?= $e($product['summary']) ?></p>
|
||||
<?php else: ?>
|
||||
<div class="rich"><?= Html::articleBody($product) ?></div>
|
||||
<?php endif ?>
|
||||
<div class="actions">
|
||||
<a class="button button-primary" href="<?= $e($product['url']) ?>"><?= $e($product['label']) ?></a>
|
||||
<?php if ($product['extra_url']): ?><a href="<?= $e($product['extra_url']) ?>"><?= $e($product['extra_label']) ?></a><?php endif ?>
|
||||
<a class="button button-primary" href="<?= $e(($card['url'] ?? '') ?: $articlePath) ?>"><?= $e(($card['label'] ?? '') ?: '了解详情') ?></a>
|
||||
<?php if (!empty($card['extra_url'])): ?><a href="<?= $e($card['extra_url']) ?>"><?= $e(($card['extra_label'] ?? '') ?: '相关链接') ?></a><?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user