$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
}
# 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 {
+[% 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='/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'>