Include name of patch in subject line when adding/editing a patch comment.
authorRobert Haas <[email protected]>
Fri, 3 Jul 2009 23:09:49 +0000 (19:09 -0400)
committerRobert Haas <[email protected]>
Fri, 3 Jul 2009 23:10:45 +0000 (19:10 -0400)
Also include some directions on the patch comment form, to indicate that
the message-ID is optional.

Per suggestions from Tom Lane.

etc/view.sql
perl-lib/PgCommitFest/PatchComment.pm
template/patch_comment_form.tt2

index af98e1e64d43dea02393d3aecbc9fa5d47edc443..c80fd3a65306810ab0d8367cba522c397995e475 100644 (file)
@@ -24,8 +24,10 @@ FROM
 
 CREATE OR REPLACE VIEW patch_comment_view AS
 SELECT
-       v.id, v.patch_id, v.patch_comment_type_id, pct.name AS patch_comment_type,
-       v.message_id, v.content, v.creator, v.creation_time
+       v.id, v.patch_id, p.name AS patch_name, v.patch_comment_type_id,
+       pct.name AS patch_comment_type, v.message_id, v.content, v.creator,
+       v.creation_time
 FROM
        patch_comment v
-       INNER JOIN patch_comment_type pct ON v.patch_comment_type_id = pct.id;
+       INNER JOIN patch_comment_type pct ON v.patch_comment_type_id = pct.id
+       INNER JOIN patch p ON v.patch_id = p.id;
index 036ff3c8a8d8d7f7a40368e8ce73dd09b612c379..78f3a795b67ee42f55981edea4b21678f1b3554e 100644 (file)
@@ -41,10 +41,9 @@ sub form {
        my $d;
        my $id = $r->cgi_id();
        if (defined $id) {
-               $r->set_title('Edit Patch Comment');
                $d = $r->db->select_one(<<EOM, $id);
-SELECT id, patch_id, patch_comment_type_id AS patch_comment_type, message_id,
-       content, creator FROM patch_comment WHERE id = ?
+SELECT id, patch_id, patch_name, patch_comment_type_id AS patch_comment_type,
+       message_id, content, creator FROM patch_comment_view WHERE id = ?
 EOM
                $r->error_exit('Patch comment not found.') if !defined $d;
                if (! $aa->{'is_administrator'}
@@ -53,13 +52,14 @@ EOM
 Only administrators can edit comments created by other users.
 EOM
                }
+               $r->set_title('Edit Patch Comment: ' . $d->{'patch_name'});
        }
        else {
                $d = $r->db->select_one(<<EOM, $r->cgi_required_id('patch'));
-SELECT id AS patch_id FROM patch WHERE id = ?
+SELECT id AS patch_id, name AS patch_name FROM patch WHERE id = ?
 EOM
                $r->error_exit('Patch not found.') if !defined $d;
-               $r->set_title('New Patch Comment');
+               $r->set_title('New Patch Comment: ' . $d->{'patch_name'});
        }
        $r->redirect('/action/patch_view?id=' . $d->{'patch_id'})
                if $r->cgi('cancel');
index a8d1641216dfebd56150a2930bdd92bdd725fe5e..624f73a670c1fdc8c6eed7a25c44c275f3607506 100644 (file)
@@ -1,4 +1,6 @@
-<p></p>
+<p>Enter your comments below.  If you wish your comment to reference a message
+from the mailing list archives, enter the message ID into the space
+provided.</p>
 
 <div class='tblBasic'>
 <table cellspacing='0' class='tblBasicGrey'>