X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Ftournament%2FDetail.js;h=1afcc29f10611a1e434c13f3a035dcfad3da9cee;hb=33cc4da565ffb07ee4f8d9cbafb248629b85e65a;hp=3ce0b48998987405626aa82bf5de8244f63ab28f;hpb=521a24ff68a2b077a19c3c499143db5fa9203be0;p=alttp.git diff --git a/resources/js/components/tournament/Detail.js b/resources/js/components/tournament/Detail.js index 3ce0b48..1afcc29 100644 --- a/resources/js/components/tournament/Detail.js +++ b/resources/js/components/tournament/Detail.js @@ -6,18 +6,38 @@ import { withTranslation } from 'react-i18next'; import Scoreboard from './Scoreboard'; import Protocol from '../protocol/Protocol'; import Rounds from '../rounds/List'; +import Box from '../users/Box'; import { + isRunner, mayAddRounds, mayViewProtocol, } from '../../helpers/permissions'; +import { + getTournamentAdmins, + hasRunners, + hasTournamentAdmins, +} 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, -}) => +}) =>
@@ -29,7 +49,25 @@ const Detail = ({ - + +
+

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

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

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

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

+ )} + + : null} + +

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

{addRound && mayAddRounds(user, tournament) ? @@ -42,14 +80,6 @@ const Detail = ({ : null} - -
-

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

-
- {tournament.participants ? - - : null} - ;