Add front end for resetting the song chooser.
authorSteinar H. Gunderson <sesse@samfundet.no>
Thu, 17 Feb 2005 19:20:31 +0000 (19:20 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Thu, 17 Feb 2005 19:20:31 +0000 (19:20 +0000)
html/randomsongs.pl [new file with mode: 0755]
html/templates/index.tmpl
html/templates/randomsongs.tmpl [new file with mode: 0755]

diff --git a/html/randomsongs.pl b/html/randomsongs.pl
new file mode 100755 (executable)
index 0000000..daa36cb
--- /dev/null
@@ -0,0 +1,16 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $dbh = ccbs::db_connect();
+
+my $ref = $dbh->selectrow_hashref('SELECT COUNT(*) AS num_used FROM randomsongsused');
+
+ccbs::print_header();
+ccbs::process_template('randomsongs.tmpl', 'Sangvelger', {
+               num_used => $ref->{'num_used'}
+       });
+
+$dbh->disconnect;
index ccb16c2..06f4e32 100644 (file)
@@ -10,5 +10,6 @@
   <ul>
     <li><a href="tournaments.pl">Turneringer</a></li>
     <li><a href="add-tournament.pl">Legg til turnering</a></li>
+    <li><a href="randomsongs.pl">Sangvelger</a></li>
   </ul>
 </div>
diff --git a/html/templates/randomsongs.tmpl b/html/templates/randomsongs.tmpl
new file mode 100755 (executable)
index 0000000..f8ff24f
--- /dev/null
@@ -0,0 +1,11 @@
+[%# vim:set filetype=html: %]
+<div>
+  <p>For øyeblikket er <strong>[% num_used %]</strong> sanger satt som
+    brukt i sangvelgeren. Nullstiller du sangvelgeren, går den tilbake
+    til 0 og alle sanger kan potensielt trekkes ut når du lager en ny
+    gruppe.</p>
+
+  <form action="do-reset-randomsongs.pl" method="post">
+    <p><input type="submit" value="Nullstill sangvelger" /></p>
+  </form>
+</div>