Commit e6216bea authored by aroben@apple.com's avatar aroben@apple.com
Browse files

Fix Bug 21401: Comments field on "Review Patch" page should be...

        Fix Bug 21401: Comments field on "Review Patch" page should be initially filled with quoted patch

        <https://bugs.webkit.org/show_bug.cgi?id=21401>

        Reviewed by Dave Hyatt.

        * attachment.cgi:
        (edit): Retrieve the attachment data from the database instead of just
        its length. When the attachment is a patch, create a quotedpatch
        template variable that contains the patch data with each line
        prepended with "> ".
        * template/en/custom/attachment/reviewform.html.tmpl:
          - Changed the comments field to have a monospace font
          - Added an "Enter comments below:" caption above the comments field
            to make it clearer that this is where comments should go, now that
            the comments field is not initially empty
          - Fill the comments field with the quoted patch

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3f537b9b
2008-10-23 Adam Roben <aroben@apple.com>
Fix Bug 21401: Comments field on "Review Patch" page should be
initially filled with quoted patch
<https://bugs.webkit.org/show_bug.cgi?id=21401>
Reviewed by Dave Hyatt.
* attachment.cgi:
(edit): Retrieve the attachment data from the database instead of just
its length. When the attachment is a patch, create a quotedpatch
template variable that contains the patch data with each line
prepended with "> ".
* template/en/custom/attachment/reviewform.html.tmpl:
- Changed the comments field to have a monospace font
- Added an "Enter comments below:" caption above the comments field
to make it clearer that this is where comments should go, now that
the comments field is not initially empty
- Fill the comments field with the quoted patch
2008-10-14 Adam Roben <aroben@apple.com>
Fix Bug 21602: Bugzilla times out trying to display formatted diff for
......
......@@ -1120,9 +1120,10 @@ sub edit
my ($attach_id) = validateID();
# Retrieve the attachment from the database.
SendSQL("SELECT description, mimetype, filename, bug_id, ispatch, isobsolete, isprivate, LENGTH(thedata)
SendSQL("SELECT description, mimetype, filename, bug_id, ispatch, isobsolete, isprivate, thedata
FROM attachments WHERE attach_id = $attach_id");
my ($description, $contenttype, $filename, $bugid, $ispatch, $isobsolete, $isprivate, $datasize) = FetchSQLData();
my ($description, $contenttype, $filename, $bugid, $ispatch, $isobsolete, $isprivate, $thedata) = FetchSQLData();
my $datasize = length($thedata);
my $isviewable = isViewable($contenttype);
......@@ -1163,6 +1164,12 @@ sub edit
$vars->{'attachments'} = \@bugattachments;
$vars->{'GetBugLink'} = \&GetBugLink;
if ($ispatch) {
my $quotedpatch = $thedata;
$quotedpatch =~ s/^/> /mg;
$vars->{'quotedpatch'} = $quotedpatch;
}
# Determine if PatchReader is installed
eval {
require PatchReader;
......
......@@ -25,7 +25,7 @@
<link href="skins/custom/global.css" rel="stylesheet" type="text/css">
<style>
* { font-size: small; }
#comment { width: 100%; height: 100%; }
#comment { width: 100%; height: 100%; font-family: monospace; }
#form-controls { height: 40px; }
#form-controls td { width: 25%; text-align: center; }
</style>
......@@ -89,7 +89,8 @@ Back to <a href="show_bug.cgi?id=[% bugid %]" target="_top">[% terms.Bug %] #[%
</tr>
<tr>
<td colspan="4">
<textarea id=comment name="comment" wrap="soft"></textarea><br>
Enter comments below:<br>
<textarea id=comment name="comment" wrap="soft">[% quotedpatch FILTER html %]</textarea><br>
</tr>
</table>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment