X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Ftournament%2FDetail.js;h=b6afe902c5b3acc5fb0210424728e3a099602ab9;hb=dd283dc4c2004cbeb36d17b878bb67f94d75d06a;hp=5b8e7804a5e45e0006c27a4f9bdae44d985bff33;hpb=d1f28ea443b090c7593791eba9631796ccaeafe1;p=alttp.git diff --git a/resources/js/components/tournament/Detail.js b/resources/js/components/tournament/Detail.js index 5b8e780..b6afe90 100644 --- a/resources/js/components/tournament/Detail.js +++ b/resources/js/components/tournament/Detail.js @@ -8,22 +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 { 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,22 +52,34 @@ const Detail = ({ -
-

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

+
+
+

{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}
- {hasRunners(tournament) ? - - : null} - {hasTournamentAdmins(tournament) ? - <> -
-

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

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

- )} - - : null}