diff options
author | Robert Haas | 2009-07-22 02:12:19 +0000 |
---|---|---|
committer | Robert Haas | 2009-07-22 02:12:19 +0000 |
commit | bff99c3de72f8e87f8d726a4f7e00b7e6fdb4661 (patch) | |
tree | e51591974bc5a47b730993f121cfc2c04dab3901 | |
parent | a2f8e5186a5071e1ee240721ddc309e11911295f (diff) |
Show status summary on commitfest view page.
-rw-r--r-- | perl-lib/PgCommitFest/CommitFest.pm | 15 | ||||
-rw-r--r-- | template/commitfest_view.tt2 | 8 |
2 files changed, 21 insertions, 2 deletions
diff --git a/perl-lib/PgCommitFest/CommitFest.pm b/perl-lib/PgCommitFest/CommitFest.pm index 84cee1f..6955839 100644 --- a/perl-lib/PgCommitFest/CommitFest.pm +++ b/perl-lib/PgCommitFest/CommitFest.pm @@ -191,7 +191,13 @@ EOM unshift @{$p->{'comment_list'}}, $c; } - # Add links and render template. + # Load status counts. + my $status_count_list = $r->db->select(<<EOM, $d->{'id'}); +SELECT patch_status_id, patch_status, sum(1) AS num_patches from patch_view + WHERE commitfest_id = ? GROUP BY 1, 2 ORDER BY 1 +EOM + + # Add links. $r->add_link('/action/patch_form?commitfest=' . $id, 'New Patch'); $r->add_link('/action/commitfest_activity?id=' . $id, 'Activity Log'); $r->add_link('/action/commitfest_topic_search?id=' . $id, @@ -202,7 +208,12 @@ EOM 'Delete CommitFest', 'Are you sure you want to delete this CommitFest?'); } - $r->render_template('commitfest_view', { 'd' => $d, 'patch_grouping' => [ + + # Render template. + $r->render_template('commitfest_view', { + 'd' => $d, 'status_count_list' => $status_count_list, + 'total_count' => 0+@$patch_list, + 'patch_grouping' => [ { 'name' => 'Pending Patches', 'patch_list' => $patch_grouping{'p'}, diff --git a/template/commitfest_view.tt2 b/template/commitfest_view.tt2 index 7bb6296..5e4db85 100644 --- a/template/commitfest_view.tt2 +++ b/template/commitfest_view.tt2 @@ -2,6 +2,14 @@ view all the comments for a particular patch, or to add a comment or make other changes, click on the patch name.</p> +[% IF status_count_list.size > 0 %] +<p><b>Status Summary</b>. +[% FOREACH sc = status_count_list %] +[% sc.patch_status %]: [% sc.num_patches %][% IF !loop.last %],[% ELSE %].[% END %] +[% END %] Total: [% total_count %]. +</p> +[% END %] + [% FOREACH g = patch_grouping %] <h2>[% g.name | htmlsafe %]</h2> |