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 {
isRunner,
mayAddRounds,
+ mayUpdateTournament,
mayViewProtocol,
} from '../../helpers/permissions';
import {
getTournamentAdmins,
getTournamentMonitors,
hasRunners,
+ hasScoreboard,
hasTournamentAdmins,
hasTournamentMonitors,
} from '../../helpers/Tournament';
<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}
<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">