Skip to content

Commit

Permalink
Merge pull request #1063 from SpeedyD/fix/content-warning-sublists
Browse files Browse the repository at this point in the history
fix(sublists): ContentWarnings variable not filled in on sublists
  • Loading branch information
itinerare authored Sep 16, 2024
2 parents 0d5aa3a + 8fc00e7 commit 15d3ec7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Http/Controllers/BrowseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ public function getSublist(Request $request, $key) {
$subSpecies = Species::visible(Auth::user() ?? null)->orderBy('specieses.sort', 'DESC')->pluck('name', 'id')->toArray();
}

$contentWarnings = CharacterImage::whereNotNull('content_warnings')->pluck('content_warnings')->flatten()->map(function ($warnings) {
return collect($warnings)->mapWithKeys(function ($warning) {
$lower = strtolower(trim($warning));

return [$lower => ucwords($lower)];
});
})->collapse()->unique()->sort()->toArray();

return view('browse.sub_masterlist', [
'isMyo' => false,
'characters' => $query->paginate(24)->appends($request->query()),
Expand Down

0 comments on commit 15d3ec7

Please sign in to comment.