}
sub view {
- my ($r) = @_;
+ my ($r, $extrapath) = @_;
my $aa = $r->authenticate();
+
+ # Target commitfest can be specified either by ID, or we allow special
+ # magic to fetch it by
my $id = $r->cgi_id();
- my $d = $r->db->select_one(<<EOM, $id) if defined $id;
-SELECT id, name, commitfest_status FROM commitfest_view WHERE id = ?
+ my $sqlbit;
+ if (defined $id) {
+ $sqlbit = "WHERE id = " . $r->db->quote($id);
+ }
+ elsif (defined $extrapath) {
+ if ($extrapath eq 'open') {
+ $sqlbit =
+ "WHERE commitfest_status_id = 2 ORDER BY name DESC LIMIT 1";
+ }
+ elsif ($extrapath eq 'inprogress') {
+ $sqlbit = <<EOM;
+WHERE commitfest_status_id IN (2, 3)
+ ORDER BY commitfest_status_id DESC, name DESC LIMIT 1
+EOM
+ }
+ elsif ($extrapath eq 'previous') {
+ $sqlbit =
+ "WHERE commitfest_status_id = 4 ORDER BY name DESC LIMIT 1";
+ }
+ }
+ if (!defined $sqlbit) {
+ $r->error_exit("Unable to identify target CommitFest.");
+ }
+
+ # Fetch target commitfest from database.
+ my $d = $r->db->select_one(<<EOM);
+SELECT id, name, commitfest_status FROM commitfest_view $sqlbit
EOM
$r->error_exit('CommitFest not found.') if !defined $d;
$r->set_title('CommitFest %s (%s)', $d->{'name'},
-<p>If you want to submit a new patch for review, please visit the <b>Open</b>
-CommitFest. If you want to help with the reviewing process for the
+<p>If you have submitted a patch to pgsql-hackers and want it to be reviewed,
+you should add it to the <a href='/action/commitfest_view/open'>Open
+CommitFest</a>. If you want to help with the reviewing process for the
CommitFest that's currently taking place (if any), please visit the
-CommitFest <b>In Progress</b>. Previous CommitFests are marked as
-<b>Closed</b>, and scheduled upcoming CommitFests (other than the one to which
-patches should be submitted) are marked as <b>Future</b>.</p>
+<a href='/action/commitfest_view/inprogress'>CommitFest In Progress</a>.
+These links are stable and always reference the open or in progress
+CommitFest, respectively, provided such a CommitFest exists. (If there is no
+CommitFest in progress, the CommitFest In Progress link will reference the
+Open CommitFest instead.) There is also a stable link for the
+<a href='/action/commitfest_view/previous'>Previous CommitFest</a>, meaning
+the most recent one that is now marked Closed. Upcoming CommitFests
+(other than the one to which patches should be submitted) are marked
+as <b>Future</b>.</p>
[% IF list.size == 0 %]
<p><b>No CommitFests have been defined yet.</b></p>