Merge lp:~barry/launchpad/431859-wikinames into lp:launchpad

Proposed by Barry Warsaw
Status: Merged
Merged at revision: not available
Proposed branch: lp:~barry/launchpad/431859-wikinames
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~barry/launchpad/431859-wikinames
Reviewer Review Type Date Requested Status
Michael Nelson Pending
Review via email: mp+11972@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

= Summary =

Bug 431859 describes double headings on the ~person/+editwikinames page. This
is because it was converted to UI 3.0 before the new heading rules were
established.

== Proposed fix ==

Fix the template and view to conform to the new rules.

== Pre-implementation notes ==

None; I can do this in my sleep.

== Implementation details ==

Nothing interesting.

== Tests ==

bin/test -vv -t xx-person-edit-wikis

== Demo and Q/A ==

http://launchpad.net/~name16/+editwikinames

= 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/templates/person-editwikinames.pt
  lib/lp/registry/browser/person.py

== Pylint notices ==

lib/lp/registry/browser/person.py
    117: [F0401] Unable to import 'lazr.delegates' (No module named delegates)
    118: [F0401] Unable to import 'lazr.config' (No module named config)
    119: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Thanks Barry (reminds me we've got a few of these to fix in soyuz for the same reason).

One minor suggestion.

> === modified file 'lib/lp/registry/templates/person-editwikinames.pt'
> --- lib/lp/registry/templates/person-editwikinames.pt 2009-09-08 00:28:41 +0000
> +++ lib/lp/registry/templates/person-editwikinames.pt 2009-09-17 13:51:48 +0000
> @@ -9,8 +9,6 @@
> <body>
>
> <div metal:fill-slot="main">
> - <h1 tal:content="view/label" />
> -
> <p tal:condition="view/error_message"
> tal:content="structure view/error_message/escapedtext"
> class="error message" />
> @@ -82,7 +80,7 @@
> </tr>
> </table>
>
> - <div class="formControls">
> + <div class="formControls" style="padding-top: 1em;">

I'm not sure if the class here is used for tests or something, but it's not used in either of the stylesheets. Instead of adding custom style here, you can simply do:

  <div class="actions">

and the default style for form actions adds a 1em margin to the top.

Revision history for this message
Barry Warsaw (barry) wrote :

On Sep 17, 2009, at 02:31 PM, Michael Nelson wrote:

>Thanks Barry (reminds me we've got a few of these to fix in soyuz for the same reason).

I'm sure we all do. ;)

>> - <div class="formControls">
>> + <div class="formControls" style="padding-top: 1em;">
>
>I'm not sure if the class here is used for tests or something, but it's not used in either of the stylesheets. Instead of adding custom style here, you can simply do:
>
> <div class="actions">
>
>and the default style for form actions adds a 1em margin to the top.

The test still passes, and usually we use ids for tests. Good catch! Fixed.

=== modified file 'lib/lp/registry/templates/person-editwikinames.pt'
--- lib/lp/registry/templates/person-editwikinames.pt 2009-09-17 13:51:48 +0000
+++ lib/lp/registry/templates/person-editwikinames.pt 2009-09-17 14:54:56 +0000
@@ -80,7 +80,7 @@
     </tr>
   </table>

- <div class="formControls" style="padding-top: 1em;">
+ <div class="actions">
     <input type="submit" value="Save Changes" name="SAVE" />
     or&nbsp; <a tal:attributes="href view/cancel_url">Cancel</a>
   </div>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/person.py'
2--- lib/lp/registry/browser/person.py 2009-09-16 23:54:18 +0000
3+++ lib/lp/registry/browser/person.py 2009-09-17 13:51:48 +0000
4@@ -3179,13 +3179,12 @@
5
6
7 class PersonEditWikiNamesView(LaunchpadView):
8+ """View for ~person/+editwikinames"""
9
10 @property
11 def label(self):
12 return smartquote("%s's wiki names" % self.context.displayname)
13
14- page_title = label
15-
16 @property
17 def cancel_url(self):
18 return canonical_url(self.context, view_name="+edit")
19
20=== modified file 'lib/lp/registry/templates/person-editwikinames.pt'
21--- lib/lp/registry/templates/person-editwikinames.pt 2009-09-08 00:28:41 +0000
22+++ lib/lp/registry/templates/person-editwikinames.pt 2009-09-17 13:51:48 +0000
23@@ -9,8 +9,6 @@
24 <body>
25
26 <div metal:fill-slot="main">
27- <h1 tal:content="view/label" />
28-
29 <p tal:condition="view/error_message"
30 tal:content="structure view/error_message/escapedtext"
31 class="error message" />
32@@ -82,7 +80,7 @@
33 </tr>
34 </table>
35
36- <div class="formControls">
37+ <div class="formControls" style="padding-top: 1em;">
38 <input type="submit" value="Save Changes" name="SAVE" />
39 or&nbsp; <a tal:attributes="href view/cancel_url">Cancel</a>
40 </div>