Merge lp:~edwin-grubbs/launchpad/bug-426899-ppa-links into lp:launchpad

Proposed by Edwin Grubbs
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~edwin-grubbs/launchpad/bug-426899-ppa-links
Merge into: lp:launchpad
Diff against target: 207 lines
5 files modified
lib/lp/registry/browser/person.py (+11/-10)
lib/lp/registry/templates/person-index.pt (+9/-14)
lib/lp/registry/templates/person-related-software-navlinks.pt (+20/-11)
lib/lp/registry/templates/team-index.pt (+11/-12)
lib/lp/soyuz/stories/soyuz/xx-person-packages.txt (+8/-8)
To merge this branch: bzr merge lp:~edwin-grubbs/launchpad/bug-426899-ppa-links
Reviewer Review Type Date Requested Status
Paul Hummer (community) ui Approve
Curtis Hovey (community) ui Approve
Eleanor Berger (community) code Approve
Michael Nelson ui Pending
Review via email: mp+13505@code.launchpad.net

Commit message

Made the links to software and packages related to a person clearer and hid links when the page is empty.

To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Summary
-------

Instead of having multiple links for "Related projects", "PPA Packages", and
"Uploaded packages" on the person/team index page, there is now one "Related
software and packages" link that takes you to the +related-software page where
you can navigate to all the other pages.

The links on the +related-software page are now only displayed when there
are entries for "Uploaded packages", etc.

Tests
-----

./bin/test -vv -t xx-person-packages.txt

Demo and Q/A
------------

* Open http://launchpad.dev/~mark
    * Should have a "Related software and packages" link underneath the branding.
* Open http://launchpad.dev/~mark/+related-software
    * There should be five links at the top of this page, and the link for
      the page you are on should be delinkified to show which page you are on.
        * Related software
        * Maintained packages
        * Uploaded packages
        * PPA packages
        * Related projects
* Open http://launchpad.dev/~guadamen/
    * Should have a "Related software and packages" link underneath the branding.
* Open http://launchpad.dev/~guadamen/+related-software
    * Should just show the "Related software" link which is delinkified (plain
      text) since guadamen doesn't have any packages.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

Nice branch, everything looks good to me. Don't forget to close bug #426900 if it is no longer relevant.

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

Here are some screenshots for the UI review.

The person page with the "Related software and packages" link. The team index page will look the same, although there won't be an "Authorized applications" link nearby.
  https://chinstrap.canonical.com/~egrubbs/person_index_page.png

The +related-software page with four links to the right of "Related software", which is not a link to indicate that you are on that page.
  https://chinstrap.canonical.com/~egrubbs/person_related_software_page.png

A team with no links to the right of "Related software" since it has none.
  https://chinstrap.canonical.com/~egrubbs/team_with_no_related_software.png

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

Hi Edwin.

Thanks for making these screencaps.
    * I like the profile page change.
    * I really think that the link to "PPA packages related to Curtis Hovey" should be
      (i) Related PPA packages
      Because the link implies my PPA when the page title says it is about packages in related PPAs.
    * I am pleased that we are not making links to useless pages.

review: Approve (ui)
Revision history for this message
Paul Hummer (rockstar) wrote :

Looks good.

review: Approve (ui)

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-10-13 14:25:20 +0000
3+++ lib/lp/registry/browser/person.py 2009-10-20 02:28:14 +0000
4@@ -842,7 +842,7 @@
5
6 def related_software_summary(self):
7 target = '+related-software'
8- text = 'Summary'
9+ text = 'Related software'
10 return Link(target, text, icon='info')
11
12 def maintained(self):
13@@ -854,21 +854,21 @@
14 def uploaded(self):
15 target = '+uploaded-packages'
16 text = 'Uploaded packages'
17- return Link(target, text, icon='info')
18+ enabled = bool(
19+ self.person.getLatestUploadedButNotMaintainedPackages())
20+ return Link(target, text, enabled=enabled, icon='info')
21
22 def ppa(self):
23- # XXX: salgado, 2009-09-09, bug=426899: Need to conditionally disable
24- # this link.
25 target = '+ppa-packages'
26- text = 'PPA packages'
27- return Link(target, text, icon='info')
28+ text = 'Related PPA packages'
29+ enabled = bool(self.person.getLatestUploadedPPAPackages())
30+ return Link(target, text, enabled=enabled, icon='info')
31
32 def projects(self):
33- # XXX: salgado, 2009-09-09, bug=426900: Need to conditionally disable
34- # this link.
35 target = '+related-projects'
36 text = 'Related projects'
37- return Link(target, text, icon='info')
38+ enabled = bool(self.person.getOwnedOrDrivenPillars())
39+ return Link(target, text, enabled=enabled, icon='info')
40
41
42 class PersonMenuMixin(CommonMenuLinks):
43@@ -1253,7 +1253,8 @@
44 'editemail', 'configure_mailing_list', 'moderate_mailing_list',
45 'editlanguages', 'map', 'polls',
46 'add_poll', 'join', 'leave', 'add_my_teams',
47- 'reassign', 'projects', 'activate_ppa', 'maintained', 'ppa']
48+ 'reassign', 'projects', 'activate_ppa', 'maintained', 'ppa',
49+ 'related_software_summary']
50
51
52 class TeamOverviewNavigationMenu(NavigationMenu, TeamMenuMixin):
53
54=== modified file 'lib/lp/registry/templates/person-index.pt'
55--- lib/lp/registry/templates/person-index.pt 2009-09-18 21:25:39 +0000
56+++ lib/lp/registry/templates/person-index.pt 2009-10-20 02:28:14 +0000
57@@ -88,22 +88,17 @@
58 tal:content="structure context/homepage_content/fmt:text-to-html"
59 />
60 <ul class="horizontal">
61+ <tal:comment condition="nothing">
62+ This link name is different from the menu, since it refers
63+ to several pages that are all accessible when you click on this link.
64+ </tal:comment>
65 <li
66 tal:define="link context/menu:overview/related_software_summary"
67- tal:condition="link/enabled"
68- tal:content="structure link/fmt:link" />
69- <li
70- tal:define="link context/menu:overview/projects"
71- tal:condition="link/enabled"
72- tal:content="structure link/fmt:link" />
73- <li
74- tal:define="link context/menu:overview/maintained"
75- tal:condition="link/enabled"
76- tal:content="structure link/fmt:link" />
77- <li
78- tal:define="link context/menu:overview/ppa"
79- tal:condition="link/enabled"
80- tal:content="structure link/fmt:link" />
81+ tal:condition="link/enabled">
82+ <a class="sprite info" tal:attributes="href link/fmt:url">
83+ Related software and packages
84+ </a>
85+ </li>
86 <li
87 tal:define="link context/menu:overview/oauth_tokens"
88 tal:condition="link/enabled"
89
90=== modified file 'lib/lp/registry/templates/person-related-software-navlinks.pt'
91--- lib/lp/registry/templates/person-related-software-navlinks.pt 2009-09-09 18:50:13 +0000
92+++ lib/lp/registry/templates/person-related-software-navlinks.pt 2009-10-20 02:28:14 +0000
93@@ -5,17 +5,26 @@
94 omit-tag="">
95
96 <ul id="navlinks" class="horizontal">
97- <li>
98- <a tal:replace="structure
99- view/menu:navigation/related_software_summary/render"/></li>
100- <li>
101- <a tal:replace="structure view/menu:navigation/maintained/render"/></li>
102- <li>
103- <a tal:replace="structure view/menu:navigation/uploaded/render"/></li>
104- <li>
105- <a tal:replace="structure view/menu:navigation/ppa/render"/></li>
106- <li>
107- <a tal:replace="structure view/menu:navigation/projects/render"/></li>
108+ <li
109+ tal:define="link view/menu:navigation/related_software_summary"
110+ tal:condition="link/enabled"
111+ tal:content="structure link/fmt:link" />
112+ <li
113+ tal:define="link view/menu:navigation/maintained"
114+ tal:condition="link/enabled"
115+ tal:content="structure link/fmt:link" />
116+ <li
117+ tal:define="link view/menu:navigation/uploaded"
118+ tal:condition="link/enabled"
119+ tal:content="structure link/fmt:link" />
120+ <li
121+ tal:define="link view/menu:navigation/ppa"
122+ tal:condition="link/enabled"
123+ tal:content="structure link/fmt:link" />
124+ <li
125+ tal:define="link view/menu:navigation/projects"
126+ tal:condition="link/enabled"
127+ tal:content="structure link/fmt:link" />
128 </ul>
129
130 </tal:root>
131
132=== modified file 'lib/lp/registry/templates/team-index.pt'
133--- lib/lp/registry/templates/team-index.pt 2009-09-18 21:25:39 +0000
134+++ lib/lp/registry/templates/team-index.pt 2009-10-20 02:28:14 +0000
135@@ -59,18 +59,17 @@
136 tal:content="structure context/teamdescription/fmt:text-to-html"
137 />
138 <ul class="horizontal">
139- <li
140- tal:define="link context/menu:overview/projects"
141- tal:condition="link/enabled"
142- tal:content="structure link/fmt:link" />
143- <li
144- tal:define="link context/menu:overview/maintained"
145- tal:condition="link/enabled"
146- tal:content="structure link/fmt:link" />
147- <li
148- tal:define="link context/menu:overview/ppa"
149- tal:condition="link/enabled"
150- tal:content="structure link/fmt:link" />
151+ <tal:comment condition="nothing">
152+ This link name is different from the menu, since it refers
153+ to several pages that are all accessible when you click on this link.
154+ </tal:comment>
155+ <li
156+ tal:define="link context/menu:overview/related_software_summary"
157+ tal:condition="link/enabled">
158+ <a class="sprite info" tal:attributes="href link/fmt:url">
159+ Related software and packages
160+ </a>
161+ </li>
162 </ul>
163
164 <div class="yui-g">
165
166=== modified file 'lib/lp/soyuz/stories/soyuz/xx-person-packages.txt'
167--- lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2009-09-18 15:42:19 +0000
168+++ lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2009-10-20 02:28:14 +0000
169@@ -4,9 +4,9 @@
170 that person's +related-software page, which is linked to from the
171 person's home page.
172
173- >>> browser.open("http://launchpad.dev/~name16/+related-software")
174+ >>> browser.open("http://launchpad.dev/~mark/+related-software")
175 >>> print browser.title
176- Software related to Foo Bar...
177+ Software related to Mark Shuttleworth...
178
179 This page is just a summary of the user's packages and will only
180 display up to the most recent 30 items in each category. However, it
181@@ -14,20 +14,20 @@
182 where all items can be perused.
183
184 >>> print extract_text(find_tag_by_id(browser.contents, 'navlinks'))
185- Summary
186+ Related software
187 Maintained packages
188 Uploaded packages
189- PPA packages
190+ Related PPA packages
191 Related projects
192
193 >>> print browser.getLink("Maintained packages").url
194- http://launchpad.dev/~name16/+maintained-packages
195+ http://launchpad.dev/~mark/+maintained-packages
196 >>> print browser.getLink("Uploaded packages").url
197- http://launchpad.dev/~name16/+uploaded-packages
198+ http://launchpad.dev/~mark/+uploaded-packages
199 >>> print browser.getLink("PPA packages").url
200- http://launchpad.dev/~name16/+ppa-packages
201+ http://launchpad.dev/~mark/+ppa-packages
202 >>> print browser.getLink("Related projects").url
203- http://launchpad.dev/~name16/+related-projects
204+ http://launchpad.dev/~mark/+related-projects
205
206 Each category on the summary page has a heading that shows how many
207 packages are being displayed.