Merge lp:~bac/launchpad/bug-491320 into lp:launchpad

Proposed by Brad Crittenden
Status: Merged
Approved by: Brad Crittenden
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~bac/launchpad/bug-491320
Merge into: lp:launchpad
Diff against target: 56 lines (+21/-10)
2 files modified
lib/lp/registry/stories/team/xx-team-membership.txt (+14/-2)
lib/lp/registry/templates/teammembership-index.pt (+7/-8)
To merge this branch: bzr merge lp:~bac/launchpad/bug-491320
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) code Approve
Review via email: mp+17458@code.launchpad.net

Commit message

Remove extra spacing from pre-populated comment field.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

= Summary =

The construction of a textarea for a comment field was causing the pre-populated
values to have annoying newlines and spaces.

== Proposed fix ==

Use tal:content to set the values of <textarea> to avoid the problem.

== Pre-implementation notes ==

None

== Implementation details ==

As above.

== Tests ==

bin/test -t xx-team-membership.txt

== Demo and Q/A ==

Visit https://launchpad.dev/~hwdb-team/+member/bac, toggle one of the values and set
a comment. Return to the URL and ensure the comments is not marred by unsightly
whitespace.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/stories/team/xx-team-membership.txt
  lib/lp/registry/templates/teammembership-index.pt

--
Brad Crittenden
<email address hidden>

Revision history for this message
Guilherme Salgado (salgado) wrote :

looks good

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/registry/stories/team/xx-team-membership.txt'
2--- lib/lp/registry/stories/team/xx-team-membership.txt 2009-12-21 20:10:24 +0000
3+++ lib/lp/registry/stories/team/xx-team-membership.txt 2010-01-15 13:45:23 +0000
4@@ -93,12 +93,24 @@
5 >>> login(ANONYMOUS)
6 >>> kamion_membership = teammembershipset.getByPersonAndTeam(
7 ... kamion, ubuntu_team)
8- >>> kamion_membership.status.title
9- 'Approved'
10+ >>> print kamion_membership.status.title
11+ Approved
12 >>> kamion_membership.dateexpires.date() == expire_date.date()
13 True
14+ >>> print kamion_membership.last_change_comment
15+ Arfie
16 >>> logout()
17
18+If we revisit Colin's membership page we'll see the comment field is
19+pre-populated with the last comment.
20+
21+ >>> url = '/~ubuntu-team/+member/kamion'
22+ >>> browser.getLink(url=url).click()
23+ >>> # Do not use 'print' for the following test as it will eliminate potential
24+ >>> # leading and trailing whitespace, which we don't want.
25+ >>> browser.getControl(name='comment').value
26+ 'Arfie'
27+
28 Jeff is also an administrator and his subscription never expires, but he can
29 demote himself. He starts by paging though the memberships, then he deselects
30 the administrator control on the membership page.
31
32=== modified file 'lib/lp/registry/templates/teammembership-index.pt'
33--- lib/lp/registry/templates/teammembership-index.pt 2009-12-17 13:13:51 +0000
34+++ lib/lp/registry/templates/teammembership-index.pt 2010-01-15 13:45:23 +0000
35@@ -53,14 +53,13 @@
36 <tr>
37 <th>Comment:</th>
38 <td>
39- <textarea cols="40" name="comment">
40- <tal:comment tal:replace="request/comment|context/last_change_comment|default" />
41- </textarea>
42- <div class="formHelp">This comment will be sent together with the
43- notification of this change to all team administrators and this
44- member<span tal:condition="view/isActive"><span
45- tal:condition="context/required:launchpad.Admin">, unless the 'Silent'
46- option is selected</span></span>.</div>
47+ <textarea cols="40" name="comment"
48+ tal:content="request/comment|context/last_change_comment|default" />
49+ <div class="formHelp">This comment will be sent together with the
50+ notification of this change to all team administrators and this
51+ member<span tal:condition="view/isActive"><span
52+ tal:condition="context/required:launchpad.Admin">, unless the 'Silent'
53+ option is selected</span></span>.</div>
54 </td>
55 </tr>
56 </metal:macro>