From 2e6260acca5b2c6981883903bb232ec45885759e Mon Sep 17 00:00:00 2001 From: Lars Date: Sun, 22 Nov 2026 17:56:16 +0100 Subject: [PATCH 1/2] Gestalte den Mitgliederbereich nach Brand-UI-Kit 14 neu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eine Navigation (Meine Bibliothek, Programme, Meine Lizenzen, Konto-Menü) mit der freigegebenen Wortmarke, Startseite ohne erfundene Inhalte, Bibliothek mit Inhaltsart-Filter und einer Karte je Medienidentität („Verwendet in“), Programm-/Moduldetail, Film und Material im Zusammenhang mit Begleitmaterial und Weg zurück, Lizenzübersicht mit Detailseite je Berechtigung. Alle Größen aus der Größenskala (ADR-44, neues Token --card-min). Tests bewusst angepasst: Der Film spielt auf der Kontextseite statt eingebettet im Programm, Download-Links tragen ein Symbol, der Platzhalter ist ein dekoratives Element, die Wortmarke ist das freigegebene Logo. Die Vorschau der Bibliothekskarte in der Verwaltung nutzt dieselbe Komponente. Co-Authored-By: Claude Sonnet 5.5 --- app/Domain/Commerce/ProductOptions.php | 10 +- .../Pages/ViewContentElement.php | 11 +- .../Controllers/Member/CheckoutController.php | 2 +- .../Controllers/Member/LibraryController.php | 199 ++- .../Controllers/Member/MemberController.php | 13 +- app/Http/LibraryCatalog.php | 371 +++- app/Http/MemberLicenses.php | 323 ++++ resources/css/app.css | 561 +----- resources/css/components/lf-member.css | 1568 +++++++++++++++++ resources/css/tokens.css | 6 + resources/js/app.js | 1 + resources/js/member-nav.js | 53 + .../views/components/member/card.blade.php | 63 + .../views/components/member/hero.blade.php | 15 + .../views/components/member/status.blade.php | 18 + .../views/components/member/type.blade.php | 21 + resources/views/layouts/member.blade.php | 90 +- resources/views/member/article.blade.php | 50 +- resources/views/member/content.blade.php | 127 ++ resources/views/member/dashboard.blade.php | 100 +- resources/views/member/grant.blade.php | 123 ++ resources/views/member/grants.blade.php | 76 +- resources/views/member/library.blade.php | 205 +-- resources/views/member/materials.blade.php | 40 - resources/views/member/offers.blade.php | 13 +- resources/views/member/order.blade.php | 12 +- .../views/member/partials/card.blade.php | 29 - resources/views/member/partials/nav.blade.php | 10 - .../views/member/partials/structure.blade.php | 87 +- resources/views/member/profile.blade.php | 9 +- resources/views/member/program.blade.php | 153 +- resources/views/member/read.blade.php | 9 +- routes/web.php | 4 + tests/Feature/CmsSectionRenderingTest.php | 8 +- tests/Feature/LibraryCompletionTest.php | 4 +- tests/Feature/LibraryProgramTest.php | 20 +- tests/Feature/MediaEditorTest.php | 2 +- tests/Feature/MemberAreaV2Test.php | 421 +++++ tests/Feature/MultiLineCheckoutTest.php | 2 +- tests/Feature/OrganizationPurchaseTest.php | 4 +- tests/Feature/RegistrationTest.php | 2 +- 41 files changed, 3742 insertions(+), 1093 deletions(-) create mode 100644 app/Http/MemberLicenses.php create mode 100644 resources/css/components/lf-member.css create mode 100644 resources/js/member-nav.js create mode 100644 resources/views/components/member/card.blade.php create mode 100644 resources/views/components/member/hero.blade.php create mode 100644 resources/views/components/member/status.blade.php create mode 100644 resources/views/components/member/type.blade.php create mode 100644 resources/views/member/content.blade.php create mode 100644 resources/views/member/grant.blade.php delete mode 100644 resources/views/member/materials.blade.php delete mode 100644 resources/views/member/partials/card.blade.php delete mode 100644 resources/views/member/partials/nav.blade.php create mode 100644 tests/Feature/MemberAreaV2Test.php diff --git a/app/Domain/Commerce/ProductOptions.php b/app/Domain/Commerce/ProductOptions.php index dbff0d5..27bb74f 100644 --- a/app/Domain/Commerce/ProductOptions.php +++ b/app/Domain/Commerce/ProductOptions.php @@ -95,12 +95,18 @@ public function describe(Offer $offer, OfferVersion $version): array public static function termLabel(OfferVersion $version): string { - return match ($version->term_rule) { + return self::termRuleLabel($version->term_rule); + } + + /** Laufzeitregel aus der Angebotsfassung oder aus den Bedingungen eines Erwerbs (gleiche Schlüssel). */ + public static function termRuleLabel(?string $rule): string + { + return match ((string) $rule) { 'dauerhaft' => 'Dauerhaft nutzbar', 'befristet' => 'Befristet', 'solange_angebot_aktiv' => 'Solange das Angebot aktiv ist', 'periodisch' => 'Laufend, periodisch', - default => (string) $version->term_rule, + default => (string) $rule, }; } diff --git a/app/Filament/Resources/ContentElements/Pages/ViewContentElement.php b/app/Filament/Resources/ContentElements/Pages/ViewContentElement.php index 0a3f203..6656743 100644 --- a/app/Filament/Resources/ContentElements/Pages/ViewContentElement.php +++ b/app/Filament/Resources/ContentElements/Pages/ViewContentElement.php @@ -38,6 +38,7 @@ use Filament\Support\Enums\Width; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Blade; use Livewire\Features\SupportFileUploads\TemporaryUploadedFile; use Livewire\WithFileUploads; @@ -1046,18 +1047,20 @@ public function previewHtml(): string if ($this->previewSurface === 'bibliothek') { $title = trim($this->displayTitle) !== '' ? trim($this->displayTitle) : trim($this->workingTitle); - return view('member.partials.card', [ - 'href' => '#vorschau', + // Dieselbe Karte wie im Mitgliederbereich (), ohne Verfügbarkeit: Die entscheidet die Lizenz. + return Blade::render('', [ 'card' => [ + 'type' => $element->output_class === 'film' ? 'film' : 'material', + 'url' => '#vorschau', 'title' => $title !== '' ? $title : $element->working_title, 'summary' => trim($this->summary) !== '' ? trim($this->summary) : null, 'kind' => PublicMaterialReader::outputLabel((string) $element->output_class), - 'coverage' => 'offen', + 'hide_status' => true, 'image' => trim($this->thumbnailAlt) !== '' ? trim($this->thumbnailAlt) : $title, 'image_url' => ThumbnailRef::url('editorial.card', 'element', $element->id, $element->thumbnail_path), 'error' => 'Vorschau der Kartenform. Ob jemand sie öffnen darf, entscheidet die Lizenz.', ], - ])->render(); + ]); } $subject = app(PublicMaterialReader::class)->subject($element->id, true, $draft); diff --git a/app/Http/Controllers/Member/CheckoutController.php b/app/Http/Controllers/Member/CheckoutController.php index 9eae73c..b89e285 100644 --- a/app/Http/Controllers/Member/CheckoutController.php +++ b/app/Http/Controllers/Member/CheckoutController.php @@ -39,7 +39,7 @@ public function claim(Request $request, Offer $offer, GrantIssuer $issuer): Redi return back()->withErrors(['offer' => $exception->getMessage()]); } - return redirect()->route('member.library')->with('status', 'Das Angebot liegt in Ihrer Bibliothek.'); + return redirect()->route('member.library')->with('status', 'Das Angebot liegt in deiner Bibliothek.'); } public function place(Request $request, Offer $offer, Checkout $checkout): RedirectResponse diff --git a/app/Http/Controllers/Member/LibraryController.php b/app/Http/Controllers/Member/LibraryController.php index ab608b8..f5f4d3f 100644 --- a/app/Http/Controllers/Member/LibraryController.php +++ b/app/Http/Controllers/Member/LibraryController.php @@ -21,8 +21,10 @@ use App\Http\Controllers\Controller; use App\Http\CourseOutline; use App\Http\LibraryCatalog; +use App\Http\MemberLicenses; use App\Http\SignedLink; use Illuminate\Database\Eloquent\Model; +use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Collection; @@ -32,12 +34,28 @@ class LibraryController extends Controller { + /** Inhaltsarten der Bibliothek (Schlüssel der Adresse und des Filters). */ + public const TYPES = [ + 'programm' => 'Programme', + 'modul' => 'Module', + 'film' => 'Filme', + 'material' => 'Materialien', + ]; + public function index(Request $request, ?string $sicht = null): View { $catalog = app(LibraryCatalog::class)->index($request->user()); - $untouched = $catalog['programs'] === [] && $catalog['modules'] === [] && $catalog['materials'] === []; + $items = [...$catalog['programs'], ...$catalog['modules'], ...$catalog['materials']]; + $untouched = $items === []; $query = trim((string) $request->query('q', '')); $nutzung = (string) $request->query('nutzung', ''); + $sortierung = $request->query('sortierung') === 'titel' ? 'titel' : 'standard'; + $art = match ($sicht) { + 'programme' => 'programm', + 'module' => 'modul', + default => (string) $request->query('art', ''), + }; + $art = array_key_exists($art, self::TYPES) ? $art : ''; $dimensionIds = array_values(array_filter(array_map(intval(...), (array) $request->query('dimension', [])))); $saeuleIds = array_values(array_filter(array_map(intval(...), (array) $request->query('saeule', [])))); $dimensions = app(IdentityDimension::class); @@ -52,94 +70,60 @@ public function index(Request $request, ?string $sicht = null): View $dimensionIds = array_values($dimensionIds); $saeuleIds = array_values(array_unique($saeuleIds)); - $pillarOptions = $this->visiblePillars($catalog, $saeuleIds); + $pillarOptions = $this->visiblePillars($items, $saeuleIds); - foreach (['programs', 'modules'] as $shelf) { - if ($query !== '') { - $catalog[$shelf] = array_values(array_filter( - $catalog[$shelf], - fn (array $card): bool => $this->matches($card, $query), - )); - } - if ($dimensionIds !== []) { - $catalog[$shelf] = array_values(array_filter( - $catalog[$shelf], - fn (array $card): bool => $dimensions->matches($card['composition'], $dimensionIds), - )); - } - if ($saeuleIds !== []) { - $catalog[$shelf] = array_values(array_filter( - $catalog[$shelf], - fn (array $card): bool => $this->hasPillar($card['composition'], $saeuleIds), - )); - } - if (in_array($nutzung, ['nutzbar', 'teilweise', 'nicht enthalten'], true)) { - $catalog[$shelf] = array_values(array_filter( - $catalog[$shelf], - fn (array $card): bool => ($card['coverage'] ?? '') === $nutzung, - )); + // Gemeinsame Filter für alle Inhaltsarten. Die Zahl je Art zeigt, was die übrigen Filter übrig lassen. + $matching = array_values(array_filter($items, function (array $card) use ($query, $nutzung, $dimensionIds, $saeuleIds, $dimensions): bool { + return ($query === '' || $this->matches($card, $query)) + && ($dimensionIds === [] || $dimensions->matches($card['subject'], $dimensionIds)) + && ($saeuleIds === [] || $this->hasPillar($card['subject'], $saeuleIds)) + && (! in_array($nutzung, ['nutzbar', 'teilweise', 'nicht enthalten'], true) || ($card['coverage'] ?? '') === $nutzung); + })); + $counts = array_fill_keys(array_keys(self::TYPES), 0); + + foreach ($matching as $card) { + $counts[$card['type']]++; + } + + $shown = $art === '' ? $matching : array_values(array_filter($matching, fn (array $card): bool => $card['type'] === $art)); + + if ($sortierung === 'titel') { + usort($shown, fn (array $left, array $right): int => strcoll(mb_strtolower($left['title']), mb_strtolower($right['title']))); + } + + $shelves = []; + + foreach (self::TYPES as $type => $label) { + $cards = array_values(array_filter($shown, fn (array $card): bool => $card['type'] === $type)); + + if ($cards !== []) { + $shelves[$type] = ['label' => $label, 'cards' => $cards]; } } - if ($query !== '') { - $catalog['materials'] = array_values(array_filter( - $catalog['materials'], - fn (array $card): bool => $this->matches($card, $query), - )); - } - - if ($dimensionIds !== []) { - $catalog['materials'] = array_values(array_filter( - $catalog['materials'], - function (array $card) use ($dimensions, $dimensionIds): bool { - $release = $card['article']->currentRelease; - $subject = $release?->rootCompositionVersion?->composition - ?? $release?->rootElementVersion?->element - ?? $card['article']; - - return $dimensions->matches($subject, $dimensionIds); - }, - )); - } - - if ($saeuleIds !== []) { - $catalog['materials'] = array_values(array_filter( - $catalog['materials'], - fn (array $card): bool => $this->hasPillar($this->materialSubject($card), $saeuleIds), - )); - } - - if ($nutzung === 'teilweise' || $nutzung === 'nicht enthalten') { - $catalog['materials'] = []; - } + $filterActive = $query !== '' || $nutzung !== '' || $dimensionIds !== [] || $saeuleIds !== [] || $art !== ''; return view('member.library', [ - ...$catalog, + 'shelves' => $shelves, + 'total' => count($shown), + 'counts' => $counts, + 'allCount' => count($matching), + 'art' => $art, + 'types' => self::TYPES, 'query' => $query, 'sicht' => $sicht, 'nutzung' => $nutzung, + 'sortierung' => $sortierung, 'dimensionIds' => $dimensionIds, 'saeuleIds' => $saeuleIds, 'filterPillars' => $pillarOptions, 'filterDimensions' => app(EditorialVocabulary::class)->memberFilterDimensions(array_map(intval(...), $dimensionIds)), 'libraryEmpty' => $untouched, + 'filterActive' => $filterActive, + 'filterCount' => count($dimensionIds) + count($saeuleIds) + ($nutzung !== '' ? 1 : 0), ]); } - /** - * Subjekt eines Materialkarte: Programm oder Modul, Medium oder der Artikel selbst. - * - * @param array $card - */ - private function materialSubject(array $card): Model - { - $release = $card['article']->currentRelease; - - return $release?->rootCompositionVersion?->composition - ?? $release?->rootElementVersion?->element - ?? $card['article']; - } - /** * Direkte Säulenzuordnung des Objekts selbst; die Säulen enthaltener Medien zählen hier nicht. * @@ -154,22 +138,16 @@ private function hasPillar(Model $subject, array $pillarIds): bool * Säulen für den Filter: nur solche, die ein sichtbares Objekt der Bibliothek tatsächlich trägt, und eine bereits * gewählte. So erscheinen neue oder interne Säulen ohne Zuordnung nicht in der Bibliothek. * - * @param array $catalog + * @param list> $items * @param list $selected * @return Collection */ - private function visiblePillars(array $catalog, array $selected) + private function visiblePillars(array $items, array $selected) { $used = []; - foreach (array_merge($catalog['programs'], $catalog['modules']) as $card) { - foreach ($card['composition']->pillars()->pluck('pillars.id') as $id) { - $used[(int) $id] = true; - } - } - - foreach ($catalog['materials'] as $card) { - foreach ($this->materialSubject($card)->pillars()->pluck('pillars.id') as $id) { + foreach ($items as $card) { + foreach ($card['subject']->pillars()->pluck('pillars.id') as $id) { $used[(int) $id] = true; } } @@ -193,20 +171,55 @@ public function program(Request $request, Composition $composition): View return view('member.program', app(LibraryCatalog::class)->program($request->user(), $composition)); } - public function materials(Request $request): View + /** + * Film oder Material im Zusammenhang seines Programms oder Moduls. Die Seite zeigt nur Stellen, die in der + * angezeigten Fassung des Programms stehen; die Wiedergabe- und Downloadadressen kommen aus DecideAccess. + */ + public function content(Request $request, Composition $composition, int $version): View|Response { - return view('member.materials', [ - 'grants' => $this->grantQuery($request)->with('article.currentRelease.contents.elementVersion.element')->get(), - ]); + $data = app(LibraryCatalog::class)->content($request->user(), $composition, $version); + abort_if($data === null, 404); + + return response()->view('member.content', $data, $data['allowed'] ? 200 : 403); + } + + /** Die frühere Seite „Materialien“ ist ein Filter der Bibliothek (eine Navigation statt zwei). */ + public function materials(): RedirectResponse + { + return redirect()->route('member.library', ['art' => 'material']); } public function grants(Request $request): View { + $entries = app(MemberLicenses::class)->overview($request->user()); + $filter = in_array($request->query('status'), ['aktiv', 'inaktiv'], true) ? (string) $request->query('status') : 'alle'; + return view('member.grants', [ - 'grants' => $this->grantQuery($request)->get(), + 'entries' => match ($filter) { + 'aktiv' => $entries->where('active', true)->values(), + 'inaktiv' => $entries->where('active', false)->values(), + default => $entries, + }, + 'filter' => $filter, + 'counts' => [ + 'aktiv' => $entries->where('active', true)->count(), + 'inaktiv' => $entries->where('active', false)->count(), + 'alle' => $entries->count(), + ], ]); } + /** Eine einzelne Berechtigung. Nur eigene (oder die der eigenen Organisation mit Bestellrecht); sonst nicht gefunden. */ + public function grant(Request $request, Grant $grant): View + { + abort_unless( + Grant::query()->usableBy($request->user())->whereKey($grant->id)->exists(), + 404, + ); + + return view('member.grant', app(MemberLicenses::class)->detail($request->user(), $grant)); + } + public function show(Request $request, LicenseArticle $article): View { $release = $article->currentRelease()->with('contents.elementVersion.element.pillars')->first(); @@ -219,6 +232,7 @@ public function show(Request $request, LicenseArticle $article): View $metadata = is_array($version->metadata) ? $version->metadata : []; $action = $class === 'film' || $class === 'audio' ? 'streamen' : 'ansehen'; $decision = app(DecideAccess::class)($request->user(), $article, $release, $version, $action); + $download = app(DecideAccess::class)($request->user(), $article, $release, $version, 'laden'); $file = $metadata['file'] ?? null; $entries[] = [ 'content' => $content, @@ -232,6 +246,15 @@ public function show(Request $request, LicenseArticle $article): View : null, 'playable' => $decision->allowed && is_string($file) && $file !== '' && ($class === 'film' || $class === 'audio'), 'playback' => app(FilmPlayback::class)->mode($version->id), + 'download_url' => $download->allowed + ? SignedLink::temporary('member.media', now()->addMinutes(10), [ + 'article' => $article->id, + 'release' => $release->id, + 'version' => $version->id, + 'action' => 'laden', + 'reader' => $request->user()->id, + ]) + : null, 'pillars' => $version->element->pillars->pluck('name')->all(), 'url' => $decision->allowed ? SignedLink::temporary('member.media', now()->addMinutes(10), [ @@ -352,7 +375,7 @@ public function thumbnail(Request $request, string $kind, int $subject): Streame */ private function matches(array $card, string $query): bool { - $haystack = mb_strtolower(($card['title'] ?? '').' '.($card['summary'] ?? '')); + $haystack = mb_strtolower(($card['title'] ?? '').' '.($card['summary'] ?? '').' '.($card['subject']->search_terms ?? '')); return str_contains($haystack, mb_strtolower($query)); } diff --git a/app/Http/Controllers/Member/MemberController.php b/app/Http/Controllers/Member/MemberController.php index ee7d33a..21db58a 100644 --- a/app/Http/Controllers/Member/MemberController.php +++ b/app/Http/Controllers/Member/MemberController.php @@ -5,6 +5,7 @@ use App\Domain\Identity\AccountStatus; use App\Http\Controllers\Controller; use App\Http\LibraryCatalog; +use App\Http\MemberLicenses; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\View\View; @@ -14,11 +15,17 @@ class MemberController extends Controller public function dashboard(Request $request): View { $catalog = app(LibraryCatalog::class)->index($request->user()); + $films = array_filter($catalog['materials'], fn (array $card): bool => $card['type'] === 'film'); return view('member.dashboard', [ - 'programCount' => count($catalog['programs']), - 'moduleCount' => count($catalog['modules']), - 'materialCount' => count($catalog['materials']), + 'programs' => array_slice($catalog['programs'], 0, 4), + 'counts' => [ + 'programm' => count($catalog['programs']), + 'modul' => count($catalog['modules']), + 'film' => count($films), + 'material' => count($catalog['materials']) - count($films), + ], + 'licenseCount' => app(MemberLicenses::class)->overview($request->user())->where('active', true)->count(), ]); } diff --git a/app/Http/LibraryCatalog.php b/app/Http/LibraryCatalog.php index 203af59..3ed9f56 100644 --- a/app/Http/LibraryCatalog.php +++ b/app/Http/LibraryCatalog.php @@ -9,6 +9,7 @@ use App\Domain\Catalog\CompositionVersion; use App\Domain\Catalog\ContentElement; use App\Domain\Catalog\ContentElementVersion; +use App\Domain\Catalog\EditorialProfileReader; use App\Domain\Catalog\ReleaseStatus; use App\Domain\Catalog\StructureNode; use App\Domain\Entitlement\DecideAccess; @@ -18,24 +19,48 @@ use App\Domain\Media\ThumbnailRef; use App\Filament\Support\EditorialCatalog; use App\Models\User; +use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; +/** + * Liest die Mitgliederbibliothek aus den vorhandenen Fachobjekten (Kompositionen, Medien, Artikelstände, Berechtigungen). + * Sie hält keine eigenen Daten. Jede Zugriffsfrage entscheidet DecideAccess; die Oberfläche zeigt nur das Ergebnis. + * + * Einmalaufbau: Der Strukturbaum einer Komposition wird je Anfrage nur einmal gebaut und für Verfügbarkeit, + * Zählungen und die programmübergreifende Medienliste gemeinsam genutzt. + */ class LibraryCatalog { + /** @var array>> */ + private array $trees = []; + + /** @var array */ + private array $texts = []; + + /** @var array */ + private array $elements = []; + public function __construct( private readonly CompositionDisplayRelease $display, private readonly CompositionStructureReader $structure, private readonly DecideAccess $access, + private readonly EditorialProfileReader $profiles, ) {} /** + * Programme, Module und einzelne Medien (Filme und Materialien) der Berechtigungen des Kontos. + * + * Einzelne Medien erscheinen genau einmal je stabiler Medienidentität (Inhaltselement), gleich in wie vielen Programmen + * oder Modulen sie vorkommen. „used_in“ nennt diese Verwendungen. Innerhalb eines Programms bleibt jede Einbindung an + * ihrer Stelle erhalten (program()). Gleiche Titel verschiedener Elemente bleiben getrennt. + * * @return array{programs: list>, modules: list>, materials: list>} */ public function index(User $user): array { $programs = []; $modules = []; - $materials = []; + $media = []; foreach ($this->grants($user) as $grant) { $article = $grant->article; @@ -44,124 +69,360 @@ public function index(User $user): array $version = $release?->rootCompositionVersion; if ($composition !== null && $version !== null && $this->display->isReleased($version)) { + $shown = $this->display->highestReleasedVersion($composition); + $nodes = $shown === null ? [] : $this->tree($user, $shown, false, $composition->id); $picture = app(EditorialCatalog::class)->visiblePicture($composition, $version); + $text = $this->text($composition); $card = [ + 'type' => $composition->editorialContentKind?->slug === 'modul' ? 'modul' : 'programm', 'composition' => $composition, + 'subject' => $composition, 'version' => $version, - 'title' => filled($composition->display_title) ? $composition->display_title : $composition->designation, - 'summary' => $composition->summary, + 'title' => $text['title'], + 'summary' => $text['summary'], 'kind' => $composition->editorialContentKind?->label ?? ($composition->kind?->label()), - 'coverage' => $this->coverageLabel($user, $composition), + 'coverage' => $this->coverage($nodes), + 'module_count' => $this->countCompositions($nodes), + 'duration_minutes' => $shown?->duration_minutes, 'image' => $picture['alt'] ?? null, 'image_url' => $picture === null ? null : route('member.thumbnail', [ 'kind' => $picture['kind'], 'subject' => $picture['subject'], ]), + 'url' => route('member.program', $composition), ]; - $shelf = $composition->editorialContentKind?->slug === 'modul' ? 'modules' : 'programs'; - if ($shelf === 'modules') { + + if ($card['type'] === 'modul') { $modules[$composition->id] = $card; } else { $programs[$composition->id] = $card; } + $this->collect($media, $nodes, [['title' => $text['title'], 'url' => $card['url'], 'id' => $composition->id]], $composition); + continue; } $element = $release?->rootElementVersion?->element; - $elementId = $element?->id; $key = $composition !== null ? 'komposition-'.$composition->id - : ($elementId !== null ? 'element-'.$elementId : 'artikel-'.$article->id); + : ($element?->id !== null ? 'element-'.$element->id : 'artikel-'.$article->id); + $subject = $element ?? $composition ?? $article; + $text = $element !== null ? $this->text($element) : null; $imageUrl = $element === null ? null : ThumbnailRef::url('member.thumbnail', 'element', $element->id, $element->thumbnail_path); - $materials[$key] = [ - 'article' => $article, - 'title' => app(CourseOutline::class)->title($article), - 'summary' => $element?->summary ?? $composition?->summary, - 'kind' => app(CourseOutline::class)->kindLabel($article), - 'coverage' => 'nutzbar', - 'image' => $imageUrl === null ? null : ($element->thumbnail_alt ?: $element->working_title), - 'image_url' => $imageUrl, + $media[$key] = ($media[$key] ?? []) + [ + 'used_in' => [], + 'versions' => [], + 'context' => null, ]; + $media[$key] = [ + ...$media[$key], + 'key' => $key, + 'type' => $element?->output_class === 'film' ? 'film' : 'material', + 'article' => $article, + 'subject' => $subject, + 'title' => $text['title'] ?? app(CourseOutline::class)->title($article), + 'summary' => $text['summary'] ?? $element?->summary ?? $composition?->summary, + 'kind' => app(CourseOutline::class)->kindLabel($article) ?? ($element === null ? null : $this->outputLabel($element->output_class)), + 'coverage' => 'nutzbar', + 'image' => $imageUrl === null ? null : ($element->thumbnail_alt ?: ($text['title'] ?? $element->working_title)), + 'image_url' => $imageUrl, + 'url' => route('member.article', $article), + ]; + } + + foreach ($media as $key => $item) { + if (! isset($item['url'])) { + $media[$key]['url'] = route('member.content', [ + 'composition' => $item['context']['composition']->id, + 'version' => $item['context']['version_id'], + ]); + } } return [ 'programs' => array_values($programs), 'modules' => array_values($modules), - 'materials' => array_values($materials), + 'materials' => array_values($media), ]; } /** - * @return array{composition: Composition, title: string, kind: ?string, nodes: list>} + * Programm- oder Moduldetail: gesamte Struktur mit allen Einbindungen an ihrer Stelle. + * + * @return array */ public function program(User $user, Composition $composition): array { $version = $this->display->highestReleasedVersion($composition); abort_if($version === null, 404); - $nodes = array_map( - fn (StructureNode $node): array => $this->present($user, $node), - $this->structure->tree($version), - ); + $nodes = $this->tree($user, $version, true, $composition->id); $leaves = $this->leaves($nodes); - $open = count(array_filter($leaves, fn (array $leaf): bool => $leaf['view_url'] !== null)); + $text = $this->text($composition); return [ 'composition' => $composition, 'picture' => app(EditorialCatalog::class)->visiblePicture($composition, $version), - 'title' => filled($composition->display_title) ? $composition->display_title : $composition->designation, - 'summary' => $composition->summary, + 'title' => $text['title'], + 'summary' => $text['summary'], + 'description' => $text['description'], 'kind' => $composition->editorialContentKind?->label ?? ($composition->kind?->label()), + 'is_module' => $composition->editorialContentKind?->slug === 'modul', 'learning_goal' => $version->learning_goal, 'duration_minutes' => $version->duration_minutes, 'material_note' => $version->material_note, - 'coverage' => $leaves === [] ? 'nicht enthalten' : ($open === count($leaves) ? 'nutzbar' : ($open === 0 ? 'nicht enthalten' : 'teilweise')), + 'coverage' => $this->coverage($nodes), + 'module_count' => $this->countCompositions($nodes), + 'film_count' => count(array_filter($leaves, fn (array $leaf): bool => $leaf['output_class'] === 'film')), + 'material_count' => count(array_filter($leaves, fn (array $leaf): bool => $leaf['element_id'] !== null && $leaf['output_class'] !== 'film')), + 'open_count' => count(array_filter($leaves, fn (array $leaf): bool => $leaf['view_url'] !== null)), + 'leaf_count' => count($leaves), 'nodes' => $nodes, ]; } + /** + * Eine Filmstelle oder ein Material im Zusammenhang seines Programms oder Moduls. + * Gesucht wird die Einbindung in der angezeigten Fassung; was dort nicht steht, gibt es hier nicht. + * + * @return array|null + */ + public function content(User $user, Composition $composition, int $elementVersionId): ?array + { + $version = $this->display->highestReleasedVersion($composition); + + if ($version === null) { + return null; + } + + $nodes = $this->tree($user, $version, true, $composition->id); + $found = $this->locate($nodes, $elementVersionId, []); + + if ($found === null) { + return null; + } + + $node = $found['node']; + $element = $node['element_id'] === null ? null : $this->element($node['element_id']); + $text = $element === null ? ['title' => $node['title'], 'summary' => null, 'description' => null] : $this->text($element); + $rootText = $this->text($composition); + $trail = [['label' => $rootText['title'], 'url' => route('member.program', $composition)]]; + + foreach ($found['parents'] as $parent) { + if ($parent['program_url'] !== null && $parent['composition_id'] !== $composition->id) { + $trail[] = ['label' => $parent['title'], 'url' => $parent['program_url']]; + } + } + + $companions = array_values(array_filter( + $found['siblings'], + fn (array $sibling): bool => $sibling['children'] === [] + && $sibling['element_id'] !== null + && $sibling['version_id'] !== $elementVersionId, + )); + + return [ + 'composition' => $composition, + 'program_title' => $rootText['title'], + 'node' => $node, + 'element' => $element, + 'title' => $text['title'], + 'summary' => $text['summary'], + 'description' => $text['description'], + 'trail' => $trail, + 'back' => $trail[array_key_last($trail)], + 'companions' => $companions, + 'allowed' => $node['view_url'] !== null, + ]; + } + + /** + * Anzeigetitel und -texte für die Mitgliederbibliothek: Abweichung für „Mitgliederbibliothek“, sonst die zentrale Angabe, + * zuletzt die interne Bezeichnung. Nichts wird kopiert oder ergänzt. + * + * @return array{title: string, summary: ?string, description: ?string} + */ + public function text(Model $subject): array + { + $key = $subject->getMorphClass().':'.$subject->getKey(); + + if (isset($this->texts[$key])) { + return $this->texts[$key]; + } + + $profile = $this->profiles->read($subject, 'bibliothek'); + + return $this->texts[$key] = [ + 'title' => $profile->value('display_title') ?? $profile->workingTitle ?? '', + 'summary' => $profile->value('summary') ?? $profile->value('teaser'), + 'description' => $profile->value('description'), + ]; + } + + public function outputLabel(?string $outputClass): ?string + { + return match ($outputClass) { + 'film' => 'Film', + 'audio' => 'Hörstück', + 'document', 'pdf' => 'Dokument', + 'text' => 'Text', + 'bild' => 'Bild', + null => null, + default => $outputClass, + }; + } + + /** + * @param list> $nodes + * @param list $contexts + * @param array> $media + */ + private function collect(array &$media, array $nodes, array $contexts, Composition $root): void + { + foreach ($nodes as $node) { + if ($node['children'] !== []) { + $nested = $contexts; + + if ($node['composition_id'] !== null && $node['program_url'] !== null && $node['composition_id'] !== $root->id) { + $nested[] = ['title' => $node['title'], 'url' => $node['program_url'], 'id' => $node['composition_id']]; + } + + $this->collect($media, $node['children'], $nested, $root); + + continue; + } + + if ($node['element_id'] === null || $node['view_url'] === null) { + continue; + } + + $key = 'element-'.$node['element_id']; + $element = $this->element($node['element_id']); + $text = $element === null ? ['title' => $node['title'], 'summary' => null] : $this->text($element); + $item = $media[$key] ?? [ + 'key' => $key, + 'type' => $node['output_class'] === 'film' ? 'film' : 'material', + 'article' => null, + 'subject' => $element, + 'title' => $text['title'], + 'summary' => $text['summary'], + 'kind' => $node['kind'] ?? $this->outputLabel($node['output_class']), + 'coverage' => 'nutzbar', + 'image' => $node['poster_url'] === null ? null : ($element?->thumbnail_alt ?: $text['title']), + 'image_url' => $node['poster_url'], + 'used_in' => [], + 'versions' => [], + 'context' => null, + ]; + + foreach ($contexts as $context) { + $item['used_in'][$context['id']] = ['title' => $context['title'], 'url' => $context['url']]; + } + + $item['versions'][$node['version_id']] = true; + $item['context'] ??= ['composition' => $root, 'version_id' => $node['version_id']]; + $media[$key] = $item; + } + } + + /** + * @return list> + */ + private function tree(User $user, CompositionVersion $version, bool $full, int $rootId): array + { + $key = $version->id.':'.($full ? 'voll' : 'kurz').':'.$rootId; + + return $this->trees[$key] ??= array_map( + fn (StructureNode $node): array => $this->present($user, $node, $full, $rootId), + $this->structure->tree($version), + ); + } + /** * @return array */ - private function present(User $user, StructureNode $node): array + private function present(User $user, StructureNode $node, bool $full, int $rootId): array { $view = null; $download = null; - $playback = 'file'; - $poster = null; + $element = $node->contentElementId === null ? null : $this->element($node->contentElementId); if ($node->contentElementVersionId !== null) { $view = $this->open($user, $node->contentElementVersionId, $this->viewAction($node->outputClass)); - $download = $this->open($user, $node->contentElementVersionId, 'laden'); - $playback = app(FilmPlayback::class)->mode($node->contentElementVersionId); - if ($view !== null && $node->contentElementId !== null) { - $path = ContentElement::query()->whereKey($node->contentElementId)->value('thumbnail_path'); - $poster = ThumbnailRef::url('member.thumbnail', 'element', $node->contentElementId, $path); + + if ($full) { + $download = $this->open($user, $node->contentElementVersionId, 'laden'); + $playback = app(FilmPlayback::class)->mode($node->contentElementVersionId); } + + if ($view !== null && $element !== null) { + $poster = ThumbnailRef::url('member.thumbnail', 'element', $element->id, $element->thumbnail_path); + } + } + + $title = $node->title; + + if ($element !== null) { + $title = $this->text($element)['title'] ?: $title; + } elseif ($node->compositionId !== null) { + $nested = Composition::query()->find($node->compositionId); + $title = $nested === null ? $title : ($this->text($nested)['title'] ?: $title); } return [ 'role' => $node->role, - 'title' => $node->title, - 'kind' => $node->editorialKindLabel ?? $node->technicalKindLabel, + 'title' => $title, + 'summary' => $element === null ? null : $this->text($element)['summary'], + 'kind' => $node->editorialKindLabel ?? $this->outputLabel($node->technicalKindLabel) ?? $node->technicalKindLabel, 'output_class' => $node->outputClass, 'playback' => $playback, 'view_url' => $view, 'poster_url' => $poster, 'download_url' => $download, 'program_url' => $this->programUrl($node), + 'composition_id' => $node->compositionId, + 'element_id' => $node->contentElementId, + 'version_id' => $node->contentElementVersionId, + 'content_url' => $node->contentElementVersionId === null ? null : route('member.content', [ + 'composition' => $rootId, + 'version' => $node->contentElementVersionId, + ]), 'children' => array_map( - fn (StructureNode $child): array => $this->present($user, $child), + fn (StructureNode $child): array => $this->present($user, $child, $full, $rootId), $node->children, ), ]; } + /** + * @param list> $nodes + * @param list> $parents + * @return array{node: array, parents: list>, siblings: list>}|null + */ + private function locate(array $nodes, int $versionId, array $parents): ?array + { + foreach ($nodes as $node) { + if ($node['version_id'] === $versionId) { + return ['node' => $node, 'parents' => $parents, 'siblings' => $nodes]; + } + + if ($node['children'] !== []) { + $found = $this->locate($node['children'], $versionId, [...$parents, $node]); + + if ($found !== null) { + return $found; + } + } + } + + return null; + } + /** * @param list> $nodes * @return list> @@ -183,18 +444,29 @@ private function leaves(array $nodes): array return $leaves; } - private function coverageLabel(User $user, Composition $composition): string + /** + * @param list> $nodes + */ + private function countCompositions(array $nodes): int { - $version = $this->display->highestReleasedVersion($composition); + $count = 0; - if ($version === null) { - return 'nicht enthalten'; + foreach ($nodes as $node) { + if ($node['composition_id'] !== null) { + $count++; + } + + $count += $this->countCompositions($node['children']); } - $nodes = array_map( - fn (StructureNode $node): array => $this->present($user, $node), - $this->structure->tree($version), - ); + return $count; + } + + /** + * @param list> $nodes + */ + private function coverage(array $nodes): string + { $leaves = $this->leaves($nodes); $open = count(array_filter($leaves, fn (array $leaf): bool => $leaf['view_url'] !== null)); @@ -205,6 +477,15 @@ private function coverageLabel(User $user, Composition $composition): string return $open === count($leaves) ? 'nutzbar' : 'teilweise'; } + private function element(int $id): ?ContentElement + { + if (! array_key_exists($id, $this->elements)) { + $this->elements[$id] = ContentElement::query()->find($id); + } + + return $this->elements[$id]; + } + private function programUrl(StructureNode $node): ?string { if ($node->compositionId === null || $node->compositionVersionId === null) { diff --git a/app/Http/MemberLicenses.php b/app/Http/MemberLicenses.php new file mode 100644 index 0000000..f995c9b --- /dev/null +++ b/app/Http/MemberLicenses.php @@ -0,0 +1,323 @@ +> + */ + public function overview(User $user): Collection + { + return $this->grants($user)->map(fn (Grant $grant): array => $this->entry($user, $grant))->values(); + } + + /** + * @return array + */ + public function detail(User $user, Grant $grant): array + { + $grant->loadMissing('article.currentRelease.contents.elementVersion.element', 'article.currentRelease.rootCompositionVersion.composition'); + $entry = $this->entry($user, $grant); + $release = $grant->article->currentRelease; + $classes = []; + $contents = []; + + foreach ($release?->contents ?? [] as $content) { + $element = $content->elementVersion?->element; + + if ($element === null) { + continue; + } + + $classes[$element->output_class] = ($classes[$element->output_class] ?? 0) + 1; + $contents[$element->id] = [ + 'title' => $this->catalog->text($element)['title'], + 'kind' => $this->catalog->outputLabel($element->output_class), + 'role' => $content->role, + ]; + } + + $moduleCount = 0; + $rootVersion = $release?->rootCompositionVersion; + + if ($rootVersion !== null) { + $moduleCount = $this->countCompositions($this->structure->tree($rootVersion)); + } + + $scope = []; + + if ($moduleCount > 0) { + $scope[] = $moduleCount.' '.($moduleCount === 1 ? 'Modul' : 'Module'); + } + + foreach ($classes as $class => $count) { + $scope[] = $count.' '.$this->plural((string) $class, $count); + } + + $granted = $this->granted($grant); + $restrictions = []; + + foreach (array_keys($classes) as $class) { + foreach (CatalogLabels::FAEHIGKEITEN as $key => $label) { + if (str_starts_with($key, $class.':') && ! in_array($key, $granted, true)) { + $restrictions[] = $label.' ist in diesem Erwerb nicht enthalten.'; + } + } + } + + if ($entry['state'] !== 'aktiv') { + array_unshift($restrictions, $entry['state_note']); + } + + if ($entry['holder_kind'] === 'organisation') { + $restrictions[] = 'Die Nutzung gilt, solange deine Mitgliedschaft in dieser Organisation mit Bestellberechtigung besteht.'; + } + + return $entry + [ + 'scope' => $scope, + 'contents' => array_values($contents), + 'restrictions' => $restrictions, + 'composition' => $rootVersion?->composition, + 'open_url' => $rootVersion?->composition !== null + ? route('member.program', $rootVersion->composition) + : route('member.article', $grant->article), + ]; + } + + /** + * @return array + */ + private function entry(User $user, Grant $grant): array + { + $grant->loadMissing('article.currentRelease.rootCompositionVersion.composition.editorialContentKind', 'article.currentRelease.rootElementVersion.element', 'acquisition.party'); + $article = $grant->article; + $release = $article->currentRelease; + $state = $this->state($grant); + $snapshot = is_array($grant->rights_snapshot) ? $grant->rights_snapshot : []; + $conditions = is_array($grant->acquisition?->conditions) ? $grant->acquisition->conditions : []; + $holderKind = $grant->acquisition?->party?->type === PartyType::Organisation ? 'organisation' : 'person'; + $composition = $release?->rootCompositionVersion?->composition; + $element = $release?->rootElementVersion?->element; + $imageUrl = null; + + if ($grant->status === GrantStatus::Aktiv) { + $imageUrl = $composition !== null + ? ThumbnailRef::url('member.thumbnail', 'komposition', $composition->id, $composition->thumbnail_path) + : ($element === null ? null : ThumbnailRef::url('member.thumbnail', 'element', $element->id, $element->thumbnail_path)); + } + + $title = $composition !== null + ? $this->catalog->text($composition)['title'] + : ($element !== null ? $this->catalog->text($element)['title'] : app(CourseOutline::class)->title($article)); + + return [ + 'grant' => $grant, + 'id' => $grant->id, + 'title' => $title !== '' ? $title : $article->code, + 'kind' => app(CourseOutline::class)->kindLabel($article), + 'code' => $article->code, + 'image_url' => $imageUrl, + 'state' => $state['key'], + 'state_label' => $state['label'], + 'state_note' => $state['note'], + 'active' => $state['key'] === 'aktiv', + 'purpose' => filled($snapshot['purpose'] ?? null) ? CatalogLabels::zweck((string) $snapshot['purpose']) : null, + 'rights' => CatalogLabels::faehigkeiten(is_array($snapshot['capabilities'] ?? null) ? $snapshot['capabilities'] : []), + 'valid_from' => $grant->valid_from, + 'valid_until' => $grant->valid_until, + 'validity' => $this->validity($grant, $conditions), + 'term' => filled($conditions['term_rule'] ?? null) ? ProductOptions::termRuleLabel((string) $conditions['term_rule']) : null, + 'updates' => ($conditions['update_promise'] ?? null) === 'alle_freigegebenen_fassungen' + ? 'Spätere freigegebene Fassungen sind eingeschlossen.' + : null, + 'source' => $this->source($user, $grant), + 'holder_kind' => $holderKind, + 'holder' => $holderKind === 'organisation' ? (string) ($grant->acquisition?->party?->display_name ?? 'Organisation') : 'Persönlich', + 'url' => route('member.grant', $grant), + ]; + } + + /** + * Zustand wie in DecideAccess: Status aktiv, Beginn erreicht, Ende nicht überschritten. + * + * @return array{key: string, label: string, note: string} + */ + private function state(Grant $grant): array + { + $now = now(); + + if ($grant->status === GrantStatus::Widerrufen) { + return ['key' => 'widerrufen', 'label' => 'Widerrufen', 'note' => 'Diese Berechtigung wurde widerrufen.'.$this->reason($grant)]; + } + + if ($grant->status === GrantStatus::Ausgesetzt) { + return ['key' => 'ausgesetzt', 'label' => 'Ausgesetzt', 'note' => 'Diese Berechtigung ist derzeit ausgesetzt.'.$this->reason($grant)]; + } + + if ($grant->status === GrantStatus::Abgelaufen || ($grant->valid_until !== null && ! $grant->valid_until->greaterThan($now))) { + return ['key' => 'abgelaufen', 'label' => 'Abgelaufen', 'note' => 'Der Zeitraum dieser Berechtigung ist abgelaufen.']; + } + + if ($grant->valid_from !== null && $grant->valid_from->greaterThan($now)) { + return ['key' => 'geplant', 'label' => 'Noch nicht gültig', 'note' => 'Diese Berechtigung beginnt am '.$this->date($grant->valid_from).'.']; + } + + return ['key' => 'aktiv', 'label' => 'Aktiv', 'note' => '']; + } + + private function reason(Grant $grant): string + { + return filled($grant->status_reason) ? ' Grund: '.$grant->status_reason : ''; + } + + /** + * @param array $conditions + */ + private function validity(Grant $grant, array $conditions): string + { + $parts = []; + + if ($grant->valid_from !== null) { + $parts[] = 'seit '.$this->date($grant->valid_from); + } + + if ($grant->valid_until !== null) { + $parts[] = 'bis '.$this->date($grant->valid_until); + } elseif (($conditions['term_rule'] ?? 'dauerhaft') === 'dauerhaft') { + $parts[] = 'ohne Ablaufdatum'; + } else { + $parts[] = 'Ende nicht hinterlegt'; + } + + return implode(' · ', $parts); + } + + /** + * Herkunft des Rechts: Art des Erwerbs und, soweit vorhanden, die Bezeichnung des Angebots. + * + * @return array{label: string, detail: ?string, url: ?string} + */ + private function source(User $user, Grant $grant): array + { + $acquisition = $grant->acquisition; + $type = $acquisition?->type; + $label = match ($type) { + AcquisitionType::Bestellposition => 'Kauf', + AcquisitionType::FreierAbruf => 'Kostenloser Abruf', + AcquisitionType::ManuelleVergabe => 'Vergabe durch das Team', + AcquisitionType::Abonnement => 'Abonnement', + default => 'Erwerb', + }; + $detail = null; + $url = null; + + if ($type === AcquisitionType::Bestellposition && $acquisition?->reference_type === 'order_line') { + $line = OrderLine::query()->with('order')->find($acquisition->reference_id); + + if ($line !== null) { + $detail = $line->offer_name; + + if ($line->order?->user_id === $user->id) { + $url = route('member.order', $line->order); + } + } + } + + return ['label' => $label, 'detail' => $detail, 'url' => $url]; + } + + /** + * @return list Schlüssel „Klasse:Aktion“ der Berechtigung + */ + private function granted(Grant $grant): array + { + $keys = []; + $capabilities = is_array($grant->rights_snapshot['capabilities'] ?? null) ? $grant->rights_snapshot['capabilities'] : []; + + foreach ($capabilities as $class => $actions) { + foreach ((array) $actions as $action) { + $keys[] = $class.':'.$action; + } + } + + return $keys; + } + + /** + * @param list $nodes + */ + private function countCompositions(array $nodes): int + { + $count = 0; + + foreach ($nodes as $node) { + if ($node->compositionId !== null) { + $count++; + } + + $count += $this->countCompositions($node->children); + } + + return $count; + } + + private function plural(string $class, int $count): string + { + $forms = match ($class) { + 'film' => ['Film', 'Filme'], + 'audio' => ['Hörstück', 'Hörstücke'], + 'document', 'pdf' => ['Dokument', 'Dokumente'], + 'text' => ['Text', 'Texte'], + 'bild' => ['Bild', 'Bilder'], + default => [$class, $class], + }; + + return $count === 1 ? $forms[0] : $forms[1]; + } + + private function date(CarbonInterface $date): string + { + return $date->timezone(config('app.timezone'))->format('d.m.Y'); + } + + /** + * Alle Berechtigungen des Kontos, auch nicht mehr aktive: Inaktive sollen nachvollziehbar bleiben. + * + * @return Collection + */ + private function grants(User $user): Collection + { + return Grant::query() + ->usableBy($user) + ->with('article.currentRelease', 'acquisition.party') + ->orderBy('id') + ->get(); + } +} diff --git a/resources/css/app.css b/resources/css/app.css index 3fb5f54..591bb4b 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -17,562 +17,5 @@ @import './components/lf-premium-card.css'; /* Shop (Etappe 1): Produktseite, Warenkorb, Kasse. */ @import './components/lf-shop.css'; - -/* - * Mitgliederbereich: eigene Anwendungsoberfläche mit eigener Navigation. Er verwendet die gemeinsamen - * Tokens über seine bisherigen Variablennamen; Layout und Navigation bleiben unverändert. - */ -body.member { - --marke-navy: var(--lf-navy); - --marke-gruen: var(--lf-green); - --marke-aktion: var(--lf-green-deep); - --marke-gelb: var(--lf-yellow); - --marke-creme: var(--lf-cream); - --marke-tinte: var(--lf-ink); - --text: var(--color-text); - --text-leise: var(--color-text-muted); - --flaeche: var(--color-surface-subtle); - --flaeche-karte: var(--color-surface-raised); - --linie: var(--color-border); - --aktion: var(--color-action); - --aktion-text: var(--color-action-text); - --akzent: var(--color-accent); - --fokus: var(--color-focus); - --erfolg: var(--color-success); - --hinweis: var(--color-warning); - --fehler: var(--color-danger); - --radius-karte: var(--radius-card); - --radius-flaeche: var(--radius-panel); - --radius-pille: var(--radius-pill); - --schatten: var(--shadow-raised); - --schrift-lesen: var(--font-reading); - --schrift-auszeichnung: var(--font-display); - background: var(--flaeche); - color: var(--text); - font-family: var(--schrift-lesen); - font-size: var(--text-body); -} - -body.member :focus-visible { - outline: 3px solid var(--fokus); - outline-offset: 3px; -} - -body.member h1, -body.member h2, -body.member .member-mark .brand-name, -body.member .entry strong { - font-family: var(--schrift-auszeichnung); - letter-spacing: -0.02em; -} - -body.member h1 { - font-size: clamp(2.125rem, 4vw, 3.25rem); - line-height: 1.15; - margin: 0.2rem 0 0.6rem; - max-width: 18ch; -} - -body.member h2 { - font-size: clamp(1.35rem, 2vw, 1.7rem); - line-height: 1.25; - margin: 0 0 0.75rem; - overflow-wrap: anywhere; -} - -body.member .member-shell { - min-height: 100vh; -} - -body.member .member-side { - display: none; -} - -body.member .member-main { - min-width: 0; -} - -body.member .member-top, -body.member .member-sheet { - width: min(72rem, calc(100% - 2rem)); - margin-inline: auto; -} - -body.member .member-top { - display: flex; - flex-wrap: wrap; - align-items: center; - gap: 0.75rem 1rem; - min-height: 4.25rem; -} - -body.member .member-mark { - display: flex; - flex-direction: column; - color: inherit; - text-decoration: none; - line-height: 1.1; -} - -body.member .member-mark .brand-name { - font-size: 1.35rem; - white-space: nowrap; -} - -body.member .member-mark .brand-claim, -body.member .quiet { - color: var(--text-leise); - font-size: 0.9rem; -} - -body.member .member-quick { - display: flex; - gap: 0.75rem; - margin-left: auto; -} - -body.member .member-quick a { - color: inherit; - text-decoration: none; - min-height: 2.75rem; - display: inline-flex; - align-items: center; -} - -body.member .member-sheet { - padding-bottom: 6.5rem; -} - -body.member .member-intro { - margin: 0.5rem 0 1.5rem; -} - -body.member .lede { - max-width: 62ch; - font-size: 1.125rem; -} - -body.member .flag { - display: inline-block; - margin: 0; - padding: 0.15rem 0 0.2rem; - background-image: linear-gradient(var(--akzent), var(--akzent)); - background-position: 0 100%; - background-repeat: no-repeat; - background-size: 100% 0.45rem; - color: var(--marke-navy); - font-weight: 650; -} - -body.member .member-nav { - display: grid; - gap: 0.25rem; -} - -body.member .member-nav a, -body.member .member-dock a, -body.member .button, -body.member button.button { - min-height: 2.75rem; - display: inline-flex; - align-items: center; -} - -body.member .button, -body.member button.button { - font: inherit; - background: var(--aktion); - color: var(--aktion-text); - border: 0; - border-radius: var(--radius-pille); - padding: 0.55rem 1rem; - text-decoration: none; - cursor: pointer; - width: fit-content; -} - -body.member .button-quiet { - background: transparent; - color: var(--marke-navy); - box-shadow: inset 0 0 0 2px var(--marke-navy); -} - -body.member .member-dock { - position: fixed; - left: 0; - right: 0; - bottom: 0; - z-index: 5; - display: grid; - grid-template-columns: repeat(5, 1fr); - background: var(--marke-navy); - padding: 0.25rem 0.35rem calc(0.25rem + env(safe-area-inset-bottom)); -} - -body.member .member-dock a { - justify-content: center; - text-align: center; - color: #f7f6f2; - text-decoration: none; - font-size: 0.78rem; - line-height: 1.15; - padding: 0.35rem 0.15rem; - border-radius: 10px; -} - -body.member .member-dock a[aria-current='page'] { - background: var(--akzent); - color: var(--marke-navy); -} - -body.member .finder, -body.member .form { - display: grid; - gap: 0.9rem; - background: var(--flaeche-karte); - border: 1px solid var(--linie); - border-radius: var(--radius-flaeche); - padding: 1rem; - margin-bottom: 1.5rem; -} - -body.member .finder-query, -body.member .form label, -body.member legend { - font-weight: 650; -} - -body.member input[type='search'], -body.member input[type='text'], -body.member .form input { - font: inherit; - width: 100%; - box-sizing: border-box; - min-height: 2.75rem; - border: 1px solid #8aa084; - border-radius: 8px; - background: white; - padding: 0.55rem 0.75rem; -} - -body.member fieldset { - border: 0; - margin: 0; - padding: 0; - display: flex; - flex-wrap: wrap; - gap: 0.5rem 0.9rem; -} - -body.member .check { - display: flex; - align-items: flex-start; - gap: 0.55rem; - width: 100%; - min-height: 2.75rem; - font-weight: 400; -} - -body.member .check input { - width: 1.25rem; - height: 1.25rem; - margin-top: 0.15rem; - flex: none; -} - -body.member .finder-actions, -body.member .member-sheet form + form { - display: flex; - flex-wrap: wrap; - gap: 0.75rem; -} - -body.member .card-grid, -body.member .entry-grid { - display: grid; - gap: 1rem; -} - -body.member .media-card, -body.member .entry, -body.member .license-list li, -body.member .course > li, -body.member .empty { - background: var(--flaeche-karte); - border: 1px solid var(--linie); - border-radius: var(--radius-karte); - box-shadow: var(--schatten); -} - -body.member .media-card a, -body.member .entry { - display: grid; - color: inherit; - text-decoration: none; - min-height: 100%; -} - -body.member .thumb { - aspect-ratio: 4 / 3; - border-radius: var(--radius-karte) var(--radius-karte) 0 0; - background: - linear-gradient(160deg, var(--marke-navy) 0 58%, var(--akzent) 58% 68%, #e7efe4 68%); - display: flex; - flex-direction: column; - justify-content: space-between; - padding: 0.8rem; -} - -body.member .thumb .flag { - align-self: flex-start; - background-color: var(--akzent); - background-image: none; - padding: 0.2rem 0.55rem; - border-radius: var(--radius-pille); -} - -body.member .thumb img { - width: 100%; - height: 8rem; - object-fit: cover; - border-radius: 8px; -} - -body.member .thumb-label { - align-self: flex-start; - background: rgb(255 255 255 / 92%); - color: var(--marke-navy); - border-radius: 8px; - padding: 0.2rem 0.45rem; -} - -body.member .card-copy { - display: grid; - gap: 0.45rem; - padding: 0.9rem 1rem 1rem; -} - -body.member .card-copy p, -body.member .reading, -body.member .prose { - max-width: 68ch; -} - -body.member .entry { - padding: 1rem 1.1rem; - align-content: end; - min-height: 7.5rem; -} - -body.member .entry strong { - font-size: 2.4rem; - color: var(--marke-navy); -} - -body.member .state { - margin: 0.4rem 0; - font-weight: 650; -} - -body.member .state-nutzbar { - color: var(--erfolg); -} - -body.member .state-teilweise, -body.member .state-hinweis { - color: var(--hinweis); -} - -body.member .state-nicht, -body.member .state-nichtenthalten, -body.member .errors { - color: var(--fehler); -} - -body.member .errors, -body.member .status { - border-radius: 8px; - padding: 0.75rem 1rem; -} - -body.member .errors { - background: #fde8e6; -} - -body.member .status { - background: #e5f3ea; - color: var(--erfolg); -} - -body.member .facts { - display: grid; - gap: 0.75rem; - margin: 0 0 1.25rem; -} - -body.member .facts div { - background: var(--flaeche-karte); - border-radius: 8px; - padding: 0.75rem 0.9rem; -} - -body.member .facts dt { - color: var(--text-leise); - font-size: 0.9rem; -} - -body.member .facts dd { - margin: 0.15rem 0 0; - font-weight: 650; -} - -body.member .didactic, -body.member .reading { - background: var(--flaeche-karte); - border-left: 6px solid var(--akzent); - border-radius: 0 var(--radius-karte) var(--radius-karte) 0; - padding: 1rem 1.1rem; - margin-bottom: 1.5rem; -} - -body.member .course { - list-style: none; - padding: 0; - margin: 0; - display: grid; - gap: 1rem; -} - -body.member .course > li { - padding: 1rem; - display: grid; - gap: 0.7rem; -} - -body.member .course .course { - margin-top: 0.4rem; -} - -body.member .player { - display: grid; - gap: 0.7rem; - background: var(--marke-navy); - border-radius: var(--radius-karte); - padding: 0.7rem; -} - -body.member .player video, -body.member .player audio { - width: 100%; - max-height: 70vh; - background: #02182f; -} - -body.member .player .button { - justify-self: start; -} - -body.member .license-list { - list-style: none; - padding: 0; - display: grid; - gap: 1rem; -} - -body.member .license-list li, -body.member .empty { - padding: 1rem 1.1rem; -} - -body.member .crumb a { - color: var(--marke-navy); -} - -@media (min-width: 40rem) { - body.member .card-grid, - body.member .entry-grid, - body.member .facts { - grid-template-columns: 1fr 1fr; - } - - body.member .finder .check { - width: auto; - } -} - -@media (min-width: 64rem) { - body.member .member-shell { - display: grid; - grid-template-columns: 16.5rem minmax(0, 1fr); - } - - body.member .member-side { - display: flex; - flex-direction: column; - gap: 1.5rem; - position: sticky; - top: 0; - height: 100vh; - padding: 1.25rem 1rem 1.5rem; - background: var(--marke-navy); - color: #f7f6f2; - } - - body.member .member-side .member-mark, - body.member .member-side .member-nav a { - color: #f7f6f2; - } - - body.member .member-side .member-nav a { - text-decoration: none; - border-radius: 10px; - padding: 0 0.7rem; - } - - body.member .member-side .member-nav a[aria-current='page'] { - background: var(--akzent); - color: var(--marke-navy); - } - - body.member .member-logout { - margin-top: auto; - } - - body.member .member-logout button { - font: inherit; - color: #f7f6f2; - background: transparent; - border: 0; - min-height: 2.75rem; - cursor: pointer; - padding: 0 0.7rem; - } - - body.member .member-top, - body.member .member-dock { - display: none; - } - - body.member .member-top { - justify-content: flex-end; - } - - body.member .member-sheet { - padding-bottom: 3rem; - } - - body.member .card-grid { - grid-template-columns: 1fr 1fr 1fr; - } -} - -@media (prefers-reduced-motion: reduce) { - body.member * { - scroll-behavior: auto; - } -} - -/* Wortmarke in der dunklen Seitenleiste: heller Zusatz für ausreichenden Kontrast. */ -body.member .member-side .member-mark .brand-claim { - color: #d3dde8; -} +/* Mitgliederbereich nach Brand-UI-Kit 14 (ADR-45): Kopfzeile, Bibliothek, Programm, Medien, Lizenzen. Nur Tokens aus tokens.css. */ +@import './components/lf-member.css'; diff --git a/resources/css/components/lf-member.css b/resources/css/components/lf-member.css new file mode 100644 index 0000000..969abd8 --- /dev/null +++ b/resources/css/components/lf-member.css @@ -0,0 +1,1568 @@ +/* + * Mitgliederbereich (ADR-45) nach Brand-UI-Kit 14_mitgliederbereich_v2.0. + * + * Gestaltungsrichtung aus den freigegebenen Entwürfen: ruhige, helle Arbeitsoberfläche, bildorientierte Karten, gelbe + * Unterstreichung unter Seitentiteln, grüne Hauptaktion, Navy für Navigation. Die Entwürfe geben keine Pixelwerte vor. + * + * Größen: ausschließlich Tokens der zentralen Größenskala (tokens.css, ADR-44). Fließtext --text-body, Karten- und + * Listentext --text-small, Überschriften --text-h1/h2/h3, Abstände --space-*, Karten-Innenabstand --pad-card, + * Trefferflächen --touch-target, Breite --width-standard, Kopfzeile --header-height, Kartenbreite --card-min. + * Es gibt hier keine eigene Größenverwaltung; Abweichungen stellt die Verwaltung unter „Website → Design → Größen“ ein. + * + * Farben: Bedeutungswerte (--color-*) und Markenwerte (--lf-*). Zustände tragen Symbol und Text, nie Farbe allein. + */ + +body.member { + background: var(--color-surface-subtle); +} + +body.member svg { + flex: none; +} + +/* Symbole in Schaltflächen: Textgröße, nie die Eigengröße der Grafik. */ +body.member .button svg { + width: 1.1rem; + height: 1.1rem; +} + +/* --------------------------------------------------------------------------------------------------------------- + Kopfzeile und Navigation + --------------------------------------------------------------------------------------------------------------- */ + +.mb-header { + position: sticky; + top: 0; + z-index: 50; + background: var(--color-surface); + box-shadow: 0 1px 0 var(--color-border); +} + +.mb-header-inner { + display: flex; + align-items: center; + gap: var(--space-3) var(--space-5); + width: min(var(--width-standard), 100% - 2 * var(--gutter)); + min-height: var(--header-height); + margin-inline: auto; +} + +.mb-brand { + margin-right: auto; +} + +.mb-nav { + display: none; +} + +.mb-nav a, +.mb-account-button { + display: inline-flex; + align-items: center; + gap: var(--space-2); + min-height: var(--touch-target); + padding: 0 var(--space-4); + border: 0; + border-radius: var(--radius-pill); + background: transparent; + color: var(--color-heading); + font: inherit; + font-size: var(--text-button); + font-weight: 700; + text-decoration: none; + white-space: nowrap; + cursor: pointer; +} + +.mb-nav a svg, +.mb-account-button svg, +.mb-dock svg { + width: 1.25rem; + height: 1.25rem; +} + +.mb-nav a:hover, +.mb-account-button:hover { + background: var(--color-surface-subtle); + color: var(--color-heading); +} + +.mb-nav a[aria-current='page'] { + background: var(--lf-navy); + color: var(--lf-white); +} + +.mb-account { + position: relative; +} + +.mb-account-button[aria-expanded='true'] { + background: var(--color-surface-subtle); +} + +.mb-account-chevron { + width: 1rem; + height: 1rem; + transition: transform 0.15s ease; +} + +.mb-account-button[aria-expanded='true'] .mb-account-chevron { + transform: rotate(180deg); +} + +.mb-account-menu { + display: grid; + gap: var(--space-1); + min-width: 14rem; + padding: var(--space-2); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface); + box-shadow: var(--shadow-raised); +} + +html.js .mb-account-menu { + position: absolute; + top: calc(100% + var(--space-2)); + right: 0; + z-index: 60; +} + +html.js .mb-account:not(.is-open) .mb-account-menu { + display: none; +} + +.mb-account-name { + margin: 0; + padding: var(--space-2) var(--space-3); + border-bottom: 1px solid var(--color-border); + color: var(--color-text-muted); + font-size: var(--text-small); + overflow-wrap: anywhere; +} + +.mb-account-menu a, +.mb-account-menu button { + display: flex; + align-items: center; + width: 100%; + min-height: var(--touch-target); + padding: 0 var(--space-3); + border: 0; + border-radius: var(--radius-small); + background: transparent; + color: var(--color-heading); + font: inherit; + font-weight: 600; + text-align: left; + text-decoration: none; + cursor: pointer; +} + +.mb-account-menu a:hover, +.mb-account-menu button:hover { + background: var(--color-surface-subtle); +} + +.mb-account-menu a[aria-current='page'] { + background: var(--lf-navy); + color: var(--lf-white); +} + +/* Auf Smartphones nur das Symbol; die Beschriftung bleibt für Screenreader erhalten. */ +@media (max-width: 39.99rem) { + .mb-account-label { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + overflow: hidden; + clip: rect(0 0 0 0); + white-space: nowrap; + } + + .mb-account-button { + padding-inline: var(--space-2); + } +} + +/* Untere Leiste (Smartphone und schmale Tablets): dieselben drei Bereiche wie die Hauptnavigation. */ +.mb-dock { + position: fixed; + inset: auto 0 0; + z-index: 40; + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: var(--space-1); + padding: var(--space-1) var(--space-2) calc(var(--space-1) + env(safe-area-inset-bottom)); + background: var(--color-surface); + box-shadow: 0 -1px 0 var(--color-border), 0 -8px 22px rgb(3 37 81 / 6%); +} + +.mb-dock a { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 2px; + min-height: calc(var(--touch-target) + var(--space-2)); + border-radius: var(--radius-card); + color: var(--color-text-muted); + font-size: var(--text-small); + font-weight: 700; + line-height: 1.2; + text-decoration: none; +} + +.mb-dock a[aria-current='page'] { + background: var(--lf-navy); + color: var(--lf-white); +} + +@media (min-width: 56rem) { + .mb-brand { + margin-right: 0; + } + + .mb-nav { + display: flex; + gap: var(--space-1); + margin-right: auto; + margin-left: var(--space-4); + } + + .mb-dock { + display: none; + } + + .mb-main { + padding-bottom: var(--space-8); + } +} + +/* --------------------------------------------------------------------------------------------------------------- + Seitenrahmen, Kopfbereich, Suche, Chips + --------------------------------------------------------------------------------------------------------------- */ + +.mb-main { + width: min(var(--width-standard), 100% - 2 * var(--gutter)); + margin-inline: auto; + padding-top: var(--space-5); + padding-bottom: calc(var(--touch-target) + var(--space-8)); +} + +.mb-hero { + margin-bottom: var(--space-5); + padding: var(--pad-card); + border: 1px solid var(--color-border); + border-radius: var(--radius-panel); + background: + radial-gradient(circle at 92% 0%, var(--lf-yellow-tint) 0, transparent 46%), + linear-gradient(120deg, var(--color-surface) 0, var(--color-surface) 55%, var(--lf-green-tint) 100%); +} + +@media (min-width: 48rem) { + .mb-hero { + padding: var(--space-6) var(--pad-surface); + } +} + +.mb-kicker { + margin: 0 0 var(--space-2); + color: var(--lf-green-deep); + font-size: var(--text-small); + font-weight: 800; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.mb-title { + margin: 0; + font-size: var(--text-h1); + overflow-wrap: anywhere; +} + +.mb-title-line { + width: 3.5em; + height: 0.4em; + margin-top: 0.05em; +} + +.mb-lede { + max-width: var(--measure); + margin: var(--space-3) 0 0; + font-size: var(--text-lede); +} + +.mb-lede > :last-child { + margin-bottom: 0; +} + +.mb-search { + display: flex; + align-items: center; + gap: var(--space-2); + padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4); + border: 1px solid var(--color-border-strong); + border-radius: var(--radius-pill); + background: var(--color-surface); +} + +.mb-search:focus-within { + outline: 3px solid var(--color-focus); + outline-offset: 2px; +} + +.mb-search > svg { + width: 1.25rem; + height: 1.25rem; + color: var(--color-text-muted); +} + +.mb-search input[type='search'] { + flex: 1 1 auto; + min-width: 0; + min-height: calc(var(--touch-target) - var(--space-1)); + border: 0; + background: transparent; + color: var(--color-text); + font: inherit; +} + +.mb-search input[type='search']:focus-visible { + outline: none; +} + +.mb-chips { + display: flex; + flex-wrap: wrap; + gap: var(--space-2); + margin: var(--space-4) 0; +} + +.mb-chip, +.mb-anchors a { + display: inline-flex; + align-items: center; + gap: var(--space-1); + min-height: var(--touch-target); + padding: 0 var(--space-4); + border: 1px solid var(--color-border-strong); + border-radius: var(--radius-pill); + background: var(--color-surface); + color: var(--color-heading); + font-size: var(--text-button); + font-weight: 700; + text-decoration: none; +} + +.mb-chip svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-chip:hover, +.mb-anchors a:hover { + border-color: var(--lf-navy); + color: var(--color-heading); +} + +.mb-chip[aria-current='true'] { + border-color: var(--lf-navy); + background: var(--lf-navy); + color: var(--lf-white); +} + +/* Filter: aufklappbar, damit Smartphones Platz für die Ergebnisse behalten. */ +.mb-finder { + margin-bottom: var(--space-4); +} + +.mb-filter { + margin-top: var(--space-3); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface); +} + +.mb-filter > summary { + display: flex; + align-items: center; + gap: var(--space-2); + min-height: var(--touch-target); + padding: 0 var(--space-4); + color: var(--color-heading); + font-weight: 700; + list-style: none; + cursor: pointer; +} + +.mb-filter > summary::-webkit-details-marker { + display: none; +} + +.mb-filter > summary svg { + width: 1.25rem; + height: 1.25rem; +} + +.mb-filter-count { + display: inline-grid; + place-items: center; + min-width: 1.5rem; + height: 1.5rem; + padding: 0 var(--space-1); + border-radius: var(--radius-pill); + background: var(--lf-green-deep); + color: var(--lf-white); + font-size: var(--text-small); +} + +.mb-filter-body { + display: grid; + gap: var(--space-4) var(--space-6); + grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); + padding: var(--space-2) var(--space-4) var(--space-4); + border-top: 1px solid var(--color-border); +} + +.mb-filter-body fieldset { + min-width: 0; + margin: 0; + padding: 0; + border: 0; +} + +.mb-filter-body legend { + margin-bottom: var(--space-1); + padding: 0; + color: var(--color-heading); + font-weight: 800; +} + +.mb-check { + display: flex; + align-items: center; + gap: var(--space-2); + min-height: var(--touch-target); + cursor: pointer; +} + +.mb-check input { + width: 1.25rem; + height: 1.25rem; + margin: 0; + accent-color: var(--lf-green-deep); +} + +.mb-filter-apply { + grid-column: 1 / -1; +} + +.mb-toolbar { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: var(--space-2) var(--space-5); +} + +.mb-toolbar .mb-chips { + margin-block: var(--space-3) 0; +} + +.mb-sort { + display: inline-flex; + align-items: center; + gap: var(--space-2); + margin-top: var(--space-3); + font-weight: 700; +} + +.mb-sort select { + min-height: var(--touch-target); + padding: 0 var(--space-3); + border: 1px solid var(--color-border-strong); + border-radius: var(--radius-small); + background: var(--color-surface); + color: var(--color-text); + font: inherit; + font-weight: 400; +} + +.mb-count { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-2) var(--space-4); + margin: var(--space-4) 0 0; + color: var(--color-text-muted); + font-size: var(--text-small); + font-weight: 600; +} + +.mb-reset { + display: inline-flex; + align-items: center; + gap: var(--space-1); + min-height: var(--touch-target); + color: var(--color-heading); +} + +.mb-reset svg { + width: 1rem; + height: 1rem; +} + +/* --------------------------------------------------------------------------------------------------------------- + Abschnitte, Karten, Raster + --------------------------------------------------------------------------------------------------------------- */ + +.mb-section { + margin-top: var(--space-7); +} + +.mb-section-head { + display: flex; + flex-wrap: wrap; + align-items: baseline; + justify-content: space-between; + gap: var(--space-1) var(--space-4); + margin-bottom: var(--space-4); +} + +.mb-section-head h2, +.mb-section > h2 { + margin: 0 0 var(--space-4); +} + +.mb-section-head h2 { + margin: 0; +} + +.mb-section-count { + color: var(--color-text-muted); + font-weight: 600; +} + +.mb-more { + display: inline-flex; + align-items: center; + gap: var(--space-1); + min-height: var(--touch-target); + font-weight: 700; + text-decoration: none; +} + +.mb-more svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr)); + gap: var(--grid-gap); +} + +.mb-grid-wide { + grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--card-min) * 1.7)), 1fr)); +} + +.mb-card { + position: relative; + container-type: inline-size; + overflow: hidden; + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); + box-shadow: var(--shadow-raised); +} + +.mb-card-link { + display: grid; + grid-template-rows: auto 1fr; + height: 100%; + color: inherit; + text-decoration: none; +} + +.mb-card-link:focus-visible { + outline-offset: -3px; +} + +.mb-card-link:hover .mb-card-title { + color: var(--color-link-hover); + text-decoration: underline; +} + +.mb-card-visual, +.mb-detail-visual, +.mb-license-visual { + position: relative; + overflow: hidden; + background: var(--lf-green-tint); +} + +.mb-card-visual { + aspect-ratio: 16 / 9; +} + +.mb-card-visual img, +.mb-detail-visual img, +.mb-license-visual img { + display: block; + width: 100%; + height: 100%; + object-fit: cover; +} + +.mb-card-placeholder { + display: grid; + place-items: center; + width: 100%; + height: 100%; + color: var(--lf-navy); +} + +.mb-card-placeholder svg { + width: 2.5rem; + height: 2.5rem; + opacity: 0.7; +} + +.mb-card-play { + position: absolute; + inset: 50% auto auto 50%; + display: grid; + place-items: center; + width: calc(var(--touch-target) * 1.2); + height: calc(var(--touch-target) * 1.2); + border-radius: var(--radius-pill); + background: rgb(3 37 81 / 78%); + color: var(--lf-white); + transform: translate(-50%, -50%); +} + +.mb-card-play svg { + width: 1.4rem; + height: 1.4rem; +} + +.mb-card-body { + display: flex; + flex-direction: column; + gap: var(--space-2); + padding: var(--pad-card); +} + +.mb-card-title { + margin: 0; + font-size: var(--text-h3); + overflow-wrap: anywhere; +} + +.mb-card-text { + margin: 0; + color: var(--color-text-muted); + font-size: var(--text-small); +} + +.mb-card-note { + margin: 0; + color: var(--color-warning); + font-size: var(--text-small); +} + +.mb-card-facts { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-1) var(--space-3); + margin: auto 0 0; + padding: var(--space-2) 0 0; + color: var(--color-text-muted); + font-size: var(--text-small); + list-style: none; +} + +.mb-card-facts li { + display: inline-flex; + align-items: center; + gap: var(--space-1); +} + +.mb-card-facts svg { + width: 1rem; + height: 1rem; +} + +/* Smartphone: kompakte Karte mit Bild links, damit mehr Inhalte auf den Bildschirm passen. */ +@media (max-width: 39.99rem) { + .mb-card-link { + grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); + grid-template-rows: auto; + } + + .mb-card-visual { + aspect-ratio: auto; + min-height: 100%; + } + + .mb-card-body { + padding: var(--space-3); + } + + .mb-card-play { + width: var(--touch-target); + height: var(--touch-target); + } +} + +/* Breite Karte (Programme auf der Startseite): Bild links, Text rechts, sobald der Platz reicht. */ +@container (min-width: 30rem) { + .mb-grid-wide .mb-card-link { + grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); + grid-template-rows: auto; + } + + .mb-grid-wide .mb-card-visual { + aspect-ratio: auto; + min-height: 100%; + } +} + +.mb-type { + display: inline-flex; + align-items: center; + gap: var(--space-1); + color: var(--lf-green-deep); + font-size: var(--text-small); + font-weight: 800; + letter-spacing: 0.06em; + text-transform: uppercase; +} + +.mb-type svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-status { + display: inline-flex; + align-items: center; + gap: var(--space-1); + font-size: var(--text-small); + font-weight: 700; +} + +.mb-status svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-status-ok { + color: var(--color-success); +} + +.mb-status-warn { + color: var(--color-warning); +} + +.mb-status-off { + color: var(--color-danger); +} + +/* Startseite: Schnellzugriff und Lizenzhinweis */ +.mb-quick { + display: grid; + gap: var(--space-3); + grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-min)), 1fr)); +} + +.mb-quick-item { + display: flex; + align-items: center; + gap: var(--space-3); + min-height: calc(var(--touch-target) * 1.5); + padding: var(--space-3) var(--space-4); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); + color: var(--color-heading); + text-decoration: none; +} + +.mb-quick-item:hover { + border-color: var(--lf-navy); + color: var(--color-heading); +} + +.mb-quick-item > svg:first-child { + width: 1.75rem; + height: 1.75rem; + color: var(--lf-green-deep); +} + +.mb-quick-item > svg:last-child { + width: 1.1rem; + height: 1.1rem; + margin-left: auto; +} + +.mb-quick-copy { + display: grid; +} + +.mb-quick-label { + font-weight: 800; +} + +.mb-quick-count { + color: var(--color-text-muted); + font-size: var(--text-small); +} + +.mb-licenses-teaser { + display: grid; + align-content: start; + gap: var(--space-2); + padding: var(--pad-card); + border-radius: var(--radius-card); + background: var(--lf-green-tint); +} + +.mb-licenses-teaser h3 { + display: flex; + align-items: center; + gap: var(--space-2); + margin: 0; +} + +.mb-licenses-teaser h3 svg { + width: 1.5rem; + height: 1.5rem; + color: var(--lf-green-deep); +} + +.mb-licenses-teaser p { + margin: 0; + font-size: var(--text-small); +} + +.mb-licenses-teaser .button { + justify-self: start; + margin-top: var(--space-1); +} + +/* --------------------------------------------------------------------------------------------------------------- + Detailseiten: Programm, Modul, Film, Material, Lizenz + --------------------------------------------------------------------------------------------------------------- */ + +.mb-crumb { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-1) var(--space-4); + margin: 0 0 var(--space-3); +} + +.mb-crumb a { + display: inline-flex; + align-items: center; + gap: var(--space-1); + min-height: var(--touch-target); + color: var(--color-heading); + font-weight: 700; + text-decoration: none; +} + +.mb-crumb a:hover { + text-decoration: underline; +} + +.mb-crumb svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-trail { + display: flex; + flex-wrap: wrap; + gap: var(--space-1); + margin: 0; + padding: 0; + color: var(--color-text-muted); + font-size: var(--text-small); + list-style: none; +} + +.mb-trail li + li::before { + content: '›'; + margin-right: var(--space-1); +} + +.mb-trail a { + min-height: 0; + font-weight: 600; +} + +.mb-detail-head { + display: grid; + gap: var(--space-4) var(--space-6); + padding: var(--pad-card); + border: 1px solid var(--color-border); + border-radius: var(--radius-panel); + background: var(--color-surface-raised); +} + +@media (min-width: 48rem) { + .mb-detail-head { + grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); + align-items: center; + padding: var(--space-5); + } + + .mb-detail-head-license { + grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); + } +} + +.mb-detail-visual { + aspect-ratio: 16 / 10; + border-radius: var(--radius-card); +} + +.mb-detail-copy { + display: grid; + gap: var(--space-2); + justify-items: start; +} + +.mb-detail-copy > * { + margin-block: 0; +} + +.mb-facts { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-2) var(--space-4); + margin: 0; + padding: 0; + font-size: var(--text-small); + font-weight: 600; + list-style: none; +} + +.mb-facts li { + display: inline-flex; + align-items: center; + gap: var(--space-1); +} + +.mb-facts svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-note { + padding: var(--space-2) var(--space-3); + border-left: 4px solid currentColor; + border-radius: var(--radius-small); + background: var(--color-warning-surface); + color: var(--color-warning); + font-size: var(--text-small); +} + +.mb-muted { + margin: 0; + color: var(--color-text-muted); + font-size: var(--text-small); +} + +.mb-anchors { + display: flex; + flex-wrap: wrap; + gap: var(--space-2); + margin-top: var(--space-4); +} + +.mb-overview { + display: grid; + gap: var(--space-5); +} + +@media (min-width: 56rem) { + .mb-overview { + grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); + } +} + +.mb-overview h2 { + margin-top: 0; +} + +.mb-overview-single { + grid-template-columns: minmax(0, 1fr); +} + +.mb-goal, +.mb-note-card, +.mb-side-card { + padding: var(--pad-card); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); +} + +.mb-goal { + align-self: start; + border-color: transparent; + background: var(--lf-green-tint); +} + +.mb-goal h3, +.mb-side-card h2, +.mb-note-card h3 { + display: flex; + align-items: center; + gap: var(--space-2); + margin: 0 0 var(--space-2); + font-size: var(--text-h3); +} + +.mb-goal h3 svg { + width: 1.4rem; + height: 1.4rem; + color: var(--lf-green-deep); +} + +.mb-side-card h3 { + margin: var(--space-4) 0 var(--space-1); + font-size: var(--text-body); +} + +.mb-prose { + max-width: var(--measure); + overflow-wrap: anywhere; +} + +.mb-prose > :last-child { + margin-bottom: 0; +} + +.mb-reading { + max-width: var(--measure); + padding: var(--pad-card); + border-left: 6px solid var(--color-accent); + border-radius: 0 var(--radius-card) var(--radius-card) 0; + background: var(--color-surface-raised); +} + +/* Struktur eines Programms oder Moduls */ +.mb-outline { + display: grid; + gap: var(--space-3); + margin: 0; + padding: 0; + list-style: none; +} + +.mb-outline-item { + padding: var(--pad-card); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); +} + +.mb-outline .mb-outline { + margin-top: var(--space-3); + padding-left: var(--space-3); + border-left: 3px solid var(--color-accent); +} + +.mb-outline .mb-outline .mb-outline-item { + background: var(--color-surface-subtle); +} + +.mb-outline-row { + display: grid; + gap: var(--space-3); + align-items: center; +} + +@media (min-width: 48rem) { + .mb-outline-row { + grid-template-columns: minmax(0, 1fr) auto; + } + + .mb-outline-row:has(.mb-outline-thumb) { + grid-template-columns: calc(var(--card-min) * 0.5) minmax(0, 1fr) auto; + } +} + +.mb-outline-thumb { + width: 100%; + max-width: calc(var(--card-min) * 0.5); + aspect-ratio: 16 / 9; + border-radius: var(--radius-small); + object-fit: cover; +} + +.mb-outline-main { + display: grid; + gap: var(--space-1); + min-width: 0; +} + +.mb-outline-meta { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-1) var(--space-3); + margin: 0; +} + +.mb-outline-role { + color: var(--color-text-muted); + font-size: var(--text-small); +} + +.mb-outline-title { + margin: 0; + font-size: var(--text-h3); + overflow-wrap: anywhere; +} + +.mb-outline-text { + margin: 0; + color: var(--color-text-muted); + font-size: var(--text-small); +} + +.mb-outline-actions, +.mb-actions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-2) var(--space-3); +} + +.mb-outline-actions svg, +.mb-actions .button svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-outline-locked { + margin: var(--space-2) 0 0; + color: var(--color-text-muted); + font-size: var(--text-small); +} + +/* Film und Material im Zusammenhang */ +.mb-content-head { + display: grid; + gap: var(--space-2); + justify-items: start; + margin-bottom: var(--space-4); +} + +.mb-content-head > * { + margin-block: 0; +} + +.mb-content { + display: grid; + gap: var(--space-5); +} + +@media (min-width: 64rem) { + .mb-content { + grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem); + align-items: start; + } +} + +.mb-content-main, +.mb-content-side { + display: grid; + gap: var(--space-4); + min-width: 0; +} + +.mb-player { + overflow: hidden; + border-radius: var(--radius-card); + background: var(--lf-navy); + box-shadow: var(--shadow-raised); +} + +.mb-player video { + display: block; + width: 100%; + max-height: 75vh; + aspect-ratio: 16 / 9; + background: #000; +} + +.mb-player audio { + display: block; + width: 100%; + padding: var(--space-3); +} + +.mb-hint { + display: inline-flex; + align-items: center; + gap: var(--space-1); + color: var(--color-text-muted); + font-size: var(--text-small); +} + +.mb-hint svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-doc { + display: grid; + gap: var(--space-4); + justify-items: start; + padding: var(--pad-card); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); +} + +.mb-doc > svg { + width: 3rem; + height: 3rem; + color: var(--lf-green-deep); +} + +.mb-locked { + display: flex; + gap: var(--space-3); + padding: var(--pad-card); + border: 1px solid var(--color-border-strong); + border-radius: var(--radius-card); + background: var(--color-info-surface); + color: var(--color-info); +} + +.mb-locked > svg { + width: 1.75rem; + height: 1.75rem; +} + +.mb-locked h2 { + margin: 0 0 var(--space-1); + font-size: var(--text-h3); +} + +.mb-locked p { + margin: 0; +} + +.mb-side-card > p:last-child { + margin-bottom: 0; +} + +.mb-companions { + display: grid; + margin: 0; + padding: 0; + list-style: none; +} + +.mb-companions li { + display: grid; + grid-template-columns: auto minmax(0, 1fr) auto; + align-items: center; + gap: var(--space-3); + padding: var(--space-2) 0; + border-top: 1px solid var(--color-border); +} + +.mb-companions li:first-child { + border-top: 0; +} + +.mb-companions li > svg { + width: 1.5rem; + height: 1.5rem; + color: var(--lf-green-deep); +} + +.mb-companion-copy { + display: grid; + min-width: 0; +} + +.mb-companion-title { + font-weight: 700; + overflow-wrap: anywhere; +} + +.mb-companion-actions { + display: inline-flex; + gap: var(--space-1); +} + +.mb-icon-link { + display: inline-grid; + place-items: center; + width: var(--touch-target); + height: var(--touch-target); + border: 1px solid var(--color-border-strong); + border-radius: var(--radius-pill); + color: var(--lf-navy); +} + +.mb-icon-link:hover { + background: var(--lf-navy); + color: var(--lf-white); +} + +.mb-icon-link svg { + width: 1.2rem; + height: 1.2rem; +} + +/* Lizenzen */ +.mb-licenses { + display: grid; + gap: var(--space-3); + margin: 0; + padding: 0; + list-style: none; +} + +.mb-license { + display: grid; + gap: var(--space-3) var(--space-5); + padding: var(--pad-card); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); + box-shadow: var(--shadow-raised); +} + +.mb-license.is-inactive { + background: var(--color-surface-subtle); + box-shadow: none; +} + +.mb-license-visual { + aspect-ratio: 16 / 9; + border-radius: var(--radius-small); +} + +.mb-license-main { + display: grid; + gap: var(--space-1); + min-width: 0; +} + +.mb-license-main > * { + margin-block: 0; +} + +.mb-license-kind { + display: flex; + align-items: center; + gap: var(--space-1); + color: var(--lf-green-deep); + font-size: var(--text-small); + font-weight: 800; + letter-spacing: 0.06em; + text-transform: uppercase; +} + +.mb-license-kind svg { + width: 1.1rem; + height: 1.1rem; +} + +.mb-license-title { + font-size: var(--text-h3); + overflow-wrap: anywhere; +} + +.mb-license-title a { + color: var(--color-heading); + text-decoration: none; +} + +.mb-license-title a:hover { + text-decoration: underline; +} + +.mb-license-rights, +.mb-checklist { + display: grid; + gap: var(--space-1); + margin: 0; + padding: 0; + font-size: var(--text-small); + list-style: none; +} + +.mb-license-rights li, +.mb-checklist li { + display: flex; + align-items: flex-start; + gap: var(--space-2); +} + +.mb-license-rights svg, +.mb-checklist svg { + width: 1.1rem; + height: 1.1rem; + margin-top: 0.15em; + color: var(--color-success); +} + +.mb-license-side { + display: grid; + align-content: start; + justify-items: start; + gap: var(--space-2); +} + +.mb-license-side > * { + margin-block: 0; +} + +.mb-license-side .button svg { + width: 1rem; + height: 1rem; +} + +@media (min-width: 40rem) { + .mb-license { + grid-template-columns: calc(var(--card-min) * 0.55) minmax(0, 1fr); + } + + .mb-license-rights, + .mb-license-side { + grid-column: 2; + } +} + +@media (min-width: 72rem) { + .mb-license { + grid-template-columns: calc(var(--card-min) * 0.55) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.7fr); + align-items: center; + } + + .mb-license-rights, + .mb-license-side { + grid-column: auto; + } +} + +.mb-license-detail { + display: grid; + gap: var(--space-4); + margin-top: var(--space-5); +} + +@media (min-width: 56rem) { + .mb-license-detail { + grid-template-columns: repeat(2, minmax(0, 1fr)); + align-items: start; + } +} + +.mb-rights { + border-color: transparent; + background: var(--lf-green-tint); +} + +.mb-plain-list { + display: grid; + gap: var(--space-1); + margin: 0; + padding-left: 1.2rem; + list-style: disc; +} + +.mb-rights .mb-muted { + margin-top: var(--space-3); +} + +.mb-dl { + display: grid; + gap: var(--space-3); + margin: 0; +} + +.mb-dl dt { + color: var(--color-text-muted); + font-size: var(--text-small); +} + +.mb-dl dd { + margin: 0; + font-weight: 600; + overflow-wrap: anywhere; +} + +.mb-dl-cards { + grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); + margin-bottom: var(--space-4); +} + +.mb-dl-cards > div { + padding: var(--space-3) var(--space-4); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); +} + +/* Angebote und Bestellung */ +.mb-offers { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr)); + gap: var(--grid-gap); + margin: 0 0 var(--space-4); + padding: 0; + list-style: none; +} + +.mb-offer { + padding: var(--pad-card); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); +} + +.mb-offer h2 { + font-size: var(--text-h3); +} + +.mb-offer form { + margin-top: var(--space-3); +} + +body.member .form { + padding: var(--pad-card); + border: 1px solid var(--color-border); + border-radius: var(--radius-card); + background: var(--color-surface-raised); +} + +body.member .state { + font-weight: 700; +} + +body.member .state-hinweis { + color: var(--color-warning); +} + +.mb-empty { + margin-top: var(--space-5); +} diff --git a/resources/css/tokens.css b/resources/css/tokens.css index 4b6de50..a2b9261 100644 --- a/resources/css/tokens.css +++ b/resources/css/tokens.css @@ -195,6 +195,12 @@ :root { --header-height: calc(var(--ds-header) * 0.8 / 16 * 1rem); --header-height-initial: calc(var(--ds-header) * 0.8 / 16 * 1rem); --touch-target: 2.75rem; + + /* + * Mitgliederbereich (ADR-45): Mindestbreite einer Inhaltskarte im Raster. Leitet sich aus der Bildhöhe ab, + * damit die Kartenbreite mit der Größenskala wächst und schrumpft (bei 320 px Bildhöhe 256 px). Keine eigenen Basiswerte. + */ + --card-min: calc(var(--ds-media) * 0.8 / 16 * 1rem); } @media (min-width: 75rem) { diff --git a/resources/js/app.js b/resources/js/app.js index 5033362..adfe8aa 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -2,6 +2,7 @@ import Hls from 'hls.js'; import './site-nav.js'; import './card-clip.js'; import './hero-video.js'; +import './member-nav.js'; function attachPlayback(video) { if (!(video instanceof HTMLVideoElement) || video.dataset.playbackReady === '1') { diff --git a/resources/js/member-nav.js b/resources/js/member-nav.js new file mode 100644 index 0000000..01fa73d --- /dev/null +++ b/resources/js/member-nav.js @@ -0,0 +1,53 @@ +/** + * Mitgliederbereich: Konto-Menü und kleine Hilfen der Bibliothek. + * + * Das Konto-Menü ist ein Knopf mit aria-expanded. Escape schließt es und gibt den Fokus an den Knopf zurück; ein Klick + * oder Tabulatorsprung nach außen schließt es ebenfalls. Ohne JavaScript bleibt das Menü als Liste sichtbar (CSS: html.js). + */ +function setupAccountMenu(root) { + const button = root.querySelector('[data-member-menu-button]'); + const menu = root.querySelector('.mb-account-menu'); + + if (!button || !menu) { + return; + } + + const setOpen = (open, { restoreFocus = false } = {}) => { + root.classList.toggle('is-open', open); + button.setAttribute('aria-expanded', String(open)); + + if (open) { + menu.querySelector('a, button')?.focus(); + } else if (restoreFocus) { + button.focus(); + } + }; + + button.addEventListener('click', () => setOpen(button.getAttribute('aria-expanded') !== 'true')); + + root.addEventListener('keydown', (event) => { + if (event.key === 'Escape' && root.classList.contains('is-open')) { + event.preventDefault(); + setOpen(false, { restoreFocus: true }); + } + }); + + document.addEventListener('click', (event) => { + if (!root.contains(event.target) && root.classList.contains('is-open')) { + setOpen(false); + } + }); + + root.addEventListener('focusout', (event) => { + if (root.classList.contains('is-open') && event.relatedTarget && !root.contains(event.relatedTarget)) { + setOpen(false); + } + }); +} + +document.querySelectorAll('[data-member-menu]').forEach(setupAccountMenu); + +// Sortierung wirkt sofort; ohne JavaScript genügt „Suchen“. +document.querySelectorAll('[data-submit-on-change]').forEach((control) => { + control.addEventListener('change', () => control.form?.requestSubmit()); +}); diff --git a/resources/views/components/member/card.blade.php b/resources/views/components/member/card.blade.php new file mode 100644 index 0000000..e97b405 --- /dev/null +++ b/resources/views/components/member/card.blade.php @@ -0,0 +1,63 @@ +{{-- + Inhaltskarte der Bibliothek (Programm, Modul, Film, Material). Die ganze Karte ist ein Link, der Titel trägt den Linktext. + Bild: nur ein vorhandenes, für das Konto freigegebenes Vorschaubild; sonst ein ruhiger Platzhalter mit der Inhaltsart. + Zusätze: Modulzahl, Zeitbedarf, Verfügbarkeit, „Verwendet in“ bei Medien, die in mehreren Programmen stehen. +--}} +@props(['card']) +@php + $type = $card['type']; + $kindLabel = $card['kind'] ?? match ($type) { + 'programm' => 'Programm', + 'modul' => 'Modul', + 'film' => 'Film', + default => 'Material', + }; + $usedIn = array_values($card['used_in'] ?? []); + $placeholderIcon = match ($type) { + 'programm' => 'squares-2x2', + 'modul' => 'rectangle-stack', + 'film' => 'play-circle', + default => 'document-text', + }; +@endphp +
class(['mb-card', 'mb-card-'.$type]) }}> + +
+ @if (filled($card['image_url'] ?? null)) + {{ $card['image'] ?: '' }} + @else + + @endif + @if ($type === 'film') + + @endif +
+
+ +

{{ $card['title'] }}

+ @if (filled($card['summary'] ?? null)) +

{{ $card['summary'] }}

+ @endif +
    + @if (($card['module_count'] ?? 0) > 0) +
  • {{ $card['module_count'] }} {{ $card['module_count'] === 1 ? 'Modul' : 'Module' }}
  • + @endif + @if (! empty($card['duration_minutes'])) +
  • + @endif + @if (count($usedIn) > 1) +
  • in {{ count($usedIn) }} Programmen und Modulen
  • + @endif + @if (count($card['versions'] ?? []) > 1) +
  • in unterschiedlichen Fassungen
  • + @endif + @unless ($card['hide_status'] ?? false) +
  • + @endunless +
+ @if (filled($card['error'] ?? null)) +

{{ $card['error'] }}

+ @endif +
+
+
diff --git a/resources/views/components/member/hero.blade.php b/resources/views/components/member/hero.blade.php new file mode 100644 index 0000000..05df9f8 --- /dev/null +++ b/resources/views/components/member/hero.blade.php @@ -0,0 +1,15 @@ +{{-- + Kopf einer Mitgliederseite: Kennzeile, Titel mit der gelben Unterstreichung der Marke, Einleitung. + Keine Bilder und keine erfundenen Inhalte. Die Fläche folgt dem Token --color-surface-subtle. +--}} +@props(['kicker' => 'Mitgliederbereich', 'title']) +
class(['mb-hero']) }}> +

{{ $kicker }}

+

+ {{ $title }} + +

+ @if (trim((string) $slot) !== '') +
{{ $slot }}
+ @endif +
diff --git a/resources/views/components/member/status.blade.php b/resources/views/components/member/status.blade.php new file mode 100644 index 0000000..bf8501c --- /dev/null +++ b/resources/views/components/member/status.blade.php @@ -0,0 +1,18 @@ +{{-- Zustand einer Berechtigung oder eines Inhalts: Symbol, Text und Rahmen tragen gemeinsam, nie Farbe allein. --}} +@props(['state']) +@php + [$icon, $label, $tone] = match ($state) { + 'nutzbar' => ['check-circle', 'Verfügbar', 'ok'], + 'aktiv' => ['check-circle', 'Aktiv', 'ok'], + 'teilweise' => ['exclamation-triangle', 'Teilweise verfügbar', 'warn'], + 'geplant' => ['clock', 'Noch nicht gültig', 'warn'], + 'abgelaufen' => ['x-circle', 'Abgelaufen', 'off'], + 'ausgesetzt' => ['exclamation-triangle', 'Ausgesetzt', 'off'], + 'widerrufen' => ['x-circle', 'Widerrufen', 'off'], + default => ['lock-closed', 'Nicht enthalten', 'off'], + }; +@endphp +class(['mb-status', 'mb-status-'.$tone, 'state', 'state-'.str_replace(' ', '', (string) $state)]) }}> + diff --git a/resources/views/components/member/type.blade.php b/resources/views/components/member/type.blade.php new file mode 100644 index 0000000..a0982ff --- /dev/null +++ b/resources/views/components/member/type.blade.php @@ -0,0 +1,21 @@ +{{-- Inhaltsart mit Symbol: Programm, Modul, Film, Material. Der Text trägt die Aussage, das Symbol ist Beiwerk. --}} +@props(['type', 'label' => null]) +@php + $icon = match ($type) { + 'programm' => 'squares-2x2', + 'modul' => 'rectangle-stack', + 'film' => 'play-circle', + 'hoerstueck' => 'speaker-wave', + default => 'document-text', + }; + $text = $label ?? match ($type) { + 'programm' => 'Programm', + 'modul' => 'Modul', + 'film' => 'Film', + default => 'Material', + }; +@endphp +class(['mb-type', 'mb-type-'.$type]) }}> + diff --git a/resources/views/layouts/member.blade.php b/resources/views/layouts/member.blade.php index 1fc3003..81fde76 100644 --- a/resources/views/layouts/member.blade.php +++ b/resources/views/layouts/member.blade.php @@ -3,50 +3,70 @@ - @yield('title', 'Mitgliederbereich') + @yield('title', 'Mitgliederbereich') – Lara & Felix @fonts @vite(['resources/css/app.css', 'resources/js/app.js']) {{-- Abweichende Basiswerte der Größenskala (Website → Design → Größen); nach dem Stylesheet, damit sie gelten. --}} {{ \App\Domain\Design\DesignSettings::styleTag() }} +{{-- + Mitgliederbereich (Brand-UI-Kit 14, ADR-45). Eine Navigation: Meine Bibliothek, Programme, Meine Lizenzen und das + Konto-Menü (Profil, Angebote, Abmelden). Unter 56 rem ersetzt die untere Leiste die Hauptnavigation. + Jede Seite nennt ihren Bereich mit @section('nav', 'bibliothek'|'programme'|'lizenzen'|'konto'). +--}} +@php + $nav = trim((string) $__env->yieldContent('nav', 'bibliothek')); + $items = [ + ['key' => 'bibliothek', 'label' => 'Meine Bibliothek', 'short' => 'Bibliothek', 'icon' => 'book-open', 'href' => route('member.library')], + ['key' => 'programme', 'label' => 'Programme', 'short' => 'Programme', 'icon' => 'rectangle-stack', 'href' => route('member.programs')], + ['key' => 'lizenzen', 'label' => 'Meine Lizenzen', 'short' => 'Lizenzen', 'icon' => 'key', 'href' => route('member.grants')], + ]; +@endphp -
- -
-
- - -
- @csrf - -
-
-
- @if (session('status')) -

{{ session('status') }}

- @endif - @yield('content') -
+
+
+ + +
-
-