--- /dev/null
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $cgi = new CGI;
+my $id = $cgi->param('id');
+
+my $dbh = ccbs::db_connect();
+
+# FIXME: This will fail with multiple short titles.
+my $songs = ccbs::db_fetch_all($dbh, 'SELECT song,title,shorttitle FROM songs NATURAL LEFT JOIN songshorttitles ORDER BY LOWER(title)');
+
+ccbs::print_header();
+ccbs::process_template('shorttitles.tmpl', 'Korte titler', {
+ songs => $songs,
+});
+$dbh->disconnect;
[% IF !public %]
<li><a href="add-tournament.pl">Legg til turnering</a></li>
<li><a href="randomsongs.pl">Sangvelger</a></li>
+ <li><a href="shorttitles.pl">Korte titler</a></li>
[% END %]
</ul>
</div>
--- /dev/null
+[%# vim:set filetype=html: %]
+
+ <div>
+ <form method="post" action="do-update-shorttitles.pl">
+ <table class="scores">
+ <tr>
+ <th>Sang</th>
+ <th>Kort tittel</th>
+ </tr>
+
+[% FOR s = songs %]
+ <tr>
+ <td>[% s.title %]</td>
+ <td><input name="st[% s.song %]" value="[% s.shorttitle %]" /></td>
+ </tr>
+[% END %]
+ <tr>
+ <td colspan="2">
+ <input type="submit" value="Oppdater" />
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>