Merge lp://staging/~cprov/launchpad/bug-412715-registration-info-in-base-layout into lp://staging/launchpad

Proposed by Celso Providelo
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~cprov/launchpad/bug-412715-registration-info-in-base-layout
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~cprov/launchpad/bug-412715-registration-info-in-base-layout
Reviewer Review Type Date Requested Status
Curtis Hovey (community) ui Approve
Edwin Grubbs (community) code Approve
Martin Albisetti Pending
Review via email: mp+11874@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

= Summary =

This branch implements the easy-solution for https://bugs.edge.launchpad.net/launchpad-foundations/+bug/412715

It creates the 'registering' slot on the base-layout which can be used to present information styled (discreetly) at the right of the page label, e.g.:

'registered by Celso Providelo on 2009-01-01'

== Pre-implementation notes ==

I've followed Curtis suggestion and implemented the template slot, this way pages needing and in a position to fill it (almost all +index pages) will look nicer.

Ideally, this slot could be filled automatically for context providing IRegistration (basically 'registrant' and 'date_created'). However adapting our content classes will take longer than we can afford in 3.0. That's mainly why being able to fill the slot ad-hoc might be good enough for now.

== Tests ==

./bin/test -vv -t base-layout.txt

== Demo and Q/A ==

I've filled the 'registering' slot in some key pages, primarily for illustration how it works.

https://launchpad.dev/ubuntu
https://launchpad.dev/ubuntu/hoary
https://launchpad.dev/ubuntu/+source/mozilla-firefox/0.9/+build/8

= 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/distroseries-details.pt
  lib/lp/registry/templates/distroseries-index.pt
  lib/lp/registry/templates/distribution-index.pt
  lib/lp/soyuz/templates/build-index.pt
  lib/lp/app/browser/tests/base-layout.txt
  lib/lp/app/templates/base-layout.pt
  lib/canonical/launchpad/icing/style-3-0.css
  lib/lp/app/browser/tests/testfiles/main-registering.pt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqw2yQACgkQ7KBXuXyZSjBWdgCgnoQtQMuSWOy25FmWbK8xbopu
JwkAn11+FirNwXKx/9NATnOClSlNuEGw
=83+m
-----END PGP SIGNATURE-----

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :
Download full text (4.8 KiB)

Hi Celso,

This branch looks like a nice improvement. Just a couple of comments below.

merge-conditional

-Edwin

>=== modified file 'lib/lp/app/browser/tests/base-layout.txt'
>--- lib/lp/app/browser/tests/base-layout.txt 2009-09-12 01:39:04 +0000
>+++ lib/lp/app/browser/tests/base-layout.txt 2009-09-16 20:19:40 +0000
>@@ -93,7 +93,10 @@
> ...
> <div class="yui-b" dir="ltr">
> <div>
>- <h2>Heading</h2>
>+ <div class="registering">
>+ <div />
>+ </div>
>+ <h2>Heading</h2>
> <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
> ...
>
>@@ -189,6 +192,9 @@
> <BLANKLINE>
> <div class="yui-b" dir="ltr">
> <div>
>+ <div class="registering">
>+ <div />
>+ </div>
> <BLANKLINE>
> <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
> <BLANKLINE>
>@@ -307,6 +313,9 @@
> <BLANKLINE>
> <div class="yui-b" dir="ltr">
> <div>
>+ <div class="registering">
>+ <div />
>+ </div>
> <BLANKLINE>
> <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
> <BLANKLINE>
>@@ -463,6 +472,34 @@
> <h1>Heading</h1>
>
>
>+Page registering
>+----------------
>+
>+The 'registering' slot is presented on the right side of the 'heading'
>+and can be filled with the context registering information (registrant
>+and date_created, normally).
>+
>+ >>> class RegisteringView(LaunchpadView):
>+ ... """A simple view to test base-layout."""
>+ ... __launchpad_facetname__ = 'overview'
>+ ... template = ViewPageTemplateFile('testfiles/main-registering.pt')
>+ ... page_title = 'Test base-layout: registering'

What is the purpose of this page_title variable that doesn't appear to be used
anywhere?

>+
>+ >>> view = RegisteringView(user, request)
>+ >>> html = view.render()
>+
>+ >>> from canonical.launchpad.testing.pages import (
>+ ... first_tag_by_class)
>+
>+ >>> print first_tag_by_class(html, 'registering')
>+ <div class="registering">
>+ <p>something nice about the context registering.</p>
>+ </div>
>+
>+Note that the slot itself will be already 'styled' and it rarely has
>+to be changed.
>+
>+
> Public and private presentation
> -------------------------------
>
>
>=== added file 'lib/lp/app/browser/tests/testfiles/main-registering.pt'
>--- lib/lp/app/browser/tests/testfiles/main-registering.pt 1970-01-01 00:00:00 +0000
>+++ lib/lp/app/browser/tests/testfiles/main-registering.pt 2009-09-16 20:19:40 +0000
>@@ -0,0 +1,19 @@
>+<html
>+ xmlns="http://www.w3.org/1999/xhtml"
>+ xmlns:tal="http://xml.zope.org/namespaces/tal"
>+ xmlns:metal="http://xml.zope.org/namespaces/metal"
>+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
>+ metal:use-macro="view/macro:page/main_only">
>+
>+ <body>
>+
>+ <tal:registering metal:fill-slot="registering">
>+ <p>something nice about the context registering.</p>
>+ </tal:registering>
>+
...

Read more...

review: Approve
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

ui=me*

review: Approve (ui)
Revision history for this message
Celso Providelo (cprov) wrote :
Download full text (5.0 KiB)

On Wed, Sep 16, 2009 at 6:38 PM, Edwin Grubbs
<email address hidden> wrote:
> Review: Approve
> Hi Celso,

Hi Edwin,

> This branch looks like a nice improvement. Just a couple of comments below.
>
> merge-conditional

Thank you.

> -Edwin
>
>
>>=== modified file 'lib/lp/app/browser/tests/base-layout.txt'
>>--- lib/lp/app/browser/tests/base-layout.txt   2009-09-12 01:39:04 +0000
>>+++ lib/lp/app/browser/tests/base-layout.txt   2009-09-16 20:19:40 +0000
>>@@ -93,7 +93,10 @@
>>     ...
>>               <div class="yui-b" dir="ltr">
>>                 <div>
>>-                <h2>Heading</h2>
>>+                  <div class="registering">
>>+                    <div />
>>+                  </div>
>>+                  <h2>Heading</h2>
>>                   <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
>>     ...
>>
>>@@ -189,6 +192,9 @@
>>     <BLANKLINE>
>>               <div class="yui-b" dir="ltr">
>>                 <div>
>>+                  <div class="registering">
>>+                    <div />
>>+                  </div>
>>     <BLANKLINE>
>>                   <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
>>     <BLANKLINE>
>>@@ -307,6 +313,9 @@
>>     <BLANKLINE>
>>               <div class="yui-b" dir="ltr">
>>                 <div>
>>+                  <div class="registering">
>>+                    <div />
>>+                  </div>
>>     <BLANKLINE>
>>                   <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
>>     <BLANKLINE>
>>@@ -463,6 +472,34 @@
>>     <h1>Heading</h1>
>>
>>
>>+Page registering
>>+----------------
>>+
>>+The 'registering' slot is presented on the right side of the 'heading'
>>+and can be filled with the context registering information (registrant
>>+and date_created, normally).
>>+
>>+    >>> class RegisteringView(LaunchpadView):
>>+    ...     """A simple view to test base-layout."""
>>+    ...     __launchpad_facetname__ = 'overview'
>>+    ...     template = ViewPageTemplateFile('testfiles/main-registering.pt')
>>+    ...     page_title = 'Test base-layout: registering'
>
>
> What is the purpose of this page_title variable that doesn't appear to be used
> anywhere?

Nah, bad copy & paste. Fixed, thanks for spotting it.

>>+
>>+    >>> view = RegisteringView(user, request)
>>+    >>> html = view.render()
>>+
>>+    >>> from canonical.launchpad.testing.pages import (
>>+    ...     first_tag_by_class)
>>+
>>+    >>> print first_tag_by_class(html, 'registering')
>>+    <div class="registering">
>>+    <p>something nice about the context registering.</p>
>>+    </div>
>>+
>>+Note that the slot itself will be already 'styled' and it rarely has
>>+to be changed.
>>+
>>+
>> Public and private presentation
>> -------------------------------
>>
>>
>>=== added file 'lib/lp/app/browser/tests/testfiles/main-registering.pt'
>>--- lib/lp/app/browser/tests/testfiles/main-registering.pt     1970-01-01 00:00:00 +0000
>>+++ lib/lp/app/browser/tests/testfiles/main-registering.pt     2009-09-16 20:19:40 +0000
>>@@ -0,0 +1,19 @@
>>+<html
>>+  xmlns="http://www.w3.org/1999/xhtml"
>>+  xmlns:tal="http://xml.zope.org/namespaces/tal"
>>+  xmlns:metal="http://xml.zope.org/...

Read more...

Revision history for this message
Curtis Hovey (sinzui) wrote :

I am looking at https://devpad.canonical.com/~beuno/LP_new_design_Bugs_v3.1.png
The registration information is above the line, floated right of the app buttons.

We talked on IRC and you pointed out that the context of the registration is not always listed above the line. Your argument is convincing. We agreed that italics helps distinguish the registration information from the object heading. I agreed that this branch is good to land.

If we can solve the context issue, we can move the registration info above the line, but that will be a separate bug.

review: Needs Fixing (ui)
Revision history for this message
Curtis Hovey (sinzui) wrote :

Approve damnit. It does not need fixing.

review: Approve (ui)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/icing/style-3-0.css'
2--- lib/canonical/launchpad/icing/style-3-0.css 2009-09-14 10:13:55 +0000
3+++ lib/canonical/launchpad/icing/style-3-0.css 2009-09-15 22:12:44 +0000
4@@ -529,6 +529,15 @@
5 color: #747474;
6 }
7
8+/* Registering slot */
9+.registering {
10+ float: right;
11+ padding-top: 10px;
12+ font-size: 85%;
13+ color: #666;
14+ font-style: italic;
15+}
16+
17 /* Side content exceptions */
18 .side {
19 padding: 0.5em;
20
21=== modified file 'lib/lp/app/browser/tests/base-layout.txt'
22--- lib/lp/app/browser/tests/base-layout.txt 2009-09-12 01:39:04 +0000
23+++ lib/lp/app/browser/tests/base-layout.txt 2009-09-16 12:10:34 +0000
24@@ -93,7 +93,10 @@
25 ...
26 <div class="yui-b" dir="ltr">
27 <div>
28- <h2>Heading</h2>
29+ <div class="registering">
30+ <div />
31+ </div>
32+ <h2>Heading</h2>
33 <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
34 ...
35
36@@ -189,6 +192,9 @@
37 <BLANKLINE>
38 <div class="yui-b" dir="ltr">
39 <div>
40+ <div class="registering">
41+ <div />
42+ </div>
43 <BLANKLINE>
44 <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
45 <BLANKLINE>
46@@ -307,6 +313,9 @@
47 <BLANKLINE>
48 <div class="yui-b" dir="ltr">
49 <div>
50+ <div class="registering">
51+ <div />
52+ </div>
53 <BLANKLINE>
54 <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">
55 <BLANKLINE>
56@@ -463,6 +472,34 @@
57 <h1>Heading</h1>
58
59
60+Page registering
61+----------------
62+
63+The 'registering' slot is presented on the right side of the 'heading'
64+and can be filled with the context registering information (registrant
65+and date_created, normally).
66+
67+ >>> class RegisteringView(LaunchpadView):
68+ ... """A simple view to test base-layout."""
69+ ... __launchpad_facetname__ = 'overview'
70+ ... template = ViewPageTemplateFile('testfiles/main-registering.pt')
71+ ... page_title = 'Test base-layout: registering'
72+
73+ >>> view = RegisteringView(user, request)
74+ >>> html = view.render()
75+
76+ >>> from canonical.launchpad.testing.pages import (
77+ ... first_tag_by_class)
78+
79+ >>> print first_tag_by_class(html, 'registering')
80+ <div class="registering">
81+ <p>something nice about the context registering.</p>
82+ </div>
83+
84+Note that the slot itself will be already 'styled' and it rarely has
85+to be changed.
86+
87+
88 Public and private presentation
89 -------------------------------
90
91
92=== added file 'lib/lp/app/browser/tests/testfiles/main-registering.pt'
93--- lib/lp/app/browser/tests/testfiles/main-registering.pt 1970-01-01 00:00:00 +0000
94+++ lib/lp/app/browser/tests/testfiles/main-registering.pt 2009-09-15 22:12:44 +0000
95@@ -0,0 +1,19 @@
96+<html
97+ xmlns="http://www.w3.org/1999/xhtml"
98+ xmlns:tal="http://xml.zope.org/namespaces/tal"
99+ xmlns:metal="http://xml.zope.org/namespaces/metal"
100+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
101+ metal:use-macro="view/macro:page/main_only">
102+
103+ <body>
104+
105+ <tal:registering metal:fill-slot="registering">
106+ <p>something nice about the context registering.</p>
107+ </tal:registering>
108+
109+ <tal:main metal:fill-slot="main">
110+ ANYTHING
111+ </tal:main>
112+
113+ </body>
114+</html>
115
116=== modified file 'lib/lp/app/templates/base-layout.pt'
117--- lib/lp/app/templates/base-layout.pt 2009-09-08 22:42:42 +0000
118+++ lib/lp/app/templates/base-layout.pt 2009-09-15 22:12:44 +0000
119@@ -118,11 +118,15 @@
120 xml:lang view/lang|default_language|default;
121 dir view/dir|string:ltr">
122 <div tal:condition="view/macro:pagehas/applicationtabs">
123- <h1
124- tal:condition="view/label|nothing"
125- tal:content="view/label"
126- metal:define-slot="heading"
127- >Page Label</h1>
128+ <div class="registering">
129+ <div metal:define-slot="registering" />
130+ </div>
131+ <h1
132+ tal:condition="view/label|nothing"
133+ tal:content="view/label"
134+ metal:define-slot="heading"
135+ >Page Label
136+ </h1>
137 <tal:breadcrumbs replace="structure context/@@+hierarchy">
138 ProjectName > Branches > Merge Proposals > fix-for-navigation
139 </tal:breadcrumbs>
140
141=== modified file 'lib/lp/registry/templates/distribution-index.pt'
142--- lib/lp/registry/templates/distribution-index.pt 2009-08-31 20:46:06 +0000
143+++ lib/lp/registry/templates/distribution-index.pt 2009-09-15 22:12:44 +0000
144@@ -10,6 +10,16 @@
145 <h1 tal:content="context/title">project title</h1>
146 </tal:heading>
147
148+ <tal:registering metal:fill-slot="registering">
149+ <p>
150+ registered by
151+ <a tal:replace="structure context/owner/fmt:link" />
152+ <span tal:content="context/date_created/fmt:displaydate"
153+ tal:attributes="title context/date_created/fmt:datetime"
154+ >on 2005-01-01</span>
155+ </p>
156+ </tal:registering>
157+
158 <tal:main metal:fill-slot="main"
159 define="overview_menu context/menu:overview">
160 <div class="top-portlet">
161
162=== modified file 'lib/lp/registry/templates/distroseries-details.pt'
163--- lib/lp/registry/templates/distroseries-details.pt 2009-09-09 17:02:43 +0000
164+++ lib/lp/registry/templates/distroseries-details.pt 2009-09-15 22:12:44 +0000
165@@ -81,7 +81,4 @@
166 </dl>
167 </div>
168
169- <p>
170- Registered by <a tal:replace="structure context/owner/fmt:link" />
171- </p>
172 </div>
173
174=== modified file 'lib/lp/registry/templates/distroseries-index.pt'
175--- lib/lp/registry/templates/distroseries-index.pt 2009-09-09 13:19:41 +0000
176+++ lib/lp/registry/templates/distroseries-index.pt 2009-09-15 22:12:44 +0000
177@@ -21,6 +21,16 @@
178 <h1 tal:content="context/displayname">project 1.x series</h1>
179 </tal:heading>
180
181+ <tal:registering metal:fill-slot="registering">
182+ <p>
183+ registered by
184+ <a tal:replace="structure context/owner/fmt:link" />
185+ <span tal:content="context/date_created/fmt:displaydate"
186+ tal:attributes="title context/date_created/fmt:datetime"
187+ >on 2005-01-01</span>
188+ </p>
189+ </tal:registering>
190+
191 <div metal:fill-slot="main">
192 <div class="top-portlet"
193 tal:define="binarycount context/binarycount">
194
195=== modified file 'lib/lp/soyuz/templates/build-index.pt'
196--- lib/lp/soyuz/templates/build-index.pt 2009-09-14 14:40:18 +0000
197+++ lib/lp/soyuz/templates/build-index.pt 2009-09-15 22:12:44 +0000
198@@ -10,19 +10,18 @@
199 <body>
200
201 <div metal:fill-slot="heading">
202- <div style="float: left;">
203 <h1 tal:content="CONTEXTS/fmt:pagetitle">i386 build of
204 alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE</h1>
205- </div>
206- <div style="float: right;">
207- <p class="discreet">
208- Created <span
209- tal:attributes="title context/datecreated/fmt:datetime"
210- tal:content="context/datecreated/fmt:displaydate"
211- >2005-10-05 5:45</span>
212+ </div> <!-- heading -->
213+
214+ <tal:registering metal:fill-slot="registering">
215+ <p>
216+ created
217+ <span tal:content="context/datecreated/fmt:displaydate"
218+ tal:attributes="title context/datecreated/fmt:datetime"
219+ >on 2005-01-01</span>
220 </p>
221- </div>
222- </div> <!-- heading -->
223+ </tal:registering>
224
225 <div metal:fill-slot="main">
226