From 7b5b3d2ba2443fcbd1eaf7f7dcf7d8f289e9b88f Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Thu, 13 Jan 2022 13:34:04 +0100 Subject: [PATCH] Wait #5018 @2 --- resources/css/common/global.css | 1 + .../components/media-library/index.blade.php | 1 - resources/views/front/resources.blade.php | 128 ++++++++++++------ 3 files changed, 84 insertions(+), 46 deletions(-) diff --git a/resources/css/common/global.css b/resources/css/common/global.css index ef72455..79ded0a 100644 --- a/resources/css/common/global.css +++ b/resources/css/common/global.css @@ -1,5 +1,6 @@ html, body { min-height: 100%; + scroll-behavior: smooth; } body.overlay-open { diff --git a/resources/views/components/media-library/index.blade.php b/resources/views/components/media-library/index.blade.php index 558a7bc..6f39110 100644 --- a/resources/views/components/media-library/index.blade.php +++ b/resources/views/components/media-library/index.blade.php @@ -53,7 +53,6 @@ 'image' => $item['image'], ]; @endphp - {{-- TODO: deep-linking - is it actually needed here? Probably won't be linking directly to media... Could use replaceState() to update URL with querystring when opening / closing media. Check this on init / page load so that player can open the overlay already. Since the player needs several details, it's better to store this all in a data attribute and load the player based on the ID of the media / element that contains the data --}}
@endif - {{-- CHAPTERS --}} - @foreach ($resources['chapters'] as $chapter) -
-

{{ $chapter['chapter_title'] }}

- - {{-- SUB-CHAPTERS --}} - @foreach ($chapter['subchapters'] as $subchapter) -

{{ $subchapter['subchapter_title'] }}

-

{{ $subchapter['subchapter_subtitle'] }}

- - {{-- MEMOS --}} -
- @foreach ($subchapter['subchapter_memos'] as $memo) - @if (!$memo['memo_pdf'] || !isset($resources_pdf[$memo['memo_pdf']])) - @continue - @endif - @php - /** @var \Cubist\Backpack\Magic\PageData $pdf */ - $pdf = $resources_pdf[$memo['memo_pdf']]; - $pdfurl = $pdf->getImageURLbyCollection($pdf->get('file_upload')); - $thumb = !$pdf->get('file_thumb') || !$pdf->getImageURLbyCollection($pdf->get('file_thumb')) - ? $pdf->getImageURLbyCollection($pdf->get('file_upload'),'poster') - : $pdf->getImageURLbyCollection($pdf->get('file_thumb')); - @endphp - - {{----}} - -
- {{ $memo['memo_title'] }} -
- @if ($memo['memo_number']) -

{{ $memo['memo_number'] }}

+ {{-- MEMOS TITLE --}} +

+ + Les mémos + +

+ + {{-- MAIN SECTION WITH SIDEBAR --}} +
+ {{-- SIDEBAR --}} + + + {{-- CHAPTERS --}} +
+ @foreach ($resources['chapters'] as $index => $chapter) + {{-- CHAPTER BLOCK --}} +
+ {{-- + Opposing top padding (pt-4) + negative top margin (-mt-4) gives + space above scroll anchor position without misaligning anything + --}} +

+ {{ $index + 1 }}. {{ $chapter['chapter_title'] }} +

+ + {{-- SUB-CHAPTERS --}} + @foreach ($chapter['subchapters'] as $subchapter_index => $subchapter) + @if (empty($subchapter['subchapter_title'])) + @continue + @endif + +

{{ $index + 1 }}.{{ $subchapter_index + 1 }} {{ $subchapter['subchapter_title'] }}

+

{{ $subchapter['subchapter_subtitle'] }}

+ + {{-- MEMOS --}} +
+ @foreach ($subchapter['subchapter_memos'] as $memo) + @if (!$memo['memo_pdf'] || !isset($resources_pdf[$memo['memo_pdf']])) + @continue @endif -

{{ $memo['memo_title'] }}

-
{{ $memo['memo_subtitle'] }}
- -
+ @php + /** @var \Cubist\Backpack\Magic\PageData $pdf */ + $pdf = $resources_pdf[$memo['memo_pdf']]; + $pdfurl = $pdf->getImageURLbyCollection($pdf->get('file_upload')); + $thumb = !$pdf->get('file_thumb') || !$pdf->getImageURLbyCollection($pdf->get('file_thumb')) + ? $pdf->getImageURLbyCollection($pdf->get('file_upload'),'poster') + : $pdf->getImageURLbyCollection($pdf->get('file_thumb')); + @endphp + + {{----}} + +
+ {{ $memo['memo_title'] }} +
+ @if ($memo['memo_number']) +

{{ $memo['memo_number'] }}

+ @endif +

{{ $memo['memo_title'] }}

+
{{ $memo['memo_subtitle'] }}
+ +
+
+
+ @endforeach
- - @endforeach + @endforeach
@endforeach
- @endforeach +
{{-- PDF Viewer Overlay --}} -- 2.39.5