Biete in der Shopliste Auswahl, Reihenfolge, Listenansicht und Seiten
CI Feature / test (push) Successful in 6m4s
CI Feature / test (push) Successful in 6m4s
- ShopCatalog::listing mit Auswahl nach Thema, Materialart, Eignung und Nutzerkreis, Reihenfolge, Ansicht und Seiten - Listenansicht shop/zeile, gemeinsame Liste fuer Shopseite und Widget (Variante Liste, Einstellung Auswahl fuer Besucher) - Werte aus dem Abfragetext werden gegen vorhandene Werte geprueft, Felder als Liste und Zahlen ausserhalb des Bereichs sind harmlos - Suchfeld heisst nach dem Umbau Zurücksetzen statt Suche zuruecksetzen (Test bewusst angepasst) - ADR-57 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
95a888d1ca
commit
f0ffb47210
15 files changed
+651
-73
No files matched your search
@@ -563,3 +563,157 @@ .shop-marker-beliebt {
|
||||
border-color: var(--color-success);
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
/*
|
||||
* Auswahl, Listenansicht und Seiten (ADR-57). Alles ohne Script bedienbar; die Auswahl steht im Abfragetext.
|
||||
*/
|
||||
.shop-filter {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
|
||||
gap: var(--space-3) var(--space-4);
|
||||
align-items: end;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.shop-filter-field {
|
||||
display: grid;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.shop-filter-search {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.shop-filter-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.shop-viewbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-3);
|
||||
margin: var(--space-4) 0 0;
|
||||
}
|
||||
|
||||
.shop-view {
|
||||
display: flex;
|
||||
gap: var(--space-2);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.shop-view a {
|
||||
padding: 0.2rem 0.8rem;
|
||||
border: 2px solid var(--color-border-strong);
|
||||
border-radius: var(--radius-pill);
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.shop-view a[aria-current='true'] {
|
||||
background: var(--lf-navy);
|
||||
border-color: var(--lf-navy);
|
||||
color: var(--lf-white);
|
||||
}
|
||||
|
||||
.shop-rows {
|
||||
list-style: none;
|
||||
margin: var(--space-5) 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.shop-row {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: 7rem minmax(0, 1fr) auto;
|
||||
gap: var(--space-4);
|
||||
align-items: center;
|
||||
background: var(--color-surface-raised);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-card);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
|
||||
.shop-row-media {
|
||||
aspect-ratio: 16 / 9;
|
||||
background: var(--color-surface-subtle);
|
||||
border-radius: var(--radius-card);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.shop-row-media img {
|
||||
inline-size: 100%;
|
||||
block-size: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.shop-row-symbol {
|
||||
--sym-s: 2.5rem;
|
||||
}
|
||||
|
||||
.shop-row-body h2 {
|
||||
margin: 0 0 var(--space-1);
|
||||
font-size: var(--text-h3);
|
||||
}
|
||||
|
||||
.shop-row-body h2 a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.shop-row-body h2 a:hover,
|
||||
.shop-row-body h2 a:focus-visible {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.shop-row-body h2 a::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
.shop-row .shop-tile-kind {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.shop-row-price {
|
||||
margin: 0;
|
||||
font-weight: 700;
|
||||
text-align: end;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.shop-row-price span {
|
||||
display: block;
|
||||
font-weight: 400;
|
||||
font-size: var(--text-small);
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.shop-pages {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--space-4);
|
||||
margin: var(--space-5) 0;
|
||||
}
|
||||
|
||||
@media (max-width: 40rem) {
|
||||
.shop-row {
|
||||
grid-template-columns: 4.5rem minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.shop-row-price {
|
||||
grid-column: 1 / -1;
|
||||
text-align: start;
|
||||
}
|
||||
}
|
||||
@@ -6,26 +6,5 @@
|
||||
<h1>Shop</h1>
|
||||
<p class="lede">Hier findest du kaufbare Produkte und Pakete. Jede Kachel öffnet die Produktseite mit Inhalt und den verfügbaren Lizenzoptionen.</p>
|
||||
|
||||
<form class="shop-search" method="get" action="{{ route('shop') }}" role="search">
|
||||
<label for="shop-suche">Shop durchsuchen</label>
|
||||
<input id="shop-suche" type="search" name="suche" value="{{ $term }}" autocomplete="off">
|
||||
<button class="button" type="submit">Suchen</button>
|
||||
@if ($term !== '')
|
||||
<a class="button button-quiet" href="{{ route('shop') }}">Suche zurücksetzen</a>
|
||||
@endif
|
||||
</form>
|
||||
|
||||
@if ($cards === [])
|
||||
<div class="empty">
|
||||
<h2>{{ $term !== '' ? 'Keine Treffer' : 'Noch keine kaufbaren Produkte' }}</h2>
|
||||
<p>{{ $term !== '' ? 'Zu „'.$term.'“ gibt es keine kaufbaren Produkte. Prüfe die Schreibweise oder setze die Suche zurück.' : 'Sobald ein Angebot aktiv ist, erscheint es hier.' }}</p>
|
||||
</div>
|
||||
@else
|
||||
<p class="shop-count" role="status">{{ count($cards) }} {{ count($cards) === 1 ? 'Produkt' : 'Produkte' }}</p>
|
||||
<ul class="shop-tiles">
|
||||
@foreach ($cards as $card)
|
||||
@include('shop.kachel', ['card' => $card])
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@include('shop.liste', ['listing' => $listing, 'action' => route('shop'), 'uid' => 'seite'])
|
||||
@endsection
|
||||
@@ -0,0 +1,89 @@
|
||||
{{--
|
||||
Die Produktliste des Shops: Suche, Auswahl (Säule, Materialart, Eignung, Nutzerkreis), Reihenfolge, Ansicht und Seiten.
|
||||
Parameter: $listing (ShopCatalog::listing), $action (Adresse der Seite, an die das Formular sendet), $uid (Kennung
|
||||
für die Feldnamen). Die Auswahl steht im Abfragetext; ohne Script bleibt alles bedienbar.
|
||||
--}}
|
||||
@php
|
||||
$keep = ['suche', 'saeule', 'art', 'eignung', 'kreis', 'sort', 'ansicht'];
|
||||
$link = fn (array $extra): string => $action.'?'.http_build_query(array_filter(array_merge(request()->only($keep), $extra), fn ($value): bool => $value !== null && $value !== ''));
|
||||
$chosen = $listing['chosen'];
|
||||
$facets = $listing['facets'];
|
||||
$active = count(array_filter($chosen, fn ($value): bool => $value !== null)) + ($listing['term'] !== '' ? 1 : 0);
|
||||
@endphp
|
||||
@if ($listing['filters'])
|
||||
<form class="shop-search shop-filter" method="get" action="{{ $action }}" role="search" aria-label="Shop durchsuchen und filtern">
|
||||
<div class="shop-filter-field shop-filter-search">
|
||||
<label for="shop-suche-{{ $uid }}">Shop durchsuchen</label>
|
||||
<input id="shop-suche-{{ $uid }}" type="search" name="suche" value="{{ $listing['term'] }}" maxlength="100" autocomplete="off">
|
||||
</div>
|
||||
@foreach ([['saeule', 'pillar', 'Thema'], ['art', 'kind', 'Materialart'], ['eignung', 'holder', 'Geeignet für'], ['kreis', 'scope', 'Nutzerkreis']] as [$name, $facet, $label])
|
||||
@if ($facets[$facet] !== [])
|
||||
<div class="shop-filter-field">
|
||||
<label for="shop-{{ $name }}-{{ $uid }}">{{ $label }}</label>
|
||||
<select id="shop-{{ $name }}-{{ $uid }}" name="{{ $name }}">
|
||||
<option value="">Alle</option>
|
||||
@foreach ($facets[$facet] as $value => $text)
|
||||
<option value="{{ $value }}" @selected((string) ($chosen[$facet] ?? '') === (string) $value)>{{ $text }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
<div class="shop-filter-field">
|
||||
<label for="shop-sort-{{ $uid }}">Reihenfolge</label>
|
||||
<select id="shop-sort-{{ $uid }}" name="sort">
|
||||
<option value="">Standard</option>
|
||||
@foreach (\App\Domain\Commerce\ShopCatalog::SORTS as $value => $text)
|
||||
<option value="{{ $value }}" @selected(($listing['sort'] ?? '') === $value)>{{ $text }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="ansicht" value="{{ $listing['view'] }}">
|
||||
<div class="shop-filter-actions">
|
||||
<button class="button" type="submit">Anwenden</button>
|
||||
@if ($active > 0)
|
||||
<a class="button button-quiet" href="{{ $action }}?ansicht={{ $listing['view'] }}">Zurücksetzen</a>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
<div class="shop-viewbar">
|
||||
<p class="shop-count" role="status">{{ $listing['total'] }} {{ $listing['total'] === 1 ? 'Produkt' : 'Produkte' }}@if ($listing['pages'] > 1), Seite {{ $listing['page'] }} von {{ $listing['pages'] }}@endif</p>
|
||||
<p class="shop-view" aria-label="Ansicht">
|
||||
<a href="{{ $link(['ansicht' => 'kacheln', 'seite' => null]) }}" @if ($listing['view'] === 'kacheln') aria-current="true" @endif>Kacheln</a>
|
||||
<a href="{{ $link(['ansicht' => 'liste', 'seite' => null]) }}" @if ($listing['view'] === 'liste') aria-current="true" @endif>Liste</a>
|
||||
</p>
|
||||
</div>
|
||||
@elseif ($listing['cards'] !== [])
|
||||
<p class="shop-count" role="status">{{ $listing['total'] }} {{ $listing['total'] === 1 ? 'Produkt' : 'Produkte' }}</p>
|
||||
@endif
|
||||
|
||||
@if ($listing['cards'] === [])
|
||||
<div class="empty">
|
||||
<h3>{{ $active > 0 ? 'Keine Treffer' : 'Noch keine kaufbaren Produkte' }}</h3>
|
||||
<p>{{ $active > 0 ? 'Zu dieser Auswahl gibt es keine kaufbaren Produkte. Ändere die Auswahl oder setze sie zurück.' : 'Sobald ein Angebot aktiv ist, erscheint es hier.' }}</p>
|
||||
</div>
|
||||
@elseif ($listing['view'] === 'liste')
|
||||
<ul class="shop-rows">
|
||||
@foreach ($listing['cards'] as $card)
|
||||
@include('shop.zeile', ['card' => $card])
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<ul class="shop-tiles">
|
||||
@foreach ($listing['cards'] as $card)
|
||||
@include('shop.kachel', ['card' => $card])
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
|
||||
@if ($listing['pages'] > 1)
|
||||
<nav class="shop-pages" aria-label="Seiten">
|
||||
@if ($listing['page'] > 1)
|
||||
<a href="{{ $link(['seite' => $listing['page'] - 1]) }}" rel="prev">Zurück</a>
|
||||
@endif
|
||||
<span>Seite {{ $listing['page'] }} von {{ $listing['pages'] }}</span>
|
||||
@if ($listing['page'] < $listing['pages'])
|
||||
<a href="{{ $link(['seite' => $listing['page'] + 1]) }}" rel="next">Weiter</a>
|
||||
@endif
|
||||
</nav>
|
||||
@endif
|
||||
@@ -0,0 +1,31 @@
|
||||
{{--
|
||||
Ein Produkt in der Listenansicht. Die Zeile trägt dieselben Angaben wie die Kachel: kleines Bild oder Symbol, Art,
|
||||
Marker mit Wort, Titel als Link, Kurztext, Themen und Preis.
|
||||
--}}
|
||||
<li class="shop-row">
|
||||
<div class="shop-row-media @if ($card['image'] === null) is-placeholder @endif" aria-hidden="true">
|
||||
@if ($card['image'] !== null)
|
||||
<img src="{{ $card['image']['url'] }}" alt="" loading="lazy" decoding="async">
|
||||
@elseif ($card['symbol'] !== null)
|
||||
<x-brand.symbol :name="$card['symbol']" class="shop-row-symbol" />
|
||||
@endif
|
||||
</div>
|
||||
<div class="shop-row-body">
|
||||
<p class="shop-tile-kind">
|
||||
@if ($card['kind_label'] !== '')<span>{{ $card['kind_label'] }}</span>@endif
|
||||
@foreach ($card['markers'] as $marker)
|
||||
<span class="shop-marker shop-marker-{{ $marker['key'] }}">{{ $marker['label'] }}</span>
|
||||
@endforeach
|
||||
</p>
|
||||
<h2><a href="{{ $card['url'] }}">{{ $card['title'] }}</a></h2>
|
||||
@if ($card['teaser'] !== '')<p class="shop-tile-teaser">{{ $card['teaser'] }}</p>@endif
|
||||
@if ($card['pillars'] !== [])
|
||||
<ul class="shop-tile-pillars" aria-label="Themen">
|
||||
@foreach (array_slice($card['pillars'], 0, 3) as $pillar)
|
||||
<li>{{ $pillar }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
<p class="shop-row-price">ab {{ $card['from'] }}<span>{{ $card['count'] }} {{ $card['count'] === 1 ? 'Lizenzoption' : 'Lizenzoptionen' }}</span></p>
|
||||
</li>
|
||||
@@ -1,6 +1,6 @@
|
||||
{{--
|
||||
Shop-Produkte (ADR-55). Die Kacheln kommen aus ShopCatalog, nichts davon wird im CMS gespeichert. Ist der Shop nicht
|
||||
sichtbar, bleibt der Abschnitt öffentlich leer; die Redaktionsvorschau zeigt einen Hinweis.
|
||||
Shop-Produkte (ADR-55, ADR-57). Die Produkte kommen aus ShopCatalog, nichts davon wird im CMS gespeichert. Ist der Shop
|
||||
nicht sichtbar, bleibt der Abschnitt öffentlich leer; die Redaktionsvorschau zeigt einen Hinweis.
|
||||
--}}
|
||||
@if ($shopVisible || $context->preview)
|
||||
<div class="shop-products">
|
||||
@@ -13,29 +13,17 @@
|
||||
@unless ($shopVisible)
|
||||
<p class="preview-note">Der Shop ist zurzeit nicht sichtbar. Öffentlich erscheint dieser Abschnitt nicht.</p>
|
||||
@else
|
||||
@if (($settings['search'] ?? 'aus') === 'an')
|
||||
<form class="shop-search" method="get" action="{{ route('shop') }}" role="search">
|
||||
@if (($settings['search'] ?? 'aus') === 'an' && ($settings['filter'] ?? 'aus') !== 'an')
|
||||
<form class="shop-search" method="get" action="{{ url()->current() }}" role="search">
|
||||
<label for="shop-suche-{{ $widget['id'] ?? 'w' }}">Shop durchsuchen</label>
|
||||
<input id="shop-suche-{{ $widget['id'] ?? 'w' }}" type="search" name="suche" value="{{ $term }}" autocomplete="off">
|
||||
<input id="shop-suche-{{ $widget['id'] ?? 'w' }}" type="search" name="suche" value="{{ $term }}" maxlength="100" autocomplete="off">
|
||||
<button class="button" type="submit">Suchen</button>
|
||||
@if ($term !== '')
|
||||
<a class="button button-quiet" href="{{ route('shop') }}">Suche zurücksetzen</a>
|
||||
<a class="button button-quiet" href="{{ url()->current() }}">Suche zurücksetzen</a>
|
||||
@endif
|
||||
</form>
|
||||
@endif
|
||||
@if ($cards === [])
|
||||
<div class="empty">
|
||||
<h3>{{ $term !== '' ? 'Keine Treffer' : 'Noch keine kaufbaren Produkte' }}</h3>
|
||||
<p>{{ $term !== '' ? 'Zu „'.$term.'“ gibt es keine kaufbaren Produkte. Prüfe die Schreibweise oder setze die Suche zurück.' : 'Sobald ein Angebot aktiv ist, erscheint es hier.' }}</p>
|
||||
</div>
|
||||
@else
|
||||
<p class="shop-count" role="status">{{ count($cards) }} {{ count($cards) === 1 ? 'Produkt' : 'Produkte' }}</p>
|
||||
<ul class="shop-tiles">
|
||||
@foreach ($cards as $card)
|
||||
@include('shop.kachel', ['card' => $card])
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@include('shop.liste', ['listing' => $listing, 'action' => url()->current(), 'uid' => $widget['id'] ?? 'w'])
|
||||
@endunless
|
||||
</div>
|
||||
@endif
|
||||
Reference in new issue
Block a user