Merge lp:~henninge/launchpad/bug-431244 into lp:launchpad

Proposed by Henning Eggers
Status: Merged
Approved by: Henning Eggers
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~henninge/launchpad/bug-431244
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~henninge/launchpad/bug-431244
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) Approve
Barry Warsaw (community) ui* Approve
Canonical Launchpad Engineering code Pending
Review via email: mp+12087@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Henning Eggers (henninge) wrote :

= Summary =

The new Launchpad 3.0 home page!
See the discussion in the bug ... ;-)

== Implementation details ==

To be able to click on Link/Register in the top right corner, using the "locationless" template, I added set the height of locationbar to 1em (it was 0). This adds that much space to the top of all Launchpad pages but that does not look too bad ...

== Tests ==

bin/test -vvct front-pages

...and various other tests that are updated with this branch

== Demo ==

https://launchpad.dev/

= Launchpad lint =

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

Linting changed files:
  lib/canonical/launchpad/icing/style.css
  lib/canonical/launchpad/pagetests/basics/demo-and-lpnet.txt
  lib/canonical/launchpad/pagetests/basics/page-request-summaries.txt
  lib/canonical/launchpad/pagetests/basics/user-requested-oops.txt
  lib/canonical/launchpad/pagetests/basics/xx-copyright.txt
  lib/canonical/launchpad/pagetests/launchpad-root/front-pages.txt
  lib/canonical/launchpad/templates/root-index.pt
  lib/canonical/testing/ftests/test_layers.py
  lib/lp/registry/browser/root.py
  lib/lp/registry/stories/launchpad-root/xx-featuredprojects.txt

== Pylint notices ==

lib/canonical/testing/ftests/test_layers.py
    24: [F0401] Unable to import 'lazr.config' (No module named config)

lib/lp/registry/browser/root.py
    44: [F0401] Unable to import 'lazr.batchnavigator.z3batching' (No module named batchnavigator)
    534: [E1002, WindowedListBatch.__iter__] Use super on an old style class

Seriously, I did not touch that. These F401 seem strange, too. Have seen that before but the view works fine ...

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

On Sep 18, 2009, at 06:15 PM, Henning Eggers wrote:

>https://launchpad.dev/

Hi Henning,

This is a ui review. First, thanks for taking this on. Given it's the first
impression many people will have of us, your branch making it look great is so
important! And I think you /have/ made it look great. I have just a few
suggestions.

* In Martin's mockup 'Register' is called 'Create an account' for non-logged
  in users. Is that easy to change?

* Also for non-logged in users, Martin's mockup appears to line the 'Take the
  tour' icon under all the bullets in the feature list. Your branch shows
  icons for the various features instead of bullets, which I like, but the
  Tour icon is misplaced several pixes to the left.

  I suspect that lining it up under the feature icons wouldn't give the needed
  emphasis to the tour link. You can try it though and see what you think.
  Another option would be to move the Tour link to the 'Get started' section,
  which kind of makes more sense to me anyway. Would that be hard to move and
  if not, does it look okay?

  Ah, in fact for a logged in user, that's exactly where it shows up, but I
  see that it's lined up right under the other icons, so maybe it would be
  okay (and enough) to do that for the non-logged in user.

* If possible, it would be cool if the numbers in the little "20 projects, 12
  bugs, 30 branches" sub-heading were colored in the app-colors, like other
  displays like this. See style-3-0.css for the classes you can put on the
  <b> wrapper around the numbers. (Same goes for the "Browser all *20*
  projects" under the Featured projects section.)

* Do you think the words "sandbox environment" should be linked to staging's
  front page?

* "bazaar" should be capitalized.

* For a not-logged in newbie, the "(Unspecified)" tags will be completely
  meaningless. Well, they're meaningless to me too! This may just be an
  artifact of sampledata, but it would be nice to get rid of those tags.

For now, let's wait on ui approval.

 review needsfixing ui*

review: Needs Fixing (ui*)
Revision history for this message
Barry Warsaw (barry) wrote :

> For now, let's wait on ui approval.

I probably should have read the entire history of the bug first, but I've done
that now and see that you and Kiko have touched on many of the same issues.
Because PQM closes on Monday and this is definitely a big improvement over
what we have, I'm changing my ui review to approved. Please fix what you can,
but don't let it hold up your branch if you can't get me to re-review your
branch. You should try to get a second ui review though (I am just a
ui-mentat).

review: Approve (ui*)
Revision history for this message
Guilherme Salgado (salgado) wrote :
Download full text (18.3 KiB)

Hi Henning,

There are a few improvements we can make to this branch, but they're
quite simple. You have r=me with these changes done.

 review approve

> === modified file 'lib/canonical/launchpad/pagetests/launchpad-root/front-pages.txt'
> --- lib/canonical/launchpad/pagetests/launchpad-root/front-pages.txt 2009-01-28 21:47:33 +0000
> +++ lib/canonical/launchpad/pagetests/launchpad-root/front-pages.txt 2009-09-18 18:04:16 +0000
> @@ -17,32 +17,46 @@
>
> And links to the important applications and facets:
>
> - >>> people_link = browser.getLink(url='/people')
> - >>> people_link.url
> - 'http://launchpad.dev/people/+newteam'
> -
> - >>> people_link.text
> - '[IMG]'
> -
> >>> code_link = browser.getLink(url='code')
> >>> code_link.url
> 'http://code.launchpad.dev/'
>
> >>> code_link.text
> - 'Code'
> + '[IMG]'
>
> It also includes a search form...
>
> - >>> '<input type="submit" value="Search Launchpad"' in browser.contents
> + >>> ('<input id="search" type="submit" '+
> + ... 'value="Search Launchpad"') in browser.contents

Please use browser.getControl() here to show that there's a search form. Tests
of the form 'something in browser.contents' are the among the worst things we
can have in pagetests.

> True
>
> ...and lists of featured projects and marketing material.
>
> - >>> for tag in find_tags_by_class(browser.contents, 'three column left'):
> - ... print extract_text(tag.renderContents())
> + >>> featured = find_tag_by_id(browser.contents, 'homepage-featured')
> + >>> print extract_text(featured.renderContents())
> Featured projects
> ...
> Ubuntu
> + ...
> +
> +The homepage looks different when the use is logged in:
> +
> + >>> user_browser = setupBrowser(auth="Basic <email address hidden>:test")
> + >>> user_browser.open('http://launchpad.dev/')
> +
> +Now there are links to create projects and teams:
> +
> + >>> project_link = user_browser.getLink(url='/projects')
> + >>> project_link.url
> + 'http://launchpad.dev/projects/+new'
> + >>> project_link.text
> + '[IMG]'
> +
> + >>> people_link = user_browser.getLink(url='/people')
> + >>> people_link.url
> + 'http://launchpad.dev/people/+newteam'
> + >>> people_link.text
> + '[IMG]'

I don't see what's the point of showing that the link's text is an image; I'd
rather not show that in the test, as it already shows that the link exists and
points to the correct place.

>
>
> The front pages for the other applications, however, do have
>
> === modified file 'lib/canonical/launchpad/templates/root-index.pt'
> --- lib/canonical/launchpad/templates/root-index.pt 2009-08-03 10:00:43 +0000
> +++ lib/canonical/launchpad/templates/root-index.pt 2009-09-18 18:04:16 +0000
> @@ -3,10 +3,7 @@
> xmlns:tal="http://xml.zope.org/namespaces/tal"
> xmlns:metal="http://xml.zope.org/namespaces/metal"
> xmlns:i18n="http://xml.zope.org/namespaces/i18n"
> - xml:lang="en"
> - lang="en"
> - dir="ltr"
> - metal:use-macro="view/macro:page/search"
> + metal:use-macro="view/macro:page/locationless"
> i18n:domain="launchpad">
> <body>
> <div metal:fill-slot="main">
> @@ -35,21 +32,19 @@
> </tal:comment>
> ...

review: Approve
Revision history for this message
Henning Eggers (henninge) wrote :

Am 18.09.2009 22:54, Guilherme Salgado schrieb:
> Review: Approve
> Hi Henning,
>
> There are a few improvements we can make to this branch, but they're
> quite simple. You have r=me with these changes done.

Thanks for the review, I applied all the changes. I had never used
fmt:shorten though I think I have read it before. Thanks for that
valuable tip.

I went through the whole template and fixed the indention.

Thanks again! ;-)

Henning

Revision history for this message
Henning Eggers (henninge) wrote :
Download full text (3.4 KiB)

Am 18.09.2009 21:33, Barry Warsaw schrieb:
> Review: Needs Fixing ui*
> On Sep 18, 2009, at 06:15 PM, Henning Eggers wrote:
>
>> https://launchpad.dev/
>
> Hi Henning,
>
> This is a ui review. First, thanks for taking this on. Given it's the first
> impression many people will have of us, your branch making it look great is so
> important! And I think you /have/ made it look great. I have just a few
> suggestions.

I am glad you like it. I am aware that you have changed your review
since but I'd still like to address your suggestions.

>
> * In Martin's mockup 'Register' is called 'Create an account' for non-logged
> in users. Is that easy to change?

No, it is part of the "locationless" template.

>
> * Also for non-logged in users, Martin's mockup appears to line the 'Take the
> tour' icon under all the bullets in the feature list. Your branch shows
> icons for the various features instead of bullets, which I like, but the
> Tour icon is misplaced several pixes to the left.
>
> I suspect that lining it up under the feature icons wouldn't give the needed
> emphasis to the tour link. You can try it though and see what you think.
> Another option would be to move the Tour link to the 'Get started' section,
> which kind of makes more sense to me anyway. Would that be hard to move and
> if not, does it look okay?

It would probably not be hard to move but I don't want to risk upsetting
pagetests at this stage ;-)

>
> Ah, in fact for a logged in user, that's exactly where it shows up, but I
> see that it's lined up right under the other icons, so maybe it would be
> okay (and enough) to do that for the non-logged in user.

The point is that the left bullet list is a continuation of the
introductory sentence "Launchpad is ..." and the list items are features
of Launchpad. The "Take the Tour!" does not fit that category. I admit
it is probably not the best placement but that will have to be addressed
later.

>
> * If possible, it would be cool if the numbers in the little "20 projects, 12
> bugs, 30 branches" sub-heading were colored in the app-colors, like other
> displays like this. See style-3-0.css for the classes you can put on the
> <b> wrapper around the numbers. (Same goes for the "Browser all *20*
> projects" under the Featured projects section.)

What a nice idea and so easy to implement. Done. Although it does not
show for the projects since there colour is default, i.e. black and it
is inside an <a>.

>
> * Do you think the words "sandbox environment" should be linked to staging's
> front page?

I didn't on purpose because I think people should be forced to read the
wiki page first. Once they know about staging, they will enter the url
directly.

>
> * "bazaar" should be capitalized.

Yeah, obviously. Thank you! ;) I copied that from Martin ...

>
> * For a not-logged in newbie, the "(Unspecified)" tags will be completely
> meaningless. Well, they're meaningless to me too! This may just be an
> artifact of sampledata, but it would be nice to get rid of those tags.

That is part of fmt:link for projects. Since we can safely assume that
featured projects in real life *will* hav...

Read more...

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

Just a quick note and then I'm done. :)

On Sep 18, 2009, at 7:45 PM, Henning Eggers wrote:

>> * If possible, it would be cool if the numbers in the little "20
>> projects, 12
>> bugs, 30 branches" sub-heading were colored in the app-colors,
>> like other
>> displays like this. See style-3-0.css for the classes you can put
>> on the
>> <b> wrapper around the numbers. (Same goes for the "Browser all
>> *20*
>> projects" under the Featured projects section.)
>
> What a nice idea and so easy to implement. Done. Although it does not
> show for the projects since there colour is default, i.e. black and it
> is inside an <a>.

The "registry-app" color is black, for people, projects, teams...

-Barry

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.css'
2--- lib/canonical/launchpad/icing/style.css 2009-09-16 10:03:52 +0000
3+++ lib/canonical/launchpad/icing/style.css 2009-09-18 18:04:16 +0000
4@@ -1568,64 +1568,125 @@
5 #packages h1, #projects h1 {margin-top: 1.2em;}
6
7 /* --- Home --- */
8-#home-description {
9- font-size: 1.5em;
10- font-family: "URW Gothic L","MgOpen Moderna","Lucida Sans",sans-serif;
11- text-align: center;
12- margin: auto;
13- margin-top: 1em;
14- margin-bottom: 1em;
15- padding: 0.5em;
16- background-color: #ededed;
17- width: 90%;
18-}
19-#home-description .smaller {
20- font-size: 80%;
21-}
22-#home-stats {
23- margin: auto;
24- text-align: center;
25- color: gray;
26- max-width: 40em;
27-}
28-#home-page h2 {
29- width: 100%;
30- text-align: center;
31- margin-left: -0.8em;
32-}
33-#home-page img {
34- vertical-align: middle;
35-}
36-#featured-projects ul {
37- list-style-type: none;
38- width: 50%;
39- margin: 0;
40- padding: 0 ;
41- float: left;
42-}
43-#featured-projects li {
44- padding-bottom: 2px;
45-}
46-.home-banners {
47- background-color: #8890ff;
48- width: 220px;
49- padding: 1em 0 1em 1em;
50- margin-top: 1em;
51- overflow: hidden;
52- -moz-border-radius: 5px;
53- -o-border-radius: 5px;
54- -webkit-border-radius: 5px;
55-}
56-.home-banners a {
57- font-weight: bold;
58- color: white;
59-}
60-.home-banner-container {
61- width: 100%;
62- background-color: #ededed;
63- padding: 1em;
64- padding-top: 0;
65-}
66+
67+/* The following style works around the fact that the locationbar, which is
68+only used of the Login/Register links in 3.0 UI, is accessible on
69+"locationless" pages. It adds extra space at the top of every page in
70+Launchpad but that does actually look quite good ... ;-).*/
71+#locationbar {
72+ height: 1em;
73+}
74+
75+#homepage {
76+ margin: auto;
77+ width: 90%;
78+ max-width: 80em;
79+}
80+
81+.homepage-portlet {
82+ margin-bottom: 3em;
83+ line-height: 140%;
84+}
85+
86+.homepage-portlet h2 {
87+ margin-bottom: 0.5em;
88+ font-size: 131%;
89+}
90+
91+/* Home: search form */
92+
93+#homepage-searchform {
94+ text-align: center;
95+}
96+
97+#homepage-stats {
98+ max-width: 50em;
99+ margin: auto;
100+ padding-top: 0.5em;
101+ color: gray;
102+ font-size: 83.3%
103+}
104+
105+/* Home: What's launchpad */
106+
107+#homepage-whatslaunchpad ul {
108+ margin-left: 1em;
109+ margin-bottom: 0.5em;
110+}
111+
112+#homepage-whatslaunchpad ul,
113+#homepage-whatslaunchpad-tour {
114+ font-size: 116%;
115+ font-weight: bold;
116+}
117+
118+/* Home: blog posts */
119+
120+#homepage-blogposts {
121+ padding-right: 4em;
122+}
123+
124+#homepage-blogposts .blogdate {
125+ font-size: 85%;
126+ color: grey;
127+}
128+
129+#homepage-blogposts-older {
130+ text-align: right;
131+}
132+
133+/* Home: Get started */
134+
135+#homepage-getstarted ul {
136+ margin-top: 0.5em;
137+}
138+
139+/* Home: Featured projects */
140+
141+#homepage-featured {
142+ width: 100%;
143+}
144+
145+#homepage-featured ul {
146+ width: 48%;
147+}
148+
149+#homepage-featured-left {
150+ float: left;
151+}
152+
153+#homepage-featured-right {
154+ float: right;
155+}
156+
157+#homepage-featured-top img {
158+ float: left;
159+}
160+#homepage-featured-top-title {
161+ height: 64px;
162+ display: block;
163+ margin-left: 70px;
164+}
165+
166+#homepage-featured-top-title span{
167+ font-size: 131%;
168+ font-weight: bold;
169+ position: relative;
170+ top: 20px;
171+}
172+
173+#homepage-featured-top-text {
174+ margin-top: 0.5em;
175+ margin-bottom: 1em;
176+}
177+
178+#homepage-featured-more {
179+ margin-top: 0.5em;
180+ text-align: right;
181+ clear: both;
182+}
183+
184+/* -- Notices -- */
185
186 .important-notice-container {
187 text-align: center;
188
189=== modified file 'lib/canonical/launchpad/pagetests/basics/demo-and-lpnet.txt'
190--- lib/canonical/launchpad/pagetests/basics/demo-and-lpnet.txt 2009-09-17 15:24:12 +0000
191+++ lib/canonical/launchpad/pagetests/basics/demo-and-lpnet.txt 2009-09-18 18:04:16 +0000
192@@ -59,23 +59,6 @@
193 >>> print browser.getLink(url="http://example.com").text
194 File a bug
195
196-And for a non-3-0 page:
197-
198- >>> browser.open('http://launchpad.dev/')
199- >>> print browser.contents
200- <...
201- <style...url(/@@/demo)...</style>
202- ...
203- >>> print extract_text(find_tag_by_id(browser.contents, 'lp-version'))
204- |...Launchpad...) devmode demo site
205-
206- >>> print extract_text(find_tags_by_class(
207- ... browser.contents, 'sitemessage')[0])
208- This is a demo site mmk. File a bug.
209- >>> print browser.getLink(url="http://example.com").text
210- File a bug
211-
212-
213 When you are not on a demo site, the text no longer appears.
214
215 >>> # Restore the previous config:
216@@ -92,15 +75,6 @@
217 0
218
219
220-And for a non-3-0 page:
221-
222- >>> browser.open('http://launchpad.dev/')
223- >>> print extract_text(find_tag_by_id(browser.contents, 'lp-version'))
224- |...Launchpad...) devmode
225- >>> len(find_tags_by_class(browser.contents, 'sitemessage'))
226- 0
227-
228-
229 == Launchpad Edge ==
230
231 Additionally, when a server is running as an edge server, the site-message
232
233=== modified file 'lib/canonical/launchpad/pagetests/basics/page-request-summaries.txt'
234--- lib/canonical/launchpad/pagetests/basics/page-request-summaries.txt 2009-09-16 22:57:42 +0000
235+++ lib/canonical/launchpad/pagetests/basics/page-request-summaries.txt 2009-09-18 18:04:16 +0000
236@@ -6,7 +6,7 @@
237 >>> browser.open('http://launchpad.dev/')
238 >>> print browser.contents
239 <!DOCTYPE...
240- ...<!-- at least ... queries issued in ... seconds -->...
241+ ...<!--... At least ... queries issued in ... seconds ...-->...
242
243 It's available for any page:
244
245
246=== modified file 'lib/canonical/launchpad/pagetests/basics/user-requested-oops.txt'
247--- lib/canonical/launchpad/pagetests/basics/user-requested-oops.txt 2009-09-05 06:40:36 +0000
248+++ lib/canonical/launchpad/pagetests/basics/user-requested-oops.txt 2009-09-18 18:04:16 +0000
249@@ -14,8 +14,11 @@
250
251 >>> (page, summary) = browser.contents.split('</html>')
252 >>> print summary
253- <!-- at least ... queries issued in ... seconds OOPS-... -->
254- <!-- Launchpad ... -->
255+ <!-- ...
256+ At least ... queries issued in ... seconds OOPS-...
257+ <BLANKLINE>
258+ Launchpad ...
259+ -->
260
261 The ++oops++ can be anywhere in the traversal.
262
263
264=== modified file 'lib/canonical/launchpad/pagetests/basics/xx-copyright.txt'
265--- lib/canonical/launchpad/pagetests/basics/xx-copyright.txt 2009-07-09 19:48:42 +0000
266+++ lib/canonical/launchpad/pagetests/basics/xx-copyright.txt 2009-09-18 18:04:16 +0000
267@@ -10,6 +10,6 @@
268 The main template.
269
270 >>> browser.open('http://launchpad.dev')
271- >>> print extract_text(find_tag_by_id(browser.contents, 'lp-arcana'))
272- &copy; 2004-2009 Canonical Ltd.
273+ >>> print extract_text(find_tag_by_id(browser.contents, 'footer'))
274+ &bull; ... &copy; 2004-2009 Canonical Ltd.
275 ...
276
277=== modified file 'lib/canonical/launchpad/pagetests/launchpad-root/front-pages.txt'
278--- lib/canonical/launchpad/pagetests/launchpad-root/front-pages.txt 2009-01-28 21:47:33 +0000
279+++ lib/canonical/launchpad/pagetests/launchpad-root/front-pages.txt 2009-09-18 18:04:16 +0000
280@@ -17,32 +17,46 @@
281
282 And links to the important applications and facets:
283
284- >>> people_link = browser.getLink(url='/people')
285- >>> people_link.url
286- 'http://launchpad.dev/people/+newteam'
287-
288- >>> people_link.text
289- '[IMG]'
290-
291 >>> code_link = browser.getLink(url='code')
292 >>> code_link.url
293 'http://code.launchpad.dev/'
294
295 >>> code_link.text
296- 'Code'
297+ '[IMG]'
298
299 It also includes a search form...
300
301- >>> '<input type="submit" value="Search Launchpad"' in browser.contents
302+ >>> ('<input id="search" type="submit" '+
303+ ... 'value="Search Launchpad"') in browser.contents
304 True
305
306 ...and lists of featured projects and marketing material.
307
308- >>> for tag in find_tags_by_class(browser.contents, 'three column left'):
309- ... print extract_text(tag.renderContents())
310+ >>> featured = find_tag_by_id(browser.contents, 'homepage-featured')
311+ >>> print extract_text(featured.renderContents())
312 Featured projects
313 ...
314 Ubuntu
315+ ...
316+
317+The homepage looks different when the use is logged in:
318+
319+ >>> user_browser = setupBrowser(auth="Basic test@canonical.com:test")
320+ >>> user_browser.open('http://launchpad.dev/')
321+
322+Now there are links to create projects and teams:
323+
324+ >>> project_link = user_browser.getLink(url='/projects')
325+ >>> project_link.url
326+ 'http://launchpad.dev/projects/+new'
327+ >>> project_link.text
328+ '[IMG]'
329+
330+ >>> people_link = user_browser.getLink(url='/people')
331+ >>> people_link.url
332+ 'http://launchpad.dev/people/+newteam'
333+ >>> people_link.text
334+ '[IMG]'
335
336
337 The front pages for the other applications, however, do have
338
339=== modified file 'lib/canonical/launchpad/templates/root-index.pt'
340--- lib/canonical/launchpad/templates/root-index.pt 2009-08-03 10:00:43 +0000
341+++ lib/canonical/launchpad/templates/root-index.pt 2009-09-18 18:04:16 +0000
342@@ -3,10 +3,7 @@
343 xmlns:tal="http://xml.zope.org/namespaces/tal"
344 xmlns:metal="http://xml.zope.org/namespaces/metal"
345 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
346- xml:lang="en"
347- lang="en"
348- dir="ltr"
349- metal:use-macro="view/macro:page/search"
350+ metal:use-macro="view/macro:page/locationless"
351 i18n:domain="launchpad">
352 <body>
353 <div metal:fill-slot="main">
354@@ -35,21 +32,19 @@
355 </tal:comment>
356 <!-- Is your project registered yet? -->
357
358- <form
359+ <div id="homepage">
360+ <div class="top-portlet">
361+ <img src="/@@/launchpad-logo-and-name.png"
362+ alt=""
363+ style="margin: 0 9em 1em 0"/>
364+ <form id="homepage-searchform"
365 xml:lang="en" lang="en" dir="ltr"
366 tal:attributes="action string:${rooturl}+search"
367- method="get"
368- accept-charset="UTF-8"
369- style="text-align: center"
370- >
371- <img src="/@@/launchpad-logo-and-name.png"
372- alt=""
373- style="margin: 0 9em 1em 0"/>
374- <br />
375- <input id="text" type="text" name="field.text" size="50" />
376- <input type="submit" value="Search Launchpad" />
377+ method="get" accept-charset="UTF-8">
378+ <input id="text" type="text" name="field.text" size="45" />
379+ <input id="search" type="submit" value="Search Launchpad" />
380 </form>
381- <div id="home-stats">
382+ <div id="homepage-stats">
383 <strong tal:content="view/project_count/fmt:intcomma">123</strong>&nbsp;projects,
384 <strong tal:content="view/bug_count/fmt:intcomma">123</strong>&nbsp;bugs,
385 <strong tal:content="view/branch_count/fmt:intcomma">123</strong>&nbsp;branches,
386@@ -58,25 +53,137 @@
387 <strong tal:content="view/blueprint_count/fmt:intcomma">123</strong>&nbsp;blueprints,
388 and&nbsp;counting...
389 </div>
390- <div id="home-description">
391- Launchpad is a code hosting and software collaboration platform.<br />
392- <span class="smaller">Launchpad is open source -- you can <a href="https://dev.launchpad.net/">join the community</a> of people
393- who help improve it.</span>
394- </div>
395- <div id="home-page" style="width:90%; max-width:80em; margin:auto;">
396- <div class="three column left" id="featured-projects">
397+ </div>
398+
399+ <div class="yui-gc">
400+
401+ <div class="yui-u first">
402+ <div id="homepage-whatslaunchpad" class="homepage-portlet"
403+ tal:condition="not:view/is_logged_in">
404+ <h2>Launchpad is a software collaboration platform that provides:</h2>
405+ <ul tal:define="apphomes view/apphomes">
406+ <li><a tal:attributes="href apphomes/bugs"><img src="/@@/bug" alt="" /></a>
407+ <a tal:attributes="href apphomes/bugs">Bug tracking</a></li>
408+ <li><a tal:attributes="href apphomes/code"><img src="/@@/branch" alt="" /></a>
409+ <a tal:attributes="href apphomes/code">Code hosting</a>
410+ using <a href="http://bazaar-vcs.org/">bazaar</a></li>
411+ <li><a href="https://help.launchpad.net/Code/Review"><img src="/@@/yes" alt="" /></a>
412+ <a href="https://help.launchpad.net/Code/Review">Code reviews</a></li>
413+ <li><a tal:attributes="href apphomes/ubuntu"><img src="/@@/ubuntu-icon" alt="" /></a>
414+ <a tal:attributes="href apphomes/ubuntu">Ubuntu package building and hosting</a></li>
415+ <li><a tal:attributes="href apphomes/translations"><img src="/@@/translation" alt="" /></a>
416+ <a tal:attributes="href apphomes/translations">Translations</a></li>
417+ <li><a href="https://help.launchpad.net/Teams/MailingLists"><img src="/@@/mail" alt="" /></a>
418+ <a href="https://help.launchpad.net/Teams/MailingLists">Mailing lists</a></li>
419+ <li><a tal:attributes="href apphomes/answers"><img src="/@@/question" alt="" /></a>
420+ <a tal:attributes="href apphomes/answers">Answer tracking and FAQs</a></li>
421+ <li><a tal:attributes="href apphomes/blueprints"><img src="/@@/blueprint" alt="" /></a>
422+ <a tal:attributes="href apphomes/blueprints">Specification tracking</a></li>
423+ </ul>
424+ <div id="homepage-whatslaunchpad-tour">
425+ <a href="/+tour"><img src="/@@/tour-icon" alt=""
426+ /></a> <a href="/+tour">Take the tour!</a>
427+ </div>
428+ </div>
429+ <div id="homepage-blogposts" class="homepage-portlet">
430+ <h2>Recent Launchpad blog posts</h2>
431+ <ul>
432+ <li class="news">
433+ <a href="http://blog.launchpad.net/?p=1010">
434+ Welcome to Launchpad 3.0</a><span class="blogdate"> &ndash; 23 Sep 2009</span><br />
435+ Find out what's new in the latest version of Launchpad.
436+ </li>
437+ <li class="news">
438+ <a href="http://blog.launchpad.net/?p=1019">
439+ Talking about Launchpad's new UI</a><span class="blogdate"> &ndash; 23 Sep 2009</span><br />
440+ Martin Albisetti &mdash; Launchpad's design guy &mdash; on the new
441+ web interface.
442+ </li>
443+ <li class="news">
444+ <a href="http://blog.launchpad.net/?p=1021">
445+ Under the hood</a><span class="blogdate"> &ndash; 23 Sep 2009</span><br />
446+ Bj&ouml;rn Tillenius &mdash; Launchpad technical architect &mdash; talks
447+ about the inner workings of Launchpad.
448+ </li>
449+ <li class="news">
450+ <a href="http://blog.launchpad.net/general/launchpad-is-now-open-source">
451+ Launchpad now open source!</a><span class="blogdate"> &ndash; 21 Jul 2009</span><br />
452+ Translate a phrase once, have it show up in all your releases.
453+ </li>
454+ <li class="news">
455+ <a href="http://blog.launchpad.net/?p=551">
456+ Launchpad for commercial projects</a><span class="blogdate"> &ndash; 25 Feb 2009</span><br />
457+ Find out more about Launchpad's privacy features for your commercial projects.
458+ </li>
459+ </ul>
460+ <div id="homepage-blogposts-older">
461+ <a href="http://blog.launchpad.net">&gt; Read the blog</a>
462+ </div>
463+ </div>
464+ </div>
465+
466+ <div class="yui-u">
467+ <div id="homepage-getstarted" class="homepage-portlet">
468+ <h2>Get started</h2>
469+ <tal:logged_out condition="not:view/is_logged_in" omit-tag="">
470+ <a href="/+login">Creating an account</a> allows you to start
471+ working within Launchpad.<br />
472+ </tal:logged_out>You can test Launchpad's functionality
473+ in our sandbox environment.
474+ (<a href="https://help.launchpad.net/StagingServer">What's this?</a>)<br />
475+
476+ <tal:logged_in condition="view/is_logged_in" omit-tag="">
477+ If you're ready, you can:
478+ <ul tal:define="apphomes view/apphomes">
479+ <li><a href="https://help.launchpad.net/">
480+ <img src="/@@/info" alt="" /></a>
481+ <a href="https://help.launchpad.net/"> Read the user guide</a></li>
482+ <li><a href="/projects/+new"><img src="/@@/add" /></a>
483+ <a href="/projects/+new">Create a new project</a></li>
484+ <li><a href="/people/+newteam"><img src="/@@/add" /></a>
485+ <a href="/people/+newteam">Create a new team</a></li>
486+ <li><a tal:attributes="href apphomes/bugs">
487+ <img src="/@@/bug" /></a>
488+ <a tal:attributes="href apphomes/bugs">Browse bugs</a></li>
489+ <li><a tal:attributes="href apphomes/translations">
490+ <img src="/@@/translation" /></a>
491+ <a tal:attributes="href apphomes/translations">Help translate</a></li>
492+ <li><a tal:attributes="href apphomes/answers">
493+ <img src="/@@/question" alt="" /></a>
494+ <a tal:attributes="href apphomes/answers">Find answers</a></li>
495+ <li><a href="/+tour"><img src="/@@/tour-icon" /></a>
496+ <a href="/+tour">Take the tour</a></li>
497+ </ul>
498+ </tal:logged_in>
499+ </div>
500+ <div id="homepage-featured" class="homepage-portlet">
501 <h2>Featured projects</h2>
502- <div style="margin:auto;">
503- <ul>
504+ <div id="homepage-featured-top"
505+ tal:define="topproject view/featured_projects_top">
506+ <a tal:attributes="href topproject/fmt:url">
507+ <img tal:replace="structure topproject/image:logo" />
508+ <div id="homepage-featured-top-title">
509+ <span tal:content="topproject/displayname">Foo project</span>
510+ </div>
511+ </a>
512+ <div id="homepage-featured-top-text"
513+ tal:content="structure view/featured_projects_top_summary">
514+ Foo project is great... </div>
515+ </div>
516+ <ul id="homepage-featured-left">
517 <li tal:repeat="project view/featured_projects_col_a">
518 <a tal:replace="structure project/fmt:link" />
519 </li>
520 </ul>
521- <ul>
522+ <ul id="homepage-featured-right">
523 <li tal:repeat="project view/featured_projects_col_b">
524 <a tal:replace="structure project/fmt:link" />
525 </li>
526 </ul>
527+ <div id="homepage-featured-more">
528+ <a href="/projects">Browse all <strong
529+ tal:content="view/project_count">42</strong> projects</a>!
530+ </div>
531 <div tal:condition="context/required:launchpad.Admin"
532 style="margin:auto; clear:both; text-align: center; padding-top: 1em;">
533 <a href="+featuredprojects">&raquo; Manage featured project list</a>
534@@ -84,69 +191,8 @@
535 </div>
536 </div>
537
538- <div class="three column middle">
539- <h2>What&#8217;s new?</h2>
540- <ul style="padding: 0; margin: auto;">
541- <li class="news">
542- <a href="http://blog.launchpad.net/general/launchpad-is-now-open-source">
543- <strong>Launchpad now open source!</strong><br />
544- Get the code to Launchpad and join our development community.
545- </a>
546- </li>
547- <li class="news">
548- <a href="http://blog.launchpad.net/general/exporting-translations-to-a-bazaar-branch">
549- <strong>Export translations to Bazaar branches</strong><br />
550- Have Launchpad automatically commit your project's translations to a branch of code.
551- </a>
552- </li>
553- <li class="news">
554- <a href="http://blog.launchpad.net/cool-new-stuff/automatically-import-files-to-launchpad-using-product-release-finder">
555- <strong>Automatic release file imports</strong><br />
556- Launchpad will find and automatically import your project's release files.
557- </a>
558- </li>
559- <li class="news">
560- <a href="http://blog.launchpad.net/translations/sharing-translations">
561- <strong>Share translations between releases</strong><br />
562- Translate a phrase once, have it show up in all your releases.
563- </a>
564- </li>
565- <li class="news">
566- <a href="http://blog.launchpad.net/?p=551">
567- <strong>Launchpad for commercial projects</strong><br />
568- Find out more about Launchpad's privacy features for your commercial projects.
569- </a>
570- </li>
571- </ul>
572- <div class="discreet" style="text-align: right">
573- Updated 2009-08-03.
574- <a href="http://blog.launchpad.net">Read our blog!</a>
575- </div>
576- </div>
577- <div class="three column right">
578- <div style="margin:auto; width:230px;">
579- <h2>Get started</h2>
580- <div class="home-banners">
581- <a href="/projects/+new"><img src="/@@/add"
582- /></a> <a href="/projects/+new">Create a new project</a><br/>
583- <a href="/people/+newteam"><img src="/@@/add"
584- /></a> <a href="/people/+newteam">Create a new team</a>
585- </div>
586- <div class="home-banners">
587- <a href="/projects"><img src="/@@/project" alt=""
588- /></a> <a href="/projects">Browse projects</a><br/>
589- <a href="/people"><img src="/@@/crowd" alt=""
590- /></a> <a href="/people">Browse people &amp; teams</a>
591- </div>
592- <div class="home-banners">
593- <a href="/+tour"><img src="/@@/tour-icon" alt=""
594- /></a> <a href="/+tour">Take the tour</a><br/>
595- <a href="https://help.launchpad.net/"><img src="/@@/maybe" alt=""
596- /></a> <a href="https://help.launchpad.net/">Read the guide</a>
597- </div>
598- </div>
599- </div>
600- </div><!-- 3 cols -->
601+ </div><!-- yui-g -->
602+ </div><!-- homepage -->
603 </div><!--main-->
604 </body>
605 </html>
606
607=== modified file 'lib/canonical/testing/ftests/test_layers.py'
608--- lib/canonical/testing/ftests/test_layers.py 2009-06-25 05:30:52 +0000
609+++ lib/canonical/testing/ftests/test_layers.py 2009-09-18 18:04:16 +0000
610@@ -343,7 +343,7 @@
611 mainsite = LayerProcessController.appserver_config.vhost.mainsite
612 home_page = urlopen(mainsite.rooturl).read()
613 self.failUnless(
614- 'What is Launchpad?' in home_page,
615+ 'Is your project registered yet?' in home_page,
616 "Home page couldn't be retrieved:\n%s" % home_page)
617
618 def testSMTPServerIsAvailable(self):
619
620=== modified file 'lib/lp/registry/browser/root.py'
621--- lib/lp/registry/browser/root.py 2009-09-16 08:08:56 +0000
622+++ lib/lp/registry/browser/root.py 2009-09-18 18:04:16 +0000
623@@ -18,11 +18,14 @@
624 from zope.schema.interfaces import TooLong
625 from zope.schema.vocabulary import getVocabularyRegistry
626
627+
628 from canonical.config import config
629 from canonical.cachedproperty import cachedproperty
630 from lp.registry.browser.announcement import HasAnnouncementsView
631 from canonical.launchpad.interfaces.launchpadstatistic import (
632 ILaunchpadStatisticSet)
633+from canonical.launchpad.utilities.celebrities import ILaunchpadCelebrities
634+from canonical.launchpad.webapp.publisher import canonical_url
635 from lp.code.interfaces.branchcollection import IAllBranches
636 from lp.bugs.interfaces.bug import IBugSet
637 from canonical.launchpad.interfaces.launchpad import ILaunchpadSearch
638@@ -52,7 +55,9 @@
639
640 # The homepage has two columns to hold featured projects. This
641 # determines the number of projects we display in each column.
642- FEATURED_PROJECT_ROWS = 10
643+ FEATURED_PROJECT_ROWS = 5
644+ MAX_FEATURED_PROJECTS = FEATURED_PROJECT_ROWS*2+1
645+ MAX_SUMMARY_LENGTH = 200
646
647 def canRedirect(self):
648 """Return True if the beta server is available to the user."""
649@@ -60,20 +65,69 @@
650 config.launchpad.beta_testers_redirection_host is not None and
651 self.isBetaUser)
652
653+ @property
654+ def is_logged_in(self):
655+ return self.user is not None
656+
657+ @cachedproperty
658+ def apphomes(self):
659+ return {
660+ 'answers': canonical_url(self.context, rootsite='answers'),
661+ 'blueprints': canonical_url(self.context, rootsite='blueprints'),
662+ 'bugs': canonical_url(self.context, rootsite='bugs'),
663+ 'code': canonical_url(self.context, rootsite='code'),
664+ 'translations': canonical_url(self.context,
665+ rootsite='translations'),
666+ 'ubuntu': canonical_url(
667+ getUtility(ILaunchpadCelebrities).ubuntu),
668+ }
669+
670 @cachedproperty
671 def featured_projects(self):
672 """Return a list of featured projects."""
673 return getUtility(IPillarNameSet).featured_projects
674
675 @property
676+ def featured_projects_top(self):
677+ """Return the topmost featured project."""
678+ return self.featured_projects[0]
679+
680+ @property
681+ def featured_projects_top_summary(self):
682+ """Return the summary of the topmost featured project.
683+
684+ If the summary is too long (MAX_SUMMARY_LENGTH) it is truncated and
685+ a horizontal ellipsis is appended.
686+ """
687+ summary = self.featured_projects_top.summary
688+ if len(summary) > self.MAX_SUMMARY_LENGTH:
689+ return summary[:self.MAX_SUMMARY_LENGTH]+"&hellip;"
690+ else:
691+ return summary
692+
693+ @property
694 def featured_projects_col_a(self):
695 """Return a list of featured projects."""
696- return self.featured_projects[:self.FEATURED_PROJECT_ROWS]
697+ return self.featured_projects[1:self.FEATURED_PROJECT_ROWS+1]
698
699 @property
700 def featured_projects_col_b(self):
701 """The list of featured projects."""
702- return self.featured_projects[self.FEATURED_PROJECT_ROWS:]
703+ index_from = self.FEATURED_PROJECT_ROWS+1
704+ index_to = self.MAX_FEATURED_PROJECTS
705+ return self.featured_projects[index_from:index_to]
706+
707+ @property
708+ def project_count_not_featured(self):
709+ """The number of not-featured projects.
710+
711+ The total number of projects minus the number of displayed
712+ featured projects.
713+ """
714+ project_count_featured = len(self.featured_projects)
715+ if project_count_featured > self.MAX_FEATURED_PROJECTS:
716+ project_count_featured = self.MAX_FEATURED_PROJECTS
717+ return self.project_count - project_count_featured
718
719 @property
720 def branch_count(self):
721
722=== modified file 'lib/lp/registry/stories/launchpad-root/xx-featuredprojects.txt'
723--- lib/lp/registry/stories/launchpad-root/xx-featuredprojects.txt 2009-04-17 10:32:16 +0000
724+++ lib/lp/registry/stories/launchpad-root/xx-featuredprojects.txt 2009-09-18 18:04:16 +0000
725@@ -12,7 +12,7 @@
726 Featured projects are visible to everyone on the home page:
727
728 >>> anon_browser.open('http://launchpad.dev/')
729- >>> featured = find_tag_by_id(anon_browser.contents, 'featured-projects')
730+ >>> featured = find_tag_by_id(anon_browser.contents, 'homepage-featured')
731 >>> print extract_text(featured.h2)
732 Featured projects
733
734@@ -29,7 +29,7 @@
735 the Mozilla Project
736 Mozilla Thunderbird
737 Ubuntu
738-
739+ Browse all ... projects
740
741 == Adding a featured project ==
742
743@@ -69,7 +69,7 @@
744 >>> admin_browser.getControl('Update').click()
745 >>> admin_browser.url
746 'http://launchpad.dev/'
747- >>> featured = find_tag_by_id(admin_browser.contents, 'featured-projects')
748+ >>> featured = find_tag_by_id(admin_browser.contents, 'homepage-featured')
749 >>> 'Apache' in extract_text(featured)
750 True
751
752@@ -77,7 +77,7 @@
753 that Apache has been added:
754
755 >>> anon_browser.open('http://launchpad.dev/')
756- >>> featured = find_tag_by_id(anon_browser.contents, 'featured-projects')
757+ >>> featured = find_tag_by_id(anon_browser.contents, 'homepage-featured')
758 >>> for link in featured.findAll('a'):
759 ... print extract_text(link)
760 Apache
761@@ -90,6 +90,7 @@
762 the Mozilla Project
763 Mozilla Thunderbird
764 Ubuntu
765+ Browse all ... projects
766
767
768 == Removing a project ==
769@@ -99,7 +100,7 @@
770 >>> admin_browser.getControl('Update').click()
771 >>> admin_browser.url
772 'http://launchpad.dev/'
773- >>> featured = find_tag_by_id(admin_browser.contents, 'featured-projects')
774+ >>> featured = find_tag_by_id(admin_browser.contents, 'homepage-featured')
775 >>> 'Apache' in extract_text(featured)
776 False
777
778@@ -107,7 +108,7 @@
779 that Apache has been removed:
780
781 >>> anon_browser.open('http://launchpad.dev/')
782- >>> featured = find_tag_by_id(anon_browser.contents, 'featured-projects')
783+ >>> featured = find_tag_by_id(anon_browser.contents, 'homepage-featured')
784 >>> for link in featured.findAll('a'):
785 ... print extract_text(link)
786 Gnome Applets
787@@ -119,5 +120,6 @@
788 the Mozilla Project
789 Mozilla Thunderbird
790 Ubuntu
791+ Browse all ... projects
792
793