$closing_valid = 0;
}
+# Find all rounds currently shown on the bigscreen.
+my $active_rounds = $dbh->selectall_hashref('SELECT round FROM bigscreen.active_rounds WHERE tournament=?', 'round', undef, $id);
+
# Swoop all the data in in a big join, then order it over to quasi-sane Perl objects.
# (round -> parallel -> player -> songs -> title,chosen,score)
my $scores = ccbs::db_fetch_all($dbh,
$round = $score->{'round'};
push @rounds, { round => $round, parallels => [], locked => 0 };
$parallel = -1;
+
+ if (defined($active_rounds->{$round})) {
+ $rounds[$#rounds]->{'bigscreen'} = 1;
+ } else {
+ $rounds[$#rounds]->{'bigscreen'} = 0;
+ }
}
my $p = $rounds[$#rounds]->{'parallels'};
if ($score->{'parallel'} != $parallel) {
<div>
+ <form method="post" action="do-set-active-round.pl">
+ <p>
+ <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
+ <input type="hidden" name="round" value="[% r.round %]" />
+ [% IF p.bigscreen %]
+ <input type="hidden" name="show" value="false" />
+ <input type="submit" value="Fjern fra storskjerm" />
+ [% ELSE %]
+ <input type="hidden" name="show" value="true" />
+ <input type="submit" value="Vis på storskjerm" />
+ [% END %]
+ </p>
+ </form>
+
[% FOR p = r.parallels %]
<form method="post" action="do-edit-scores.pl">
<table class="scores">