summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas2009-05-27 00:34:12 +0000
committerRobert Haas2009-05-27 00:34:12 +0000
commit1ebc05578d5550f80a16fce84124f9f55f8373d4 (patch)
tree16338d1c10dde9c719b59e1fc96fe09d6b8c89d9
parent56a77ed5047ac68a86ad3264fc77ead05b305d38 (diff)
Tell the user what to do if no topics are defined.
Per suggestion from Josh Tolley.
-rw-r--r--perl-lib/PgCommitFest/Patch.pm7
-rw-r--r--template/patch_form.tt27
2 files changed, 11 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 {
diff --git a/template/patch_form.tt2 b/template/patch_form.tt2
index cb03777..6505fe9 100644
--- a/template/patch_form.tt2
+++ b/template/patch_form.tt2
@@ -1,4 +1,11 @@
+[% IF commitfest_topic_warning %]
+<p class='error'>Note: No topics have been defined for this CommitFest.
+Before you can add patches to this CommitFest, you will need to visit the
+<a href='/https/git.postgresql.org/action/commitfest_topic_search?id=[% d.commitfest_id %]'>CommitFest
+Topics</a> page and add one or more topics.
+[% ELSE %]
<p></p>
+[% END %]
<div class='tblBasic'>
<table cellspacing='0' class='tblBasicGrey'>