diff --git a/app/Models/TeamMember.php b/app/Models/TeamMember.php index d2510426fa1..84030ee2257 100644 --- a/app/Models/TeamMember.php +++ b/app/Models/TeamMember.php @@ -24,4 +24,13 @@ public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } + + public function userOrDeleted(): User + { + $user = $this->user; + + return $user === null || $user->isRestricted() + ? new DeletedUser(['user_id' => $this->user_id]) + : $user; + } } diff --git a/app/Models/User.php b/app/Models/User.php index 737b66a56e6..dcee75bbedc 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2128,8 +2128,10 @@ public static function attemptLogin($user, $password, $ip = null) public static function findForLogin($username, $allowEmail = false) { - if (!present($username)) { - return; + $username = trim($username ?? ''); + + if ($username === null) { + return null; } $query = static::where('username', $username); diff --git a/resources/css/bem/input-text.less b/resources/css/bem/input-text.less index 26555c9fd3d..c809fe8db09 100644 --- a/resources/css/bem/input-text.less +++ b/resources/css/bem/input-text.less @@ -10,4 +10,16 @@ padding: var(--input-padding); box-shadow: inset 0 0 0 2px var(--input-border-colour); border-radius: @border-radius-large; + + &--bbcode { + .fancy-scrollbar(); + display: grid; + grid-template-rows: 1fr auto; + gap: 5px; + } + + &__bbcode-textarea { + .reset-input(); + resize: none; + } } diff --git a/resources/css/bem/team-settings-description-preview.less b/resources/css/bem/team-settings-description-preview.less index f1c0b8481b2..2e78b7b8d33 100644 --- a/resources/css/bem/team-settings-description-preview.less +++ b/resources/css/bem/team-settings-description-preview.less @@ -4,5 +4,5 @@ .team-settings-description-preview { padding: 0 var(--padding); overflow-y: scroll; - max-height: calc(70 * var(--vh)); + height: calc(70 * var(--vh)); } diff --git a/resources/views/teams/edit.blade.php b/resources/views/teams/edit.blade.php index 7dd5a31fdec..91c57089f74 100644 --- a/resources/views/teams/edit.blade.php +++ b/resources/views/teams/edit.blade.php @@ -149,10 +149,13 @@ class="team-settings__image" {{ osu_trans('teams.edit.description.label') }} - +
+ + @include('forum._post_toolbar') +
diff --git a/resources/views/teams/members/index.blade.php b/resources/views/teams/members/index.blade.php index b470ff76f9d..cc549d03c58 100644 --- a/resources/views/teams/members/index.blade.php +++ b/resources/views/teams/members/index.blade.php @@ -24,23 +24,26 @@ {{ osu_trans('teams.members.index.table.joined_at') }} @foreach ($team->members as $member) + @php + $user = $member->userOrDeleted(); + @endphp
  • user->user_avatar) !!} + {!! background_image($user->user_avatar) !!} > - {!! link_to_user($member->user, null, '', []) !!} + {!! link_to_user($user, null, '', []) !!} - {{ osu_trans('teams.members.index.status.status_'.(int) $member->user->isActive()) }} - @if ($member->user->isOnline()) + {{ osu_trans('teams.members.index.status.status_'.(int) $user->isActive()) }} + @if ($user->isOnline()) ({!! osu_trans('users.show.lastvisit_online') !!}) - @elseif (($lastvisit = $member->user->displayed_last_visit) !== null) + @elseif (($lastvisit = $user->displayed_last_visit) !== null) ({!! osu_trans('users.show.lastvisit', ['date' => timeago($lastvisit)]) !!}) diff --git a/resources/views/teams/show.blade.php b/resources/views/teams/show.blade.php index ba1153f329c..7e8bd0e786c 100644 --- a/resources/views/teams/show.blade.php +++ b/resources/views/teams/show.blade.php @@ -3,16 +3,15 @@ See the LICENCE file in the repository root for full licence text. --}} @php - use App\Models\DeletedUser; use App\Transformers\UserCompactTransformer; $userTransformer = new UserCompactTransformer(); $toJson = fn ($users) => json_collection($users, $userTransformer, UserCompactTransformer::CARD_INCLUDES); $teamMembers = array_map($toJson, $team->members->mapToGroups(fn ($member) => [ - $member->user_id === $team->leader_id ? 'leader' : 'member' => $member->user, + $member->user_id === $team->leader_id ? 'leader' : 'member' => $member->userOrDeleted(), ])->all()); $teamMembers['member'] ??= []; - $teamMembers['leader'] ??= $toJson([$team->leader ?? new DeletedUser(['user_id' => $team->leader_id])]); + $teamMembers['leader'] ??= $toJson([$team->members()->make(['user_id' => $team->leader_id])->userOrDeleted()]); $headerUrl = $team->header()->url(); @endphp @@ -26,114 +25,112 @@ 'backgroundImage' => $headerUrl, ]]) -
    -
    -
    -
    - @if (priv_check('TeamUpdate', $team)->can()) -
    - - - +
    +
    +
    + @if (priv_check('TeamUpdate', $team)->can()) + - @endif -
    -
    -
    - @include('objects._flag_team', ['modifiers' => 'full', 'team' => $team]) + + +
    -
    -

    - {{ $team->name }} -

    -
    -

    - [{{ $team->short_name }}] -

    -
    + @endif +
    +
    +
    + @include('objects._flag_team', ['modifiers' => 'full', 'team' => $team]) +
    +
    +

    + {{ $team->name }} +

    +
    +

    + [{{ $team->short_name }}] +

    -