Merge lp:~cjwatson/launchpad/add-comment-monospace into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18021
Proposed branch: lp:~cjwatson/launchpad/add-comment-monospace
Merge into: lp:launchpad
Diff against target: 112 lines (+18/-8)
4 files modified
lib/lp/bugs/browser/bugmessage.py (+5/-1)
lib/lp/bugs/browser/bugtarget.py (+6/-2)
lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt (+6/-4)
lib/lp/bugs/templates/bugcomment-box.pt (+1/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/add-comment-monospace
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+293383@code.launchpad.net

Commit message

Use a monospace font for "Add comment" boxes for bugs, to match how the comments will be displayed.

Description of the change

Use a monospace font for "Add comment" boxes for bugs, to match how the comments will be displayed.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bugmessage.py'
--- lib/lp/bugs/browser/bugmessage.py 2016-01-26 15:47:37 +0000
+++ lib/lp/bugs/browser/bugmessage.py 2016-04-29 13:25:56 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""IBugMessage-related browser view classes."""4"""IBugMessage-related browser view classes."""
@@ -11,9 +11,11 @@
11from StringIO import StringIO11from StringIO import StringIO
1212
13from zope.component import getUtility13from zope.component import getUtility
14from zope.formlib.widgets import TextAreaWidget
1415
15from lp.app.browser.launchpadform import (16from lp.app.browser.launchpadform import (
16 action,17 action,
18 custom_widget,
17 LaunchpadFormView,19 LaunchpadFormView,
18 )20 )
19from lp.bugs.browser.bugattachment import BugAttachmentContentCheck21from lp.bugs.browser.bugattachment import BugAttachmentContentCheck
@@ -28,6 +30,8 @@
28 schema = IBugMessageAddForm30 schema = IBugMessageAddForm
29 initial_focus_widget = None31 initial_focus_widget = None
3032
33 custom_widget('comment', TextAreaWidget, cssClass='comment-text')
34
31 page_title = "Add a comment or attachment"35 page_title = "Add a comment or attachment"
3236
33 @property37 @property
3438
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2016-01-26 15:47:37 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2016-04-29 13:25:56 +0000
@@ -1,4 +1,4 @@
1# Copyright 2010-2014 Canonical Ltd. This software is licensed under the1# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""IBugTarget-related browser views."""4"""IBugTarget-related browser views."""
@@ -35,7 +35,10 @@
35from zope.component import getUtility35from zope.component import getUtility
36from zope.formlib.form import Fields36from zope.formlib.form import Fields
37from zope.formlib.interfaces import InputErrors37from zope.formlib.interfaces import InputErrors
38from zope.formlib.widgets import TextWidget38from zope.formlib.widgets import (
39 TextAreaWidget,
40 TextWidget,
41 )
39from zope.interface import (42from zope.interface import (
40 alsoProvides,43 alsoProvides,
41 implementer,44 implementer,
@@ -221,6 +224,7 @@
221 schema = IBug224 schema = IBug
222225
223 custom_widget('information_type', LaunchpadRadioWidgetWithDescription)226 custom_widget('information_type', LaunchpadRadioWidgetWithDescription)
227 custom_widget('comment', TextAreaWidget, cssClass='comment-text')
224228
225 extra_data_token = None229 extra_data_token = None
226230
227231
=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt 2012-02-01 15:26:32 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt 2016-04-29 13:25:56 +0000
@@ -5,12 +5,14 @@
5displayed. A notice is added at the end of the comment list to tell5displayed. A notice is added at the end of the comment list to tell
6the user about this.6the user about this.
77
8Bug 11 has quite a few comments.8Bug 11 has quite a few comments. Note that the "Add comment" text area also
9has the comment-text CSS class, increasing all the find_tags_by_class counts
10below by one.
911
10 >>> user_browser.open('http://launchpad.dev/bugs/11')12 >>> user_browser.open('http://launchpad.dev/bugs/11')
11 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')13 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')
12 >>> len(comments)14 >>> len(comments)
13 615 7
1416
15Let's briefly override the configuration to push bug 11 over the17Let's briefly override the configuration to push bug 11 over the
16threshold.18threshold.
@@ -28,7 +30,7 @@
28 >>> user_browser.open('http://launchpad.dev/bugs/11')30 >>> user_browser.open('http://launchpad.dev/bugs/11')
29 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')31 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')
30 >>> len(comments)32 >>> len(comments)
31 333 4
3234
33With a warning telling the user where the comments have gone:35With a warning telling the user where the comments have gone:
3436
@@ -61,7 +63,7 @@
61 >>> user_browser.getLink('View all 6 comments').click()63 >>> user_browser.getLink('View all 6 comments').click()
62 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')64 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')
63 >>> len(comments)65 >>> len(comments)
64 666 7
6567
66 >>> print find_tag_by_id(user_browser.contents, 'add-comment-form').name68 >>> print find_tag_by_id(user_browser.contents, 'add-comment-form').name
67 div69 div
6870
=== modified file 'lib/lp/bugs/templates/bugcomment-box.pt'
--- lib/lp/bugs/templates/bugcomment-box.pt 2014-05-29 16:18:50 +0000
+++ lib/lp/bugs/templates/bugcomment-box.pt 2016-04-29 13:25:56 +0000
@@ -129,7 +129,7 @@
129 tal:attributes="value comment/bugwatch/id" />129 tal:attributes="value comment/bugwatch/id" />
130 <input type="hidden" name="field.subject"130 <input type="hidden" name="field.subject"
131 tal:attributes="value comment/bugtask/bug/followup_subject" />131 tal:attributes="value comment/bugtask/bug/followup_subject" />
132 <textarea id="field.comment" name="field.comment" rows="10" cols="60"></textarea>132 <textarea id="field.comment" class="comment-text" name="field.comment" rows="10" cols="60"></textarea>
133 <br />133 <br />
134 <div class="actions">134 <div class="actions">
135 <table style="width: 100%">135 <table style="width: 100%">