summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas2009-07-03 23:09:49 +0000
committerRobert Haas2009-07-03 23:10:45 +0000
commitfaaa39d1777c692be519a4b1707dee7e1872b2cc (patch)
tree92df0bc094d1cccb0402f6c6f5251ca533df440a
parent7b3aa28d36e8f11b875e9c47a4846e81e3530202 (diff)
Include name of patch in subject line when adding/editing a patch comment.
Also include some directions on the patch comment form, to indicate that the message-ID is optional. Per suggestions from Tom Lane.
-rw-r--r--etc/view.sql8
-rw-r--r--perl-lib/PgCommitFest/PatchComment.pm10
-rw-r--r--template/patch_comment_form.tt24
3 files changed, 13 insertions, 9 deletions
diff --git a/etc/view.sql b/etc/view.sql
index af98e1e..c80fd3a 100644
--- a/etc/view.sql
+++ b/etc/view.sql
@@ -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;
diff --git a/perl-lib/PgCommitFest/PatchComment.pm b/perl-lib/PgCommitFest/PatchComment.pm
index 036ff3c..78f3a79 100644
--- a/perl-lib/PgCommitFest/PatchComment.pm
+++ b/perl-lib/PgCommitFest/PatchComment.pm
@@ -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');
diff --git a/template/patch_comment_form.tt2 b/template/patch_comment_form.tt2
index a8d1641..624f73a 100644
--- a/template/patch_comment_form.tt2
+++ b/template/patch_comment_form.tt2
@@ -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'>