the browser-facing portion of osu!
at master 35 lines 1.2 kB view raw
1{{-- 2 Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 3 See the LICENCE file in the repository root for full licence text. 4--}} 5@php 6 $group = $userGroup->group; 7 $playmodes = $userGroup->playmodes; 8 $hasPlaymodes = $playmodes !== null && count($playmodes) > 0; 9 $tag = $group->hasListing() ? 'a' : 'div'; 10 $title = $group->group_name; 11 12 if ($hasPlaymodes) { 13 $playmodeNames = implode(', ', array_map(fn ($mode) => osu_trans("beatmaps.mode.{$mode}"), $playmodes)); 14 $title .= " ({$playmodeNames})"; 15 } 16@endphp 17 18<{{ $tag }} 19 class="{{ class_with_modifiers('user-group-badge', $modifiers ?? null) }}" 20 data-label="{{ $group->short_name }}" 21 title="{{ $title }}" 22 style="{!! css_group_colour($group) !!}" 23 24 @if ($tag === 'a') 25 href="{{ route('groups.show', $group->getKey()) }}" 26 @endif 27> 28 @if ($hasPlaymodes) 29 <div class="user-group-badge__modes"> 30 @foreach ($playmodes as $playmode) 31 <i class="fal fa-extra-mode-{{$playmode}}"></i> 32 @endforeach 33 </div> 34 @endif 35</{{ $tag }}>