X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Ftournament%2FDetail.js;h=cdc9b601bd3b3c81448b1e3015e57b312f3922bc;hb=cd36cb0ba2718e6bfa08765e7702d57dfe7fd733;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..cdc9b60 100644 --- a/resources/js/components/tournament/Detail.js +++ b/resources/js/components/tournament/Detail.js @@ -3,33 +3,91 @@ import React from 'react'; import { Button, Col, Container, Row } from 'react-bootstrap'; import { withTranslation } from 'react-i18next'; +import ApplyButton from './ApplyButton'; import Scoreboard from './Scoreboard'; +import ApplicationsButton from '../applications/Button'; 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, -}) => +}) =>

{tournament.title}

- {mayViewProtocol(user, tournament) ? - - : null} +
+ + + {mayViewProtocol(user, tournament) ? + + : null} +
- + +
+
+

{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) ? @@ -42,14 +100,6 @@ const Detail = ({ : null} - -
-

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

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