]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/tournament/Detail.js
add APNG player
[alttp.git] / resources / js / components / tournament / Detail.js
index b20f2082c36ca2273584f55a1cb6890c194801fc..bb9b9284461ebe85ea7c4a818cb417c8c7df43f6 100644 (file)
@@ -5,18 +5,23 @@ import { withTranslation } from 'react-i18next';
 
 import ApplyButton from './ApplyButton';
 import Scoreboard from './Scoreboard';
+import ScoreChartButton from './ScoreChartButton';
+import SettingsButton from './SettingsButton';
+import ApplicationsButton from '../applications/Button';
 import Protocol from '../protocol/Protocol';
 import Rounds from '../rounds/List';
 import Box from '../users/Box';
 import {
        isRunner,
        mayAddRounds,
+       mayUpdateTournament,
        mayViewProtocol,
 } from '../../helpers/permissions';
 import {
        getTournamentAdmins,
        getTournamentMonitors,
        hasRunners,
+       hasScoreboard,
        hasTournamentAdmins,
        hasTournamentMonitors,
 } from '../../helpers/Tournament';
@@ -46,7 +51,11 @@ const Detail = ({
                        <div className="d-flex align-items-center justify-content-between">
                                <h1>{tournament.title}</h1>
                                <div className="button-bar">
+                                       <ApplicationsButton tournament={tournament} />
                                        <ApplyButton tournament={tournament} />
+                                       {mayUpdateTournament(user, tournament) ?
+                                               <SettingsButton tournament={tournament} />
+                                       : null}
                                        {mayViewProtocol(user, tournament) ?
                                                <Protocol id={tournament.id} />
                                        : null}
@@ -57,12 +66,17 @@ const Detail = ({
        <Row>
                <Col lg={{ order: 2, span: 4 }} xl={{ order: 2, span: 3 }}>
                        <div className="tournament-sidebar">
-                               <div className="d-flex align-items-center justify-content-between">
-                                       <h2>{i18n.t('tournaments.scoreboard')}</h2>
-                               </div>
-                               {hasRunners(tournament) ?
-                                       <Scoreboard tournament={tournament} />
-                               : null}
+                               {hasScoreboard(tournament) ? <>
+                                       <div className="d-flex align-items-center justify-content-between">
+                                               <h2>{i18n.t('tournaments.scoreboard')}</h2>
+                                               {hasRunners(tournament) && tournament.rounds.length > 2 ?
+                                                       <ScoreChartButton tournament={tournament} />
+                                               : null}
+                                       </div>
+                                       {hasRunners(tournament) ?
+                                               <Scoreboard tournament={tournament} />
+                                       : null}
+                               </> : null}
                                {hasTournamentAdmins(tournament) ?
                                        <>
                                                <div className="d-flex align-items-center justify-content-between">