04a2034975
- storefront 全站改为极简黑白配色:直角、细线分隔、卡片 hover 浅底、深色模式(跟随系统+手动切换) - 抽出 storefront/partials/card 复用卡片 - 一并提交此前暂存的客户端注册 API、站点设置、后台页面与测试 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
71 lines
3.1 KiB
PHP
71 lines
3.1 KiB
PHP
@extends('storefront.layout', ['title' => (config('app.name', 'Tstore')) . ' · ' . ($type === 'plugin' ? '插件目录' : '主题目录')])
|
|
|
|
@php
|
|
$typeLabel = $type === 'plugin' ? '插件' : '主题';
|
|
$fallback = $type === 'plugin' ? 'P' : 'T';
|
|
$selectedCategory = '';
|
|
foreach ($categories as $category) {
|
|
if ($filters['category'] === $category->slug) {
|
|
$selectedCategory = $category->name;
|
|
break;
|
|
}
|
|
}
|
|
$sortLabel = $filters['sort'] === 'name' ? '名称排序' : '最近更新';
|
|
@endphp
|
|
|
|
@section('hero')
|
|
<section class="hero">
|
|
<div class="container">
|
|
<span class="eyebrow">{{ $typeLabel }}</span>
|
|
<h1 class="headline">{{ $typeLabel }}目录</h1>
|
|
<p class="lede">统一浏览 {{ $typeLabel }} 的摘要、分类、作者和版本,筛选逻辑保持轻量,适合做公开展示与目录导航。</p>
|
|
<form method="get" class="filter-bar">
|
|
<div class="field" style="flex:2 1 260px">
|
|
<label>关键词</label>
|
|
<input class="input" type="text" name="keyword" value="{{ $filters['keyword'] }}" placeholder="搜索名称、slug 或摘要">
|
|
</div>
|
|
<div class="field" style="flex:1 1 180px">
|
|
<label>分类</label>
|
|
<select class="select" name="category">
|
|
<option value="">全部</option>
|
|
@foreach($categories as $category)
|
|
<option value="{{ $category->slug }}" @selected($filters['category'] === $category->slug)>{{ $category->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="field" style="flex:1 1 160px">
|
|
<label>排序</label>
|
|
<select class="select" name="sort">
|
|
<option value="latest" @selected($filters['sort'] === 'latest')>最近更新</option>
|
|
<option value="name" @selected($filters['sort'] === 'name')>按名称</option>
|
|
</select>
|
|
</div>
|
|
<button class="btn" type="submit">应用筛选</button>
|
|
<a class="btn ghost" href="{{ route($type === 'plugin' ? 'storefront.plugins' : 'storefront.themes') }}">重置</a>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<section class="section">
|
|
<div class="container">
|
|
<div class="section-head">
|
|
<div>
|
|
<span class="section-kicker">Catalog</span>
|
|
<h2>{{ $typeLabel }}列表</h2>
|
|
<p>共找到 {{ $packages->total() }} 个结果 · 当前分类 {{ $selectedCategory ?: '全部' }} · {{ $sortLabel }}。</p>
|
|
</div>
|
|
</div>
|
|
<div class="grid">
|
|
@forelse($packages as $package)
|
|
@include('storefront.partials.card', ['package' => $package, 'typeLabel' => $typeLabel, 'fallback' => $fallback])
|
|
@empty
|
|
<div class="empty">当前没有符合条件的{{ $typeLabel }}。</div>
|
|
@endforelse
|
|
</div>
|
|
{{ $packages->onEachSide(1)->links() }}
|
|
</div>
|
|
</section>
|
|
@endsection
|