Merge lp:~wgrant/launchpad/product-index-code-stab into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17963
Proposed branch: lp:~wgrant/launchpad/product-index-code-stab
Merge into: lp:launchpad
Diff against target: 337 lines (+116/-79)
3 files modified
lib/lp/registry/stories/product/xx-product-development-focus.txt (+59/-32)
lib/lp/registry/stories/product/xx-product-index.txt (+4/-4)
lib/lp/registry/templates/product-index.pt (+53/-43)
To merge this branch: bzr merge lp:~wgrant/launchpad/product-index-code-stab
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+289866@code.launchpad.net

Commit message

Move branch link, languages and VCS bits of Product:+index to a new "Code" portlet.

Description of the change

Move branch link, languages and VCS bits of Product:+index to a new "Code" portlet.

Now the "Browse the code" link isn't hidden in the middle of a blur of text. The licence section is also now 50% rather than 25% width, eliminating fugly wrapping. And the development focus series edit widget is now in the "Series and milestones" portlet.

I shuffled Bugs and contributors to the right column and FAQs to the left to balance them out a bit more in the common case.

This is preparation for a more minor adjustment to support linking to a default Git repository, not just a Bazaar branch. The increased width in the new portlet will also allow the clone URL to be shown on the project page, shock horror.

http://people.canonical.com/~wgrant/launchpad/product-index-code-old.png
http://people.canonical.com/~wgrant/launchpad/product-index-code-new.png

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

To my eye there seems to be a bit of missing spacing above "Version control system" relative to other similar things on the page. Presumably this has something to do with the default CSS for .two-column-list dl:first-child dt, so maybe style="margin-top 0.5em;" there would help.

I can see why you put the questions portlets on the LHS, but I'm not sure I like it. Having them more or less diagonally opposite bugs looks kind of odd, since they're listed in a similar style. Also, putting them on the LHS seems more prominent than they typically deserve; when skimming a page I find my eye scans down the LHS first rather than going across to the middle. And FAQs below questions makes no logical sense at all, since if we have FAQs at all they should appear earlier in the page flow. Perhaps:

  Code FAQs
  Bugs Questions
  Packages Specs
  Contributors Sprints

... would be reasonably balanced? Most common collaboration targets at the top left; FAQs above questions; LHS should I think usually come out similar height or slightly higher.

Another logical layout would be more developer-centric stuff on one side, more user-centric stuff on the other. That would yield something like:

  Code Packages
  Specs Bugs
  Sprints FAQs
  Contributors Questions

But I'm not convinced that's better, and it might need to be flipped left to right in order to avoid the RHS typically being longer, which decreases the prominence of Code too much for my taste.

The actual patch looks fine, and I definitely like the revamped Code layout; so whatever you pick out of these or your existing layout is OK, and we can always adjust things further later.

review: Approve
Revision history for this message
William Grant (wgrant) wrote :

I've left the portlet order as is for now; my intent was to keep Code and Bugs above the fold on 1920x1080, but perhaps I overcompensated for my 2560x1440 monitors. We can easily reorder them later once we see how it looks on real data.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/stories/product/xx-product-development-focus.txt'
2--- lib/lp/registry/stories/product/xx-product-development-focus.txt 2015-06-25 00:47:21 +0000
3+++ lib/lp/registry/stories/product/xx-product-development-focus.txt 2016-03-24 02:58:58 +0000
4@@ -23,9 +23,22 @@
5 >>> owner_browser = setupBrowser('Basic eric@example.com:test')
6 >>> def print_development_focus(browser):
7 ... """Print out the development focus part of the project info."""
8- ... project_info = find_tag_by_id(browser.contents, 'project-info')
9+ ... dev_focus = find_tag_by_id(browser.contents, 'development-focus')
10+ ... print extract_text(dev_focus)
11+ ... print "Links:"
12+ ... for a in dev_focus.findAll('a'):
13+ ... for content in a.contents:
14+ ... print content
15+ ... title = a.get('title', '')
16+ ... print "%s (%s)" % (title, a['href'])
17+ >>> def print_code_trunk(browser):
18+ ... """Print out code trunk part of the project info."""
19+ ... project_info = find_tag_by_id(browser.contents, 'code-info')
20 ... dev_focus = project_info.find(attrs={'id':'dev-focus'})
21- ... print extract_text(dev_focus)
22+ ... try:
23+ ... print extract_text(dev_focus)
24+ ... except TypeError:
25+ ... return
26 ... print "Links:"
27 ... for a in dev_focus.findAll('a'):
28 ... for content in a.contents:
29@@ -49,10 +62,10 @@
30
31 >>> anon_browser.open('http://launchpad.dev/fooix')
32 >>> print_development_focus(anon_browser)
33- Development focus:
34- trunk series
35+ trunk series is the current focus of development.
36 Links:
37 trunk series (/fooix/trunk)
38+ >>> print_code_trunk(anon_browser)
39 >>> print_involvement_portlet(anon_browser)
40
41
42@@ -65,13 +78,11 @@
43
44 >>> owner_browser.open('http://launchpad.dev/fooix')
45 >>> print_development_focus(owner_browser)
46- Development focus:
47- trunk series Change details
48+ trunk series is the current focus of development. Change details
49 Links:
50- trunk series
51- (/fooix/trunk)
52- Change details
53- (http://launchpad.dev/fooix/+edit)
54+ trunk series (/fooix/trunk)
55+ Change details (http://launchpad.dev/fooix/+edit)
56+ >>> print_code_trunk(anon_browser)
57 >>> print_involvement_portlet(owner_browser)
58 Code
59 http://launchpad.dev/fooix/+configure-code
60@@ -94,11 +105,22 @@
61
62 The owner is taken back to the project page.
63
64- >>> print_tag_with_id(owner_browser.contents, 'dev-focus')
65+ >>> print_development_focus(owner_browser)
66+ trunk series is the current focus of development. Change details
67+ Links:
68+ trunk series (/fooix/trunk)
69+ Change details (http://launchpad.dev/fooix/+edit)
70+ >>> print_code_trunk(owner_browser)
71 Development focus:
72- trunk series Change details
73- lp://dev/fooix Change branch
74+ lp://dev/fooix Configure Code
75 Browse the code
76+ Links:
77+ lp://dev/fooix (http://code.launchpad.dev/~eric/fooix/trunk)
78+ Configure Code
79+ Configure code for this project
80+ (http://launchpad.dev/fooix/+configure-code)
81+ Browse the code
82+ (http://bazaar.launchpad.dev/~eric/fooix/trunk/files)
83
84
85 Projects with development focus branches
86@@ -112,30 +134,33 @@
87
88 >>> anon_browser.open('http://launchpad.dev/fooix')
89 >>> print_development_focus(anon_browser)
90+ trunk series is the current focus of development.
91+ Links:
92+ trunk series (/fooix/trunk)
93+ >>> print_code_trunk(anon_browser)
94 Development focus:
95- trunk series
96 lp://dev/fooix
97 Browse the code
98 Links:
99- trunk series (/fooix/trunk)
100 lp://dev/fooix (http://code.launchpad.dev/~eric/fooix/trunk)
101 Browse the code
102 (http://bazaar.launchpad.dev/~eric/fooix/trunk/files)
103
104 >>> owner_browser.open('http://launchpad.dev/fooix')
105 >>> print_development_focus(owner_browser)
106+ trunk series is the current focus of development. Change details
107+ Links:
108+ trunk series (/fooix/trunk)
109+ Change details (http://launchpad.dev/fooix/+edit)
110+ >>> print_code_trunk(owner_browser)
111 Development focus:
112- trunk series Change details
113- lp://dev/fooix Change branch
114+ lp://dev/fooix Configure Code
115 Browse the code
116 Links:
117- trunk series (/fooix/trunk)
118- Change details
119- (http://launchpad.dev/fooix/+edit)
120 lp://dev/fooix (http://code.launchpad.dev/~eric/fooix/trunk)
121- Change branch
122- Change the branch for this series
123- (http://launchpad.dev/fooix/trunk/+setbranch)
124+ Configure Code
125+ Configure code for this project
126+ (http://launchpad.dev/fooix/+configure-code)
127 Browse the code
128 (http://bazaar.launchpad.dev/~eric/fooix/trunk/files)
129
130@@ -154,24 +179,26 @@
131
132 >>> anon_browser.open('http://launchpad.dev/fooix')
133 >>> print_development_focus(anon_browser)
134- Development focus:
135- trunk series
136+ trunk series is the current focus of development.
137 Links:
138 trunk series (/fooix/trunk)
139+ >>> print_code_trunk(anon_browser)
140
141 >>> owner_browser.open('http://launchpad.dev/fooix')
142 >>> print_development_focus(owner_browser)
143- Development focus:
144- trunk series Change details
145- lp://dev/fooix Change branch
146- Browse the code
147+ trunk series is the current focus of development. Change details
148 Links:
149 trunk series (/fooix/trunk)
150 Change details
151 (http://launchpad.dev/fooix/+edit)
152+ >>> print_code_trunk(owner_browser)
153+ Development focus:
154+ lp://dev/fooix Configure Code
155+ Browse the code
156+ Links:
157 lp://dev/fooix (http://code.launchpad.dev/~eric/fooix/trunk)
158- Change branch
159- Change the branch for this series
160- (http://launchpad.dev/fooix/trunk/+setbranch)
161+ Configure Code
162+ Configure code for this project
163+ (http://launchpad.dev/fooix/+configure-code)
164 Browse the code
165 (https://bazaar.launchpad.dev/~eric/fooix/trunk/files)
166
167=== modified file 'lib/lp/registry/stories/product/xx-product-index.txt'
168--- lib/lp/registry/stories/product/xx-product-index.txt 2014-11-27 22:13:36 +0000
169+++ lib/lp/registry/stories/product/xx-product-index.txt 2016-03-24 02:58:58 +0000
170@@ -57,7 +57,7 @@
171 External downloads http://download.url/
172
173 >>> print extract_text(find_tag_by_id(content, 'product-languages'))
174- Programming Languages: C++,Xenon and Purple
175+ Programming languages: C++,Xenon and Purple
176
177 When the sourceforge URL is identical to the homepage, we omit the homepage:
178
179@@ -148,7 +148,7 @@
180 '<...This project&rsquo;s licence is proprietary...
181 >>> print extract_text(
182 ... find_tag_by_id(user_browser.contents, 'licences'))
183- Licences:
184+ Licence:
185 Other/Proprietary (Internal project.)
186 Commercial subscription expires ...
187
188@@ -178,7 +178,7 @@
189 None
190 >>> print extract_text(
191 ... find_tag_by_id(user_browser.contents, 'licences'))
192- Licences:
193+ Licence:
194 GNU GPL v2
195 Commercial subscription expires ...
196
197@@ -235,7 +235,7 @@
198 >>> anon_browser.open('http://launchpad.dev/firefox')
199 >>> print extract_text(
200 ... find_tag_by_id(anon_browser.contents, 'development-focus'))
201- Mozilla Firefox trunk series is the current focus of development
202+ trunk series is the current focus of development.
203
204 The page has a link to view the project's milestones.
205
206
207=== modified file 'lib/lp/registry/templates/product-index.pt'
208--- lib/lp/registry/templates/product-index.pt 2015-09-16 13:30:33 +0000
209+++ lib/lp/registry/templates/product-index.pt 2016-03-24 02:58:58 +0000
210@@ -106,39 +106,11 @@
211 <dt>Driver:</dt>
212 <dd tal:content="structure view/driver_widget" />
213 </dl>
214-
215- <dl id="dev-focus"
216- tal:define="dev_focus context/development_focus;
217- trunk dev_focus/branch;
218- trunk_visible trunk/required:launchpad.View|nothing">
219- <dt>Development focus:</dt>
220- <dd>
221- <p>
222- <a tal:attributes="href dev_focus/fmt:url"
223- tal:content="string:${dev_focus/name} series" />&nbsp;
224- <a tal:replace="structure overview_menu/edit/fmt:icon" /></p>
225- <p tal:condition="trunk_visible">
226- <a tal:replace="structure trunk/fmt:link" />&nbsp;
227- <a tal:replace="structure dev_focus/menu:overview/set_branch/fmt:icon" />
228- <br/>
229- <a tal:replace="structure trunk/menu:context/source/fmt:link"/>
230- </p>
231- </dd>
232- </dl>
233-
234- <dl id="product-languages"
235- tal:condition="view/show_programming_languages">
236- <dt>Programming Languages:</dt>
237- <dd tal:content="structure view/languages_edit_widget" />
238- </dl>
239-
240- <dl id="product-vcs" tal:condition="context/inferred_vcs">
241- <dt>Version control system:</dt>
242- <dd tal:content="context/inferred_vcs/title">Git</dd>
243- </dl>
244-
245+ </div>
246+
247+ <div>
248 <dl id="licences">
249- <dt>Licences:</dt>
250+ <dt>Licence:</dt>
251 <dd>
252 <tal:licenses repeat="license context/licenses">
253 <tal:license replace="license/title">GPL</tal:license><tal:comma
254@@ -188,8 +160,10 @@
255 metal:use-macro="context/@@+timeline-macros/timeline-iframe" />
256
257 <p id="development-focus">
258- <a tal:replace="structure context/development_focus/fmt:link" />
259- is the current focus of development
260+ <a tal:attributes="href context/development_focus/fmt:url"
261+ tal:content="string:${context/development_focus/name} series" />
262+ is the current focus of development.
263+ <a tal:replace="structure overview_menu/edit/fmt:icon" />
264 </p>
265
266 <ul class="horizontal">
267@@ -214,25 +188,61 @@
268
269 <div class="yui-g">
270 <div class="yui-u first">
271+ <div id="code-info" class="portlet">
272+ <h2>
273+ <span class="see-all"><a
274+ tal:attributes="href context/fmt:url:code">
275+ All code</a></span>
276+ Code
277+ </h2>
278+
279+ <dl id="dev-focus"
280+ tal:define="trunk context/development_focus/branch;
281+ trunk_visible trunk/required:launchpad.View|nothing"
282+ tal:condition="trunk_visible">
283+ <dt>Development focus:</dt>
284+ <dd>
285+ <p>
286+ <a tal:replace="structure trunk/fmt:link" />&nbsp;
287+ <a tal:replace="structure context/menu:overview/configure_code/fmt:icon" />
288+ <br/>
289+ <a tal:replace="structure trunk/menu:context/source/fmt:link"/>
290+ </p>
291+ </dd>
292+ </dl>
293+
294+ <div class="two-column-list">
295+ <dl id="product-vcs" tal:condition="context/inferred_vcs">
296+ <dt>Version control system:</dt>
297+ <dd tal:content="context/inferred_vcs/title">Git</dd>
298+ </dl>
299+
300+ <dl id="product-languages"
301+ tal:condition="view/show_programming_languages">
302+ <dt>Programming languages:</dt>
303+ <dd tal:content="structure view/languages_edit_widget" />
304+ </dl>
305+ </div>
306+ </div>
307+
308+ <div tal:content="structure context/@@+portlet-latestquestions"
309+ tal:condition="context/answers_usage/enumvalue:LAUNCHPAD" />
310+
311 <div tal:content="structure context/@@+portlet-listfaqs"
312 tal:condition="context/answers_usage/enumvalue:LAUNCHPAD" />
313+ <div tal:content="structure context/@@+portlet-packages" />
314+ </div>
315
316+ <div class="yui-u">
317 <div tal:content="structure context/@@+portlet-latestbugs"
318 tal:condition="context/bug_tracking_usage/enumvalue:LAUNCHPAD" />
319
320- <div tal:content="structure context/@@+portlet-top-contributors" />
321-
322- <div tal:content="structure context/@@+portlet-packages" />
323- </div>
324-
325- <div class="yui-u">
326- <div tal:content="structure context/@@+portlet-latestquestions"
327- tal:condition="context/answers_usage/enumvalue:LAUNCHPAD" />
328-
329 <div tal:content="structure context/@@+portlet-latestspecs"
330 tal:condition="context/blueprints_usage/enumvalue:LAUNCHPAD" />
331
332 <div tal:content="structure context/@@+portlet-coming-sprints" />
333+
334+ <div tal:content="structure context/@@+portlet-top-contributors" />
335 </div>
336 <div class="yui-u">
337 <div id="structural-subscription-content-box"></div>