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
=== modified file 'lib/lp/registry/stories/team/xx-team-membership.txt'
--- lib/lp/registry/stories/team/xx-team-membership.txt 2009-12-21 20:10:24 +0000
+++ lib/lp/registry/stories/team/xx-team-membership.txt 2010-01-15 13:45:23 +0000
@@ -93,12 +93,24 @@
93 >>> login(ANONYMOUS)93 >>> login(ANONYMOUS)
94 >>> kamion_membership = teammembershipset.getByPersonAndTeam(94 >>> kamion_membership = teammembershipset.getByPersonAndTeam(
95 ... kamion, ubuntu_team)95 ... kamion, ubuntu_team)
96 >>> kamion_membership.status.title96 >>> print kamion_membership.status.title
97 'Approved'97 Approved
98 >>> kamion_membership.dateexpires.date() == expire_date.date()98 >>> kamion_membership.dateexpires.date() == expire_date.date()
99 True99 True
100 >>> print kamion_membership.last_change_comment
101 Arfie
100 >>> logout()102 >>> logout()
101103
104If we revisit Colin's membership page we'll see the comment field is
105pre-populated with the last comment.
106
107 >>> url = '/~ubuntu-team/+member/kamion'
108 >>> browser.getLink(url=url).click()
109 >>> # Do not use 'print' for the following test as it will eliminate potential
110 >>> # leading and trailing whitespace, which we don't want.
111 >>> browser.getControl(name='comment').value
112 'Arfie'
113
102Jeff is also an administrator and his subscription never expires, but he can114Jeff is also an administrator and his subscription never expires, but he can
103demote himself. He starts by paging though the memberships, then he deselects115demote himself. He starts by paging though the memberships, then he deselects
104the administrator control on the membership page.116the administrator control on the membership page.
105117
=== modified file 'lib/lp/registry/templates/teammembership-index.pt'
--- lib/lp/registry/templates/teammembership-index.pt 2009-12-17 13:13:51 +0000
+++ lib/lp/registry/templates/teammembership-index.pt 2010-01-15 13:45:23 +0000
@@ -53,14 +53,13 @@
53 <tr>53 <tr>
54 <th>Comment:</th>54 <th>Comment:</th>
55 <td>55 <td>
56 <textarea cols="40" name="comment">56 <textarea cols="40" name="comment"
57 <tal:comment tal:replace="request/comment|context/last_change_comment|default" />57 tal:content="request/comment|context/last_change_comment|default" />
58 </textarea>58 <div class="formHelp">This comment will be sent together with the
59 <div class="formHelp">This comment will be sent together with the59 notification of this change to all team administrators and this
60 notification of this change to all team administrators and this60 member<span tal:condition="view/isActive"><span
61 member<span tal:condition="view/isActive"><span61 tal:condition="context/required:launchpad.Admin">, unless the 'Silent'
62 tal:condition="context/required:launchpad.Admin">, unless the 'Silent'62 option is selected</span></span>.</div>
63 option is selected</span></span>.</div>
64 </td>63 </td>
65 </tr>64 </tr>
66 </metal:macro>65 </metal:macro>