[Yapcom checkin] rev 9 - / lib/YAPC templates

[prev] [thread] [next] [lurker] [Date index for 2003/11/23]

From: svn
Subject: [Yapcom checkin] rev 9 - / lib/YAPC templates
Date: 18:08 on 23 Nov 2003
Author: gabor
Date: 2003-11-23 18:08:36 +0200 (Sun, 23 Nov 2003)
New Revision: 9

Modified:
   README
   lib/YAPC/Config.pm
   lib/YAPC/Organizer.pm
   templates/proposal.tmpl
Log:
make list of languages configurable

Modified: README
===================================================================
--- README	2003-11-23 15:59:56 UTC (rev 8)
+++ README	2003-11-23 16:08:36 UTC (rev 9)
@@ -39,6 +39,7 @@
     - add pages to get back lost password and get validation code again
         if e-mail was not yet validated.
     - make list of proposal lengths configurable and add 180 min too
+    - make list of languages configurable
 
 0.07_01 2003.11.15
     - send e-mail on every registration to administrator

Modified: lib/YAPC/Config.pm
===================================================================
--- lib/YAPC/Config.pm	2003-11-23 15:59:56 UTC (rev 8)
+++ lib/YAPC/Config.pm	2003-11-23 16:08:36 UTC (rev 9)
@@ -1,7 +1,8 @@
 package YAPC::Config;
 use strict;
 use warnings;
-our (@STORAGE, $dir, $db_dir, $db_file, $TIMEOUT, $templates_dir, $email_address, @proposal_lengths);
+our (@STORAGE, $dir, $db_dir, $db_file, $TIMEOUT, $templates_dir, $email_address);
+our (@proposal_languages, @proposal_lengths);
 
 $dir = "/home/gabor/projects/perl/perl.org.il/YAPC/dev";
 $email_address = 'yapc@xxxx.xxx.xx';
@@ -18,6 +19,10 @@
 
 
 @proposal_lengths = (5, 30, 60, 90, 180);
+@proposal_languages = qw(English Hebrew);
+
+
+
 1;
 
 =head1 VERSION

Modified: lib/YAPC/Organizer.pm
===================================================================
--- lib/YAPC/Organizer.pm	2003-11-23 15:59:56 UTC (rev 8)
+++ lib/YAPC/Organizer.pm	2003-11-23 16:08:36 UTC (rev 9)
@@ -94,6 +94,8 @@
        $t->param(run => 'send_proposal');
        my @length_selection = map {{ value => $_, text => $_} } @YAPC::Config::proposal_lengths;
        $t->param(length => \@length_selection);
+       my @language_selection = map {{ value => $_, text => $_} } @YAPC::Config::proposal_languages;
+       $t->param(language => \@language_selection);
     }
     return $t->output;
 }
@@ -377,6 +379,10 @@
        my $length = $q->param('length');
        my @length_selection = map {{ value => $_, text => $_, selected => ($length eq $_)} } @YAPC::Config::proposal_lengths;
        $t->param(length => \@length_selection);
+       my $language = $q->param('language');
+       my @language_selection = map {{ value => $_, text => $_, selected => ($language eq $_)} } @YAPC::Config::proposal_languages;
+       $t->param(language => \@language_selection);
+
        return $t->output;
     } else {
        my $talker_id = YAPC::Talk->get_user_id(id => $talk->id);

Modified: templates/proposal.tmpl
===================================================================
--- templates/proposal.tmpl	2003-11-23 15:59:56 UTC (rev 8)
+++ templates/proposal.tmpl	2003-11-23 16:08:36 UTC (rev 9)
@@ -12,8 +12,10 @@
 <table>
 <tr><td>Title:</td><td><input size=40 name="subject" value="<TMPL_VAR NAME=subject>" /></td></tr>
 <tr><td>Language:</td><td><select name="language">
-       <option value="Hebrew">Hebrew
-       <option value="English">English
+       <TMPL_LOOP NAME="language">
+         <option value="<TMPL_VAR NAME=value>" <TMPL_IF NAME=selected>selected</TMPL_IF>>
+           <TMPL_VAR NAME=text>
+       </TMPL_LOOP>
        </select></td></tr>
 <tr><td>Length (in minutes):</td><td>
      <select name="length">

Generated at 19:06 on 23 Nov 2003 by mariachi 0.51