<commit_before>{{--
    Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the GNU Affero General Public License v3.0.
    See the LICENCE file in the repository root for full licence text.
--}}
@php
    // this is pretty much a php conversion of beatmap-discussions/user-card.coffee
    $topClasses = $bn = 'beatmap-discussion-user-card';
    $group = optional($user)->visibleGroups()[0] ?? null;
    $hideStripe = $hideStripe ?? false;
@endphp

<div class="{{$topClasses}}" style="{!! css_group_colour($group ?? null) !!}">
    <div class="{{$bn}}__avatar">
        <a class="{{$bn}}__user-link" href="{{route('users.show', $user)}}">
            @if ($user)
                <div class="avatar avatar--full-rounded" style="background-image: url({{$user->user_avatar}})"></div>
            @else
                <div class="avatar avatar--full-rounded avatar--guest"></div>
            @endif
        </a>
    </div>
    <div class="{{$bn}}__user">
        <div class="{{$bn}}__user-row">
            <a class="{{$bn}}__user-link" href="{{route('users.show', $user)}}">
                <span class="{{$bn}}__user-text u-ellipsis-overflow">{{$user->username}}</span>
            </a>
            @if (!$user->is_bot)
                <a class="{{$bn}}__user-modding-history-link" href="{{route('users.modding.index', $user)}}" title="{{trans('beatmap_discussion_posts.item.modding_history_link')}}">
                    <i class='fas fa-align-left'></i>
                </a>
            @endif
        </div>
        <div class="{{$bn}}__user-badge">
            @if (isset($group))
                <div
                    class="user-group-badge"
                    title="{{ $group->group_name }}"
                    data-label="{{ $group->short_name }}"
                    style="{!! css_group_colour($group) !!}"
                ></div>
            @endif
        </div>
    </div>
    @if (!$hideStripe)
        <div class="{{$bn}}__user-stripe"></div>
    @endif
</div><commit_msg>Fix discussion post listing page on null user<commit_after>{{--
    Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the GNU Affero General Public License v3.0.
    See the LICENCE file in the repository root for full licence text.
--}}
@php
    // this is pretty much a php conversion of beatmap-discussions/user-card.coffee
    $topClasses = $bn = 'beatmap-discussion-user-card';
    $group = optional($user)->visibleGroups()[0] ?? null;
    $hideStripe = $hideStripe ?? false;
@endphp

<div class="{{$topClasses}}" style="{!! css_group_colour($group ?? null) !!}">
    <div class="{{$bn}}__avatar">
        @if (isset($user))
            <a class="{{$bn}}__user-link" href="{{route('users.show', $user)}}">
                <span class="avatar avatar--full-rounded" style="background-image: url({{$user->user_avatar}})"></span>
            </a>
        @else
            <span class="{{$bn}}__user-link">
                <span class="avatar avatar--full-rounded avatar--guest"></span>
            </span>
        @endif
    </div>
    <div class="{{$bn}}__user">
        <div class="{{$bn}}__user-row">
            @if (isset($user))
                <a class="{{$bn}}__user-link" href="{{route('users.show', $user)}}">
                    <span class="{{$bn}}__user-text u-ellipsis-overflow">{{$user->username}}</span>
                </a>
                @if (!$user->is_bot)
                    <a class="{{$bn}}__user-modding-history-link" href="{{route('users.modding.index', $user)}}" title="{{trans('beatmap_discussion_posts.item.modding_history_link')}}">
                        <i class='fas fa-align-left'></i>
                    </a>
                @endif
            @else
                <span class="{{$bn}}__user-link">
                    <span class="{{$bn}}__user-text u-ellipsis-overflow">{{ trans('users.deleted') }}</span>
                </span>
            @endif
        </div>
        <div class="{{$bn}}__user-badge">
            @if (isset($group))
                <div
                    class="user-group-badge"
                    title="{{ $group->group_name }}"
                    data-label="{{ $group->short_name }}"
                    style="{!! css_group_colour($group) !!}"
                ></div>
            @endif
        </div>
    </div>
    @if (!$hideStripe)
        <div class="{{$bn}}__user-stripe"></div>
    @endif
</div>
{'fraction_non_alphanumeric': 0.1951945080091533, 'fraction_numerical': 0.0013729977116704805, 'mean_word_length': 2.0695224719101124, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3103657', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1308, 'n_words': 263}