-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added avatars and rank summary to user profile cards #7518
Conversation
It doesn't let you set null because that's not how it works. You can check existing usages and display which you should share logic with (or at very least follow the same conditional and formatting paths). The formatting should match existing displays everywhere, which it doesn't right now. |
By matching formatting are you referring to displaying the stats as something like this?
On the frontend the number formatting is being done with |
Seems better, for sure. |
$globalRankLabel = trans('users.show.rank.global_simple'); | ||
$globalRankValue = number_format($stats["global_rank"]); | ||
$countryRankLabel = trans('users.show.rank.country_simple'); | ||
$countryRankValue = number_format($stats["country_rank"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will cause error when the user doesn't have any stats. And this will render 0
(converted from null
) if the user isn't ranked (when both either rank_score
and or rank_score_index
are 0).
$userData = $jsonChunks["user"]; | ||
$stats = $userData["statistics"]; | ||
$globalRankLabel = trans('users.show.rank.global_simple'); | ||
$globalRankValue = number_format($stats["global_rank"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use i18n_number_format
'titlePrepend' => blade_safe(str_replace(' ', ' ', e($user->username))), | ||
'pageDescription' => page_description($user->username), | ||
'pageDescription' => "{$globalRankLabel}: #{$globalRankValue}\n{$countryRankLabel}: #{$countryRankValue}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -2,9 +2,24 @@ | |||
Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. | |||
See the LICENCE file in the repository root for full licence text. | |||
--}} | |||
|
|||
@php | |||
$userData = $jsonChunks["user"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use '
for quotes
@extends('master', [ | ||
'canonicalUrl' => $user->url(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this one. The canonical url for user page for specific mode (/users/0/mania
) is probably the page for specific mode itself (/users/0/mania
) not the default one (/users/0
).
@php | ||
$userData = $jsonChunks["user"]; | ||
$stats = $userData["statistics"]; | ||
$globalRankLabel = trans('users.show.rank.global_simple'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the label is missing which mode the rank is for
@Xetera are you still interested in applying the review for this pull request? it should be in a good state to get merged if you follow up on that. |
Ah sorry, I got a little overwhelmed by the requested changes after I realized the scope of this is bigger than I thought. I'll try to see if I can address some of these over the weekend. Forgot osu had more than 1 game mode kekw |
I'm taking over this (and the related ogp issue, I guess 👀 ) |
superseded by #10570 since I can't push to this branch |
Before:
After:
I wasn't able to test for cases where the user doesn't have a global rank since mysql doesn't let me set null values on user ranks but I know profiles that don't have global ranks like https://osu.ppy.sh/users/4198271 exist. If that needs to be tested before this is merged I might need a little help with it 🙏.