diff --git a/app/Http/Controllers/GalleryController.php b/app/Http/Controllers/GalleryController.php index b946ac9e2..7102d5d69 100644 --- a/app/Http/Controllers/GalleryController.php +++ b/app/Http/Controllers/GalleryController.php @@ -99,7 +99,7 @@ public function getGallery($id, Request $request) { return view('galleries.gallery', [ 'gallery' => $gallery, 'submissions' => $query->paginate(20)->appends($request->query()), - 'prompts' => [0 => 'Any Prompt'] + Prompt::whereIn('id', GallerySubmission::where('gallery_id', $gallery->id)->visible(Auth::user() ?? null)->accepted()->whereNotNull('prompt_id')->pluck('prompt_id')->toArray())->orderBy('name')->pluck('name', 'id')->toArray(), + 'prompts' => [0 => 'Any Prompt'] + Prompt::whereIn('id', GallerySubmission::where('gallery_id', $gallery->id)->visible(Auth::user() ?? null)->accepted()->whereNotNull('prompt_id')->select('prompt_id')->distinct()->pluck('prompt_id')->toArray())->orderBy('name')->pluck('name', 'id')->toArray(), 'childSubmissions' => GallerySubmission::whereIn('gallery_id', $gallery->children->pluck('id')->toArray())->where('is_visible', 1)->where('status', 'Accepted'), 'galleryPage' => true, 'sideGallery' => $gallery, diff --git a/resources/views/character/_image_info.blade.php b/resources/views/character/_image_info.blade.php index b2611d39e..843c73c45 100644 --- a/resources/views/character/_image_info.blade.php +++ b/resources/views/character/_image_info.blade.php @@ -51,27 +51,27 @@ {{-- Basic info --}}
{!! $gallery->description !!}
- @if (!$gallery->submissions->count() && $gallery->children->count() && $childSubmissions->count()) + @if (!$gallery->submissions()->count() && $gallery->children->count() && $childSubmissions->count())This gallery has no submissions; instead, displayed is a selection of the most recent submissions from its sub-galleries. Please navigate to one of the sub-galleries to view more.
@endif @@ -59,7 +59,7 @@ {!! Form::close() !!}