From ca7799d1f3862d671b6727b2ea9bb0c337962af8 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Thu, 2 Jul 2026 11:40:38 +0200 Subject: [PATCH] Finish share button and added gallery buttons --- app/View/Components/ShareRhpzUrl.php | 41 +++++++++++ config/app.php | 1 + resources/css/layout/entry.css | 32 ++++++++- .../views/components/share-rhpz-url.blade.php | 50 ++++++++++++++ resources/views/entries/show.blade.php | 54 +++++++++++++-- resources/views/news/show.blade.php | 68 ++++++++++++++----- 6 files changed, 219 insertions(+), 27 deletions(-) create mode 100644 app/View/Components/ShareRhpzUrl.php create mode 100644 resources/views/components/share-rhpz-url.blade.php diff --git a/app/View/Components/ShareRhpzUrl.php b/app/View/Components/ShareRhpzUrl.php new file mode 100644 index 0000000..b41a475 --- /dev/null +++ b/app/View/Components/ShareRhpzUrl.php @@ -0,0 +1,41 @@ +entry->type ?? "news" ) === 'news' ){ + $letter = 'n'; + } else { + $letter = $this->entry->type[0]; + } + + $id = $this->entry->id; + $shareUrl = config('app.share_url'); + + $url = rtrim($shareUrl, '/') . '/' . $letter . '/' . $id; + + return view('components.share-rhpz-url', compact('url') ); + } +} diff --git a/config/app.php b/config/app.php index e534a64..0320654 100644 --- a/config/app.php +++ b/config/app.php @@ -126,4 +126,5 @@ return [ 'store' => env('APP_MAINTENANCE_STORE', 'database'), ], + 'share_url' => env('RHPZ_SHARE_URL', ''), ]; diff --git a/resources/css/layout/entry.css b/resources/css/layout/entry.css index 159a915..89425f6 100644 --- a/resources/css/layout/entry.css +++ b/resources/css/layout/entry.css @@ -178,7 +178,6 @@ max-width: 90%; max-height: 90%; position: relative; - img { max-width: 100%; max-height: 90vh; @@ -198,12 +197,40 @@ font-weight: bold; cursor: pointer; user-select: none; - &:hover { color: var(--rhpz-orange); } } + .gallery-modal-arrow { + position: absolute; + top: 50%; + transform: translateY(-50%); + color: #fff; + cursor: pointer; + user-select: none; + display: flex; + align-items: center; + justify-content: center; + width: 50px; + height: 50px; + &:hover { + color: var(--rhpz-orange); + } + i { + width: 28px; + height: 28px; + } + } + + .gallery-modal-arrow-prev { + left: 20px; + } + + .gallery-modal-arrow-next { + right: 20px; + } + .gallery-modal-video { width: 90%; max-width: 960px; @@ -211,7 +238,6 @@ box-shadow: 0 10px 30px rgba(0,0,0,0.6); border: 1px solid var(--border); background-color: #000; - iframe { width: 100%; height: 100%; diff --git a/resources/views/components/share-rhpz-url.blade.php b/resources/views/components/share-rhpz-url.blade.php new file mode 100644 index 0000000..c2c6d10 --- /dev/null +++ b/resources/views/components/share-rhpz-url.blade.php @@ -0,0 +1,50 @@ +
+ + +
diff --git a/resources/views/entries/show.blade.php b/resources/views/entries/show.blade.php index 7214e2f..7339576 100644 --- a/resources/views/entries/show.blade.php +++ b/resources/views/entries/show.blade.php @@ -7,9 +7,16 @@ {{ \Diglactic\Breadcrumbs\Breadcrumbs::render() }}
-
+
@if( $entry->main_image ) - + + @else
@@ -208,6 +215,7 @@ Report / Claim Ownership @endauth +
@@ -240,25 +248,57 @@
@endif + + {{-- Gallery --}} + @if( $entry->gallery->isNotEmpty() ) -
+
@foreach( $entry->gallery as $galleryItem ) -
+
+ +
@endforeach
@endif + + {{-- End gallery --}} + @if( $entry->relevant_link )
diff --git a/resources/views/news/show.blade.php b/resources/views/news/show.blade.php index 56af108..b1cadf0 100644 --- a/resources/views/news/show.blade.php +++ b/resources/views/news/show.blade.php @@ -123,6 +123,8 @@ @endauth + +
@@ -134,25 +136,57 @@ {!! $news->description_html !!} @endif - @if( $news->gallery->isNotEmpty() ) -
- -
- @foreach( $news->gallery as $galleryItem ) -
- @endforeach -
- @if( $news->entry()->exists() || $news->relevant_link || $news->youtube_link )