Skip to content

Commit

Permalink
Merge pull request #11826 from nanaya/ruleset-selector-blade
Browse files Browse the repository at this point in the history
More general ruleset selector
  • Loading branch information
notbakaneko authored Jan 29, 2025
2 parents ae70c33 + c923434 commit 4a1d92a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
--}}

<ul class="game-mode">
@foreach (App\Models\Beatmap::MODES as $tab => $_int)
@foreach (App\Models\Beatmap::MODES as $ruleset => $_rulesetId)
<li>
<a
class="{{ class_with_modifiers('game-mode-link', ['active' => $mode === $tab ]) }}"
href="{{ $rankingUrl($type, $tab) }}"
class="{{ class_with_modifiers('game-mode-link', ['active' => $ruleset === $currentRuleset]) }}"
href="{{ $urlFn($ruleset) }}"
>
<span
class="fal fa-extra-mode-{{ $tab }}"
title="{{ osu_trans("beatmaps.mode.{$tab}") }}"
class="fal fa-extra-mode-{{ $ruleset }}"
title="{{ osu_trans("beatmaps.mode.{$ruleset}") }}"
></span>
</a>
</li>
Expand Down
17 changes: 13 additions & 4 deletions resources/views/rankings/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,31 @@

@extends('master', ['titlePrepend' => $titlePrepend ?? osu_trans("rankings.type.{$type}")])

@if ($hasMode)
@section('rulesetSelector')
@include('objects._ruleset_selector', [
'currentRuleset' => $mode,
'urlFn' => fn ($r) => $rankingUrl($type, $r),
])
@endsection
@endif

@section('content')
@component('layout._page_header_v4', ['params' => [
'links' => $links,
'theme' => 'rankings',
]])
@slot('contentAppend')
@if($hasMode)
@include('rankings._mode_selector')
@if ($hasMode)
@yield('rulesetSelector')
@endif
@endslot

@slot('linksAppend')
@yield('additionalHeaderLinks')
@if($hasMode)
@if ($hasMode)
<div class="visible-xs">
@include('rankings._mode_selector')
@yield('rulesetSelector')
</div>
@endif
@endslot
Expand Down

0 comments on commit 4a1d92a

Please sign in to comment.