X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Ftournament%2FDetail.js;h=b6afe902c5b3acc5fb0210424728e3a099602ab9;hb=8d97d023740e438361e659c6e133418e33343178;hp=c966ca5250685da8c6a582302dfe6d8bd84ccdb7;hpb=eebc6384e56336b66ec250fc2aea3be6171d53ff;p=alttp.git diff --git a/resources/js/components/tournament/Detail.js b/resources/js/components/tournament/Detail.js index c966ca5..b6afe90 100644 --- a/resources/js/components/tournament/Detail.js +++ b/resources/js/components/tournament/Detail.js @@ -8,23 +8,38 @@ import Protocol from '../protocol/Protocol'; import Rounds from '../rounds/List'; import Box from '../users/Box'; import { + isRunner, mayAddRounds, mayViewProtocol, } from '../../helpers/permissions'; import { - getRunners, getTournamentAdmins, + getTournamentMonitors, hasRunners, hasTournamentAdmins, + hasTournamentMonitors, } from '../../helpers/Tournament'; import { withUser } from '../../helpers/UserContext'; import i18n from '../../i18n'; +const getClassName = (tournament, user) => { + const classNames = ['tournament']; + if (tournament.locked) { + classNames.push('is-locked'); + } else { + classNames.push('is-active'); + } + if (isRunner(user, tournament)) { + classNames.push('is-runner'); + } + return classNames.join(' '); +}; + const Detail = ({ addRound, tournament, user, -}) => +}) =>
@@ -36,7 +51,37 @@ const Detail = ({ - + +
+
+

{i18n.t('tournaments.scoreboard')}

+
+ {hasRunners(tournament) ? + + : null} + {hasTournamentAdmins(tournament) ? + <> +
+

{i18n.t('tournaments.admins')}

+
+ {getTournamentAdmins(tournament).map(p => +

+ )} + + : null} + {hasTournamentMonitors(tournament) ? + <> +
+

{i18n.t('tournaments.monitors')}

+
+ {getTournamentMonitors(tournament).map(p => +

+ )} + + : null} +
+ +

{i18n.t('rounds.heading')}

{addRound && mayAddRounds(user, tournament) ? @@ -49,24 +94,6 @@ const Detail = ({ : null} - -
-

{i18n.t('tournaments.scoreboard')}

-
- {hasRunners(tournament) ? - - : null} - {hasTournamentAdmins(tournament) ? - <> -
-

{i18n.t('tournaments.admins')}

-
- {getTournamentAdmins(tournament).map(p => -

- )} - - : null} - ;