Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into team-create
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Feb 19, 2025
2 parents a517726 + 0b73af3 commit e2d23f0
Show file tree
Hide file tree
Showing 590 changed files with 7,752 additions and 2,351 deletions.
7 changes: 3 additions & 4 deletions app/Http/Controllers/Forum/ForumsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ public function __construct()
/**
* Get Forum Listing
*
* Get top-level forums, their subforums (max 2 deep), and their last topics.
* Get top-level forums and their subforums (max 2 deep).
*
* ---
*
* ### Response Format
*
* Field | Type |
* ----------- | ---------------------------- |
* forums | [Forum](#forum)[] |
* last_topics | [ForumTopic](#forum-topic)[] |
* forums | [Forum](#forum-object)[] |
*
* @response {
* "forums": [
Expand Down Expand Up @@ -98,7 +97,7 @@ public function markAsRead()
*
* Field | Type |
* ------------- | ---------------------------- |
* forum | [Forum](#forum) |
* forum | [Forum](#forum-object) |
* topics | [ForumTopic](#forum-topic)[] |
* pinned_topics | [ForumTopic](#forum-topic)[] |
*
Expand Down
11 changes: 8 additions & 3 deletions app/Http/Controllers/RankingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use App\Models\UserStatistics;
use App\Transformers\SelectOptionTransformer;
use App\Transformers\UserCompactTransformer;
use App\Transformers\UserStatisticsTransformer;
use DB;
use Illuminate\Pagination\LengthAwarePaginator;

Expand Down Expand Up @@ -242,7 +243,7 @@ public function index($mode, $type)
break;

default:
$includes = ['user', 'user.cover', 'user.country'];
$includes = UserStatisticsTransformer::RANKING_INCLUDES;

if ($this->country !== null) {
$includes[] = 'country_rank';
Expand All @@ -256,7 +257,7 @@ public function index($mode, $type)
$includes[] = 'rank_change_since_30_days';
}

$ranking = json_collection($stats, 'UserStatistics', $includes);
$ranking = json_collection($stats, new UserStatisticsTransformer(), $includes);
break;
}

Expand Down Expand Up @@ -346,7 +347,11 @@ public function spotlight($mode)
// transformer can't do nested includes with params properly.
// https://github.com/thephpleague/fractal/issues/239
'beatmapsets' => json_collection($beatmapsets, 'Beatmapset', ['beatmaps']),
'ranking' => json_collection($scores->get(), 'UserStatistics', ['user', 'user.cover', 'user.country']),
'ranking' => json_collection(
$scores->get(),
new UserStatisticsTransformer(),
UserStatisticsTransformer::RANKING_INCLUDES,
),
'spotlight' => json_item($spotlight, 'Spotlight', ["participant_count:mode({$mode})"]),
];
} else {
Expand Down
4 changes: 4 additions & 0 deletions app/Singletons/OsuAuthorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static function alwaysCheck($ability)
'IsNotOAuth',
'IsOwnClient',
'IsSpecialScope',
'TeamApplicationAccept',
'TeamApplicationStore',
'TeamPart',
'UserUpdateEmail',
Expand Down Expand Up @@ -1910,6 +1911,7 @@ public function checkScorePin(?User $user, ScoreBest|Solo\Score $score): string
public function checkTeamApplicationAccept(?User $user, TeamApplication $application): ?string
{
$this->ensureLoggedIn($user);
$this->ensureCleanRecord($user);

$team = $application->team;

Expand All @@ -1928,6 +1930,7 @@ public function checkTeamApplicationStore(?User $user, Team $team): ?string
$prefix = 'team.application.store.';

$this->ensureLoggedIn($user);
$this->ensureCleanRecord($user);

if ($user->team !== null) {
return $user->team->getKey() === $team->getKey()
Expand Down Expand Up @@ -1983,6 +1986,7 @@ public function checkTeamStore(?User $user): ?string
public function checkTeamUpdate(?User $user, Team $team): ?string
{
$this->ensureLoggedIn($user);
$this->ensureCleanRecord($user);

return $team->leader_id === $user->getKey() ? 'ok' : null;
}
Expand Down
12 changes: 8 additions & 4 deletions app/Transformers/UserStatisticsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

class UserStatisticsTransformer extends TransformerAbstract
{
const RANKING_INCLUDES = [
'user.country',
'user.cover',
'user.team',
];

protected array $availableIncludes = [
'country_rank',
'rank',
Expand All @@ -19,11 +25,9 @@ class UserStatisticsTransformer extends TransformerAbstract
'variants',
];

public function transform(UserStatistics\Model $stats = null)
public function transform(?UserStatistics\Model $stats = null)
{
if ($stats === null) {
$stats = new UserStatistics\Osu();
}
$stats ??= new UserStatistics\Osu();

if (!$GLOBALS['cfg']['osu']['scores']['experimental_rank_as_default'] && $GLOBALS['cfg']['osu']['scores']['experimental_rank_as_extra']) {
$globalRankExp = $stats->globalRankExp();
Expand Down
17 changes: 11 additions & 6 deletions resources/css/bem/contest-art-entry.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
.contest-art-entry {
@_top: contest-art-entry;

margin: 10px;
transform: translateZ(0);
--thumbnail-border-colour: transparent;
--thumbnail-height-multiplier: 1;
--thumbnail-scale: 1;
Expand All @@ -14,6 +12,12 @@
--trophy-colour: chocolate;
--vote-link-banner-bg: hsl(var(--hsl-b2));
--vote-link-banner-scale: 1;
margin: 10px;
transform: translateZ(0);
width: calc(
var(--thumbnail-size) * var(--thumbnail-scale) *
var(--thumbnail-width-multiplier)
);

&--placed-1 {
--thumbnail-scale: 1;
Expand Down Expand Up @@ -71,6 +75,10 @@
text-align: center;
}

&__result-name {
display: block;
}

&__result-place {
padding-right: 5px;

Expand All @@ -92,10 +100,7 @@
}

&__thumbnail {
width: calc(
var(--thumbnail-size) * var(--thumbnail-scale) *
var(--thumbnail-width-multiplier)
);
width: 100%;
height: calc(
var(--thumbnail-size) * var(--thumbnail-scale) *
var(--thumbnail-height-multiplier)
Expand Down
1 change: 0 additions & 1 deletion resources/css/bem/team-info-entry.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

&__value {
color: hsl(var(--hsl-c2));
display: grid;
min-width: 0;
}
}
22 changes: 15 additions & 7 deletions resources/css/bem/team-members.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@
// See the LICENCE file in the repository root for full licence text.

.team-members {
border-radius: @border-radius--large;
display: grid;
gap: 5px;
padding: 5px;
background-color: hsl(var(--hsl-b2));
gap: 10px;

&--owner {
background-color: hsl(var(--hsl-orange-1));
color: hsl(var(--hsl-orange-4));
&__type {
background-color: hsl(var(--hsl-b2));
border-radius: @border-radius--large;
display: grid;
gap: 5px;
grid-template-columns: repeat(auto-fill, minmax(@user-card-width-min, 1fr));
padding: 5px;

&--owner {
background-color: hsl(var(--hsl-orange-1));
color: hsl(var(--hsl-orange-4));
grid-template-columns: 1fr;
}
}

&__meta {
padding: 0 10px;
font-weight: 600;
display: grid;
grid-template-columns: 1fr auto;
grid-column: 1 / -1;
}
}
5 changes: 0 additions & 5 deletions resources/css/bem/team-summary.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
grid-template-columns: 2fr auto 3fr;
}

&__members {
display: grid;
gap: 10px;
}

&__sidebar {
&--separator {
display: none;
Expand Down
1 change: 1 addition & 0 deletions resources/js/contest-voting/art-entry.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class ArtEntry extends React.Component
div className: "#{bn}__result",
if showName
a
className: "#{bn}__result-name u-ellipsis-overflow"
href: @props.entry.preview
rel: 'nofollow noreferrer'
target: '_blank'
Expand Down
7 changes: 0 additions & 7 deletions resources/js/profile-page/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,11 @@ function updateTicks(chart: LineChart<Date>, data: ChartData[]) {
}
}

// @observer
export default class Chart extends React.Component<Props> {
private chart?: LineChart<Date>;
private readonly disposers = new Set<(() => void) | undefined>();
private readonly ref = React.createRef<HTMLDivElement>();

constructor(props: Props) {
super(props);

// makeObservable(this);
}

componentDidMount() {
$(window).on('resize', this.resizeChart);
this.disposers.add(() => $(window).off('resize', this.resizeChart));
Expand Down
16 changes: 16 additions & 0 deletions resources/lang/ar/authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,22 @@
],
],

'team' => [
'application' => [
'store' => [
'already_member' => "",
'already_other_member' => "",
'currently_applying' => '',
'team_closed' => '',
'team_full' => "",
],
],
'part' => [
'is_leader' => "",
'not_member' => '',
],
],

'user' => [
'page' => [
'edit' => [
Expand Down
1 change: 1 addition & 0 deletions resources/lang/ar/beatmappacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
],

'show' => [
'created_by' => '',
'download' => 'تحميل',
'item' => [
'cleared' => 'ممحو',
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/ar/beatmaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// See the LICENCE file in the repository root for full licence text.

return [
'invalid_ruleset' => '',

'change_owner' => [
'too_many' => '',
],
Expand Down
21 changes: 21 additions & 0 deletions resources/lang/ar/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,27 @@
'to_1_done' => 'اشارة "مُصلَح" اضيفت',
],

'issue_tag_osulazer' => [
'to_0' => '',
'to_0_done' => '',
'to_1' => '',
'to_1_done' => '',
],

'issue_tag_osustable' => [
'to_0' => '',
'to_0_done' => '',
'to_1' => '',
'to_1_done' => '',
],

'issue_tag_osuweb' => [
'to_0' => '',
'to_0_done' => '',
'to_1' => '',
'to_1_done' => '',
],

'lock' => [
'is_locked' => 'هذا الموضوع مغلق ولا يمكن الرد عليه',
'to_0' => 'فتح الموضوع',
Expand Down
26 changes: 23 additions & 3 deletions resources/lang/ar/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@
'channel' => 'المحادثة',
'forum_topic' => 'منتدى',
'news_post' => 'الأخبار',
'team' => '',
'user' => 'الملف الشخصي',
],

'filters' => [
'_' => 'الكل',
'user' => 'الملف الشخصي',
'beatmapset' => 'الخرائط',
'forum_topic' => 'المنتدى',
'news_post' => 'الأخبار',
'build' => 'النُسَخ',
'channel' => 'محادثة',
'forum_topic' => 'المنتدى',
'news_post' => 'الأخبار',
'team' => '',
'user' => 'الملف الشخصي',
],

'item' => [
Expand Down Expand Up @@ -159,6 +161,17 @@
],
],

'team' => [
'team_application' => [
'_' => '',

'team_application_accept' => "",
'team_application_accept_compact' => "",
'team_application_reject' => '',
'team_application_reject_compact' => '',
],
],

'user' => [
'user_beatmapset_new' => [
'_' => 'خريطة جديدة',
Expand Down Expand Up @@ -243,6 +256,13 @@
],
],

'team' => [
'team_application' => [
'team_application_accept' => "",
'team_application_reject' => '',
],
],

'user' => [
'user_beatmapset_new' => [
'user_beatmapset_new' => 'قام :username بإنشاء خرائط جديدة',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/ar/page_title.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
],
'teams_controller' => [
'_' => '',
'edit' => '',
'leaderboard' => '',
'show' => '',
],
'tournaments_controller' => [
Expand All @@ -134,6 +136,11 @@
'store' => [
'_' => 'المتجر',
],
'teams' => [
'members_controller' => [
'index' => '',
],
],
'users' => [
'modding_history_controller' => [
'_' => 'معلومات المُعَدِل',
Expand Down
Loading

0 comments on commit e2d23f0

Please sign in to comment.