From c3330be0f0502a8c3ecd0406aeea6b61cf3e78e0 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 23 Apr 2005 01:34:32 +0000 Subject: [PATCH] Add a simple web interface for adding/updating short titles. (No backend yet.) --- html/shorttitles.pl | 19 +++++++++++++++++++ html/templates/index.tmpl | 1 + html/templates/shorttitles.tmpl | 24 ++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100755 html/shorttitles.pl create mode 100644 html/templates/shorttitles.tmpl 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 %]
    + +
    +
    +
    -- 2.39.2