From: Steinar H. Gunderson Date: Sat, 23 Apr 2005 01:34:32 +0000 (+0000) Subject: Add a simple web interface for adding/updating short titles. (No backend yet.) X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=c3330be0f0502a8c3ecd0406aeea6b61cf3e78e0;ds=sidebyside Add a simple web interface for adding/updating short titles. (No backend yet.) --- diff --git a/html/shorttitles.pl b/html/shorttitles.pl new file mode 100755 index 0000000..c6b93c8 --- /dev/null +++ b/html/shorttitles.pl @@ -0,0 +1,19 @@ +#! /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; diff --git a/html/templates/index.tmpl b/html/templates/index.tmpl index 289249f..9080821 100644 --- a/html/templates/index.tmpl +++ b/html/templates/index.tmpl @@ -14,6 +14,7 @@ [% IF !public %]
  • Legg til turnering
  • Sangvelger
  • +
  • Korte titler
  • [% END %] diff --git a/html/templates/shorttitles.tmpl b/html/templates/shorttitles.tmpl new file mode 100644 index 0000000..e721666 --- /dev/null +++ b/html/templates/shorttitles.tmpl @@ -0,0 +1,24 @@ +[%# vim:set filetype=html: %] + +
    +
    + + + + + + +[% FOR s = songs %] + + + + +[% END %] + + + +
    SangKort tittel
    [% s.title %]
    + +
    +
    +