summaryrefslogtreecommitdiff
path: root/perl-lib
diff options
context:
space:
mode:
authorRobert Haas2009-05-27 00:34:12 +0000
committerRobert Haas2009-05-27 00:34:12 +0000
commit1ebc05578d5550f80a16fce84124f9f55f8373d4 (patch)
tree16338d1c10dde9c719b59e1fc96fe09d6b8c89d9 /perl-lib
parent56a77ed5047ac68a86ad3264fc77ead05b305d38 (diff)
Tell the user what to do if no topics are defined.
Per suggestion from Josh Tolley.
Diffstat (limited to 'perl-lib')
-rw-r--r--perl-lib/PgCommitFest/Patch.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl-lib/PgCommitFest/Patch.pm b/perl-lib/PgCommitFest/Patch.pm
index 3cf1e2a..eda67d7 100644
--- a/perl-lib/PgCommitFest/Patch.pm
+++ b/perl-lib/PgCommitFest/Patch.pm
@@ -64,10 +64,10 @@ EOM
$r->add_control('name', 'text', 'Name', 'required' => 1);
$r->add_control('commitfest_topic', 'select', 'CommitFest Topic',
'required' => 1);
- $r->control('commitfest_topic')->choice($r->db->select(<<EOM,
+ my $commitfest_topic = $r->db->select(<<EOM, $d->{'commitfest_id'});
SELECT id, name FROM commitfest_topic WHERE commitfest_id = ? ORDER BY name
EOM
- $d->{'commitfest_id'}));
+ $r->control('commitfest_topic')->choice($commitfest_topic);
$r->add_control('patch_status', 'select', 'Patch Status', 'required' => 1);
$r->control('patch_status')->choice($r->db->select(<<EOM));
SELECT id, name FROM patch_status ORDER BY id
@@ -119,7 +119,8 @@ EOM
}
# Display template.
- $r->render_template('patch_form', { 'id' => $id, 'd' => $d });
+ $r->render_template('patch_form', { 'id' => $id, 'd' => $d,
+ 'commitfest_topic_warning' => !@$commitfest_topic });
}
sub view {