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
1=== modified file 'lib/lp/bugs/browser/bugmessage.py'
2--- lib/lp/bugs/browser/bugmessage.py 2016-01-26 15:47:37 +0000
3+++ lib/lp/bugs/browser/bugmessage.py 2016-04-29 13:25:56 +0000
4@@ -1,4 +1,4 @@
5-# Copyright 2009 Canonical Ltd. This software is licensed under the
6+# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
7 # GNU Affero General Public License version 3 (see the file LICENSE).
8
9 """IBugMessage-related browser view classes."""
10@@ -11,9 +11,11 @@
11 from StringIO import StringIO
12
13 from zope.component import getUtility
14+from zope.formlib.widgets import TextAreaWidget
15
16 from lp.app.browser.launchpadform import (
17 action,
18+ custom_widget,
19 LaunchpadFormView,
20 )
21 from lp.bugs.browser.bugattachment import BugAttachmentContentCheck
22@@ -28,6 +30,8 @@
23 schema = IBugMessageAddForm
24 initial_focus_widget = None
25
26+ custom_widget('comment', TextAreaWidget, cssClass='comment-text')
27+
28 page_title = "Add a comment or attachment"
29
30 @property
31
32=== modified file 'lib/lp/bugs/browser/bugtarget.py'
33--- lib/lp/bugs/browser/bugtarget.py 2016-01-26 15:47:37 +0000
34+++ lib/lp/bugs/browser/bugtarget.py 2016-04-29 13:25:56 +0000
35@@ -1,4 +1,4 @@
36-# Copyright 2010-2014 Canonical Ltd. This software is licensed under the
37+# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
38 # GNU Affero General Public License version 3 (see the file LICENSE).
39
40 """IBugTarget-related browser views."""
41@@ -35,7 +35,10 @@
42 from zope.component import getUtility
43 from zope.formlib.form import Fields
44 from zope.formlib.interfaces import InputErrors
45-from zope.formlib.widgets import TextWidget
46+from zope.formlib.widgets import (
47+ TextAreaWidget,
48+ TextWidget,
49+ )
50 from zope.interface import (
51 alsoProvides,
52 implementer,
53@@ -221,6 +224,7 @@
54 schema = IBug
55
56 custom_widget('information_type', LaunchpadRadioWidgetWithDescription)
57+ custom_widget('comment', TextAreaWidget, cssClass='comment-text')
58
59 extra_data_token = None
60
61
62=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt'
63--- lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt 2012-02-01 15:26:32 +0000
64+++ lib/lp/bugs/stories/bugs/xx-bug-index-lots-of-comments.txt 2016-04-29 13:25:56 +0000
65@@ -5,12 +5,14 @@
66 displayed. A notice is added at the end of the comment list to tell
67 the user about this.
68
69-Bug 11 has quite a few comments.
70+Bug 11 has quite a few comments. Note that the "Add comment" text area also
71+has the comment-text CSS class, increasing all the find_tags_by_class counts
72+below by one.
73
74 >>> user_browser.open('http://launchpad.dev/bugs/11')
75 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')
76 >>> len(comments)
77- 6
78+ 7
79
80 Let's briefly override the configuration to push bug 11 over the
81 threshold.
82@@ -28,7 +30,7 @@
83 >>> user_browser.open('http://launchpad.dev/bugs/11')
84 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')
85 >>> len(comments)
86- 3
87+ 4
88
89 With a warning telling the user where the comments have gone:
90
91@@ -61,7 +63,7 @@
92 >>> user_browser.getLink('View all 6 comments').click()
93 >>> comments = find_tags_by_class(user_browser.contents, 'comment-text')
94 >>> len(comments)
95- 6
96+ 7
97
98 >>> print find_tag_by_id(user_browser.contents, 'add-comment-form').name
99 div
100
101=== modified file 'lib/lp/bugs/templates/bugcomment-box.pt'
102--- lib/lp/bugs/templates/bugcomment-box.pt 2014-05-29 16:18:50 +0000
103+++ lib/lp/bugs/templates/bugcomment-box.pt 2016-04-29 13:25:56 +0000
104@@ -129,7 +129,7 @@
105 tal:attributes="value comment/bugwatch/id" />
106 <input type="hidden" name="field.subject"
107 tal:attributes="value comment/bugtask/bug/followup_subject" />
108- <textarea id="field.comment" name="field.comment" rows="10" cols="60"></textarea>
109+ <textarea id="field.comment" class="comment-text" name="field.comment" rows="10" cols="60"></textarea>
110 <br />
111 <div class="actions">
112 <table style="width: 100%">