]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/tournament/Detail.js
tournament admin control
[alttp.git] / resources / js / components / tournament / Detail.js
index b6afe902c5b3acc5fb0210424728e3a099602ab9..66b425e83740e4c0b81cdf10efa6cc2368016c04 100644 (file)
@@ -3,13 +3,18 @@ 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 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 {
@@ -44,9 +49,16 @@ const Detail = ({
                <Col lg={8} xl={9}>
                        <div className="d-flex align-items-center justify-content-between">
                                <h1>{tournament.title}</h1>
-                               {mayViewProtocol(user, tournament) ?
-                                       <Protocol id={tournament.id} />
-                               : null}
+                               <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}
+                               </div>
                        </div>
                </Col>
        </Row>
@@ -55,6 +67,9 @@ const Detail = ({
                        <div className="tournament-sidebar">
                                <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} />