Skip to content

Commit

Permalink
Give patrons access to tournaments beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Sendouc committed Dec 22, 2024
1 parent 2b984f0 commit efd1d75
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/features/calendar/routes/calendar.new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export default function CalendarNewEventPage() {
return (
<Main className="stack items-center">
<Alert variation="WARNING">
No permissions to add tournaments. Access to tournaments beta can be
applied from Discord helpdesk for established TO&apos;s.
No permissions to add tournaments. Tournaments are in beta, accessible
by Patreon supporters and established TO&apos;s.
</Alert>
</Main>
);
Expand Down
5 changes: 5 additions & 0 deletions app/features/info/routes/support.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ const PERKS = [
name: "joinFive",
extraInfo: false,
},
{
tier: 2,
name: "tournamentsBeta",
extraInfo: false,
},
] as const;

export default function SupportPage() {
Expand Down
8 changes: 7 additions & 1 deletion app/features/user-page/UserRepository.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ export function findBannedStatusByUserId(userId: number) {
.executeTakeFirst();
}

const userIsTournamentOrganizer = sql<
string | null
>`IIF(COALESCE("User"."patronTier", 0) >= 2, 1, "User"."isTournamentOrganizer")`.as(
"isTournamentOrganizer",
);

export function findLeanById(id: number) {
return db
.selectFrom("User")
Expand All @@ -272,7 +278,7 @@ export function findLeanById(id: number) {
...COMMON_USER_FIELDS,
"User.isArtist",
"User.isVideoAdder",
"User.isTournamentOrganizer",
userIsTournamentOrganizer,
"User.patronTier",
"User.favoriteBadgeId",
"User.languages",
Expand Down
1 change: 1 addition & 0 deletions locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
"support.perk.prioritySupport.extra": "Access to a separate helpdesk that I prioritize for support requests",
"support.perk.previewQ": "Preview groups in SendouQ before joining",
"support.perk.joinFive": "Join up to 5 teams",
"support.perk.tournamentsBeta": "Access to tournaments beta",

"custom.colors.title": "Custom colors",
"custom.colors.bg": "Background",
Expand Down

0 comments on commit efd1d75

Please sign in to comment.