Files

24 lines
1.2 KiB
PHP

<?php
use App\Content\View;
$e = View::escape(...);
?>
<div class="article-feed" <?= count($groups) > 1 ? 'data-article-tabs' : '' ?>>
<?php if (count($groups) > 1): ?>
<div class="filter-nav article-tabs" data-tab-list role="tablist" aria-labelledby="heading-<?= $e($sectionKey) ?>" hidden>
<?php foreach ($groups as $index => $group): ?>
<button type="button" role="tab" id="<?= $e($sectionKey) ?>-tab-<?= $index ?>" aria-controls="<?= $e($sectionKey) ?>-articles-<?= $index ?>"><?= $e($group['label']) ?></button>
<?php endforeach ?>
</div>
<?php endif ?>
<?php foreach ($groups as $index => $group): ?>
<div id="<?= $e($sectionKey) ?>-articles-<?= $index ?>" data-tab-panel>
<?php if ($group['label'] !== ''): ?><h3 data-tab-heading><?= $e($group['label']) ?></h3><?php endif ?>
<?= View::fragment('article-list', ['articles' => $group['articles'], 'categoryScope' => $group['categories']]) ?>
</div>
<?php endforeach ?>
<?php if ($archivePath !== null): ?>
<p class="article-feed-archive"><a class="back-link" href="<?= $e($archivePath) ?>">查看全部动态</a></p>
<?php endif ?>
</div>