Merge lp:~sinzui/launchpad/happy-links into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/happy-links
Merge into: lp:launchpad
Diff against target: 249 lines
10 files modified
lib/lp/registry/browser/product.py (+5/-0)
lib/lp/registry/stories/distribution/xx-distribution-packages.txt (+6/-1)
lib/lp/registry/stories/milestone/object-milestones.txt (+9/-1)
lib/lp/registry/stories/product/xx-product-index.txt (+14/-2)
lib/lp/registry/stories/productseries/xx-productseries-index.txt (+3/-3)
lib/lp/registry/templates/distributionsourcepackage-index.pt (+10/-2)
lib/lp/registry/templates/milestone-index.pt (+14/-5)
lib/lp/registry/templates/object-milestones.pt (+9/-0)
lib/lp/registry/templates/product-index.pt (+5/-3)
lib/lp/registry/templates/productseries-index.pt (+3/-3)
To merge this branch: bzr merge lp:~sinzui/launchpad/happy-links
Reviewer Review Type Date Requested Status
Martin Albisetti (community) ui Approve
Aaron Bentley (community) code Approve
Review via email: mp+14226@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (4.2 KiB)

This is my branch to link many pages together. It adds missing links to
pages and replace hand crafted links with menu links.

    lp:~sinzui/launchpad/happy-links
    Diff size: 250
    Launchpad bug: https://bugs.launchpad.net/bugs/happy-links
    Test command: ./bin/test -vv -t "reg.*stories/(product|distribution|milestone)"
    Pre-implementation: no one
    Target release: 3.1.10

= Link many pages together =

Bug 31319 [Association between source package and product is not discover...]
    The DSP should has a link from the upstream portlet to the project when
    the DSP knows about the relationship.

Bug 449607 [No way to navigate to milestones for project groups]
    The +milestones link from the project group index was obscured when
    this bug was filed. It is more prominent now that we removed the
    unneeded links to individual milestones.

    There is still a problem though, project milestones should link to
    project group +milestones. The project +milestones page should link to
    the project group +milestones page.

== Rules ==

Bug 31319 [Association between source package and product is not discover...]
    Link both the icon. Consider adding the launchpad project name and link.

Bug 449607 [No way to navigate to milestones for project groups]
     * Add links to the project group +milestones page from the product
       milestone and the product +milestones.
     * Update the links to use the 3.0 convention of 'View <page>'
     * ADDENDUM: The Product index is missing its link to +milestones. It
       was lost when we added the series and milestone timeline.
     * ADDENDUM: The product overview menu is missing a +milestones link
     * ADDENDUM: Update all the related milestone/series pages to use menu
       links.

== QA ==

Bug 31319 [Association between source package and product is not discover...]
    * Visit https://edge.launchpad.net/ubuntu/+source/firefox
    * Verify the firefox icon and name are linked.

Bug 449607 [No way to navigate to milestones for project groups]
    * Visit launchpad-registry
    * Verify it has a link to +milestones in the Series portlet
    * Follow the link
    * Verify there is a link the the Launchpad Suite's +milestones.
    * Visit the 3.1.10 milestone.
    * Verify there is a link the the Launchpad Suite's +milestones.

== Lint ==

Linting changed files:
  lib/lp/registry/browser/product.py
  lib/lp/registry/stories/distribution/xx-distribution-packages.txt
  lib/lp/registry/stories/milestone/object-milestones.txt
  lib/lp/registry/stories/product/xx-product-index.txt
  lib/lp/registry/stories/productseries/xx-productseries-index.txt
  lib/lp/registry/templates/distributionsourcepackage-index.pt
  lib/lp/registry/templates/milestone-index.pt
  lib/lp/registry/templates/object-milestones.pt
  lib/lp/registry/templates/product-index.pt
  lib/lp/registry/templates/productseries-index.pt

== Test ==

    * lib/lp/registry/stories/distribution/xx-distribution-packages.txt
      * Updated the upstream test to verify that the product is linked.
    * lib/lp/registry/stories/milestone/object-milestones.txt
      * Added a test to verify a link from the project's +milest...

Read more...

Revision history for this message
Aaron Bentley (abentley) wrote :

The code changes look fine. I think you'll also need a UI review.

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

Hi Martin.

I added a links to the DSP upstream portlet to the launchpad project. I linked the icon, and added the project display name and linked it to.
    http://people.canonical.com/~curtis/dsp-link-to-project.png
with
    https://edge.launchpad.net/ubuntu/+source/mozilla-firefox
Notice you can see the icon, but we do not give the launchpad project name or link to it.

Revision history for this message
Martin Albisetti (beuno) wrote :

You rock.

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/product.py'
2--- lib/lp/registry/browser/product.py 2009-10-26 19:09:39 +0000
3+++ lib/lp/registry/browser/product.py 2009-10-30 16:15:25 +0000
4@@ -371,6 +371,7 @@
5 'packages',
6 'series',
7 'series_add',
8+ 'milestones',
9 'downloads',
10 'announce',
11 'announcements',
12@@ -402,6 +403,10 @@
13 text = 'Register a series'
14 return Link('+addseries', text, icon='add')
15
16+ def milestones(self):
17+ text = 'View milestones'
18+ return Link('+milestones', text, icon='info')
19+
20 @enabled_with_permission('launchpad.Edit')
21 def announce(self):
22 text = 'Make announcement'
23
24=== modified file 'lib/lp/registry/stories/distribution/xx-distribution-packages.txt'
25--- lib/lp/registry/stories/distribution/xx-distribution-packages.txt 2009-09-23 14:58:12 +0000
26+++ lib/lp/registry/stories/distribution/xx-distribution-packages.txt 2009-10-30 16:15:25 +0000
27@@ -287,13 +287,18 @@
28 ... name='field.productseries').value = "firefox/trunk"
29 >>> user_browser.getControl('Change').click()
30
31-Go back to the source page, and now the upstream's description is shown.
32+Go back to the source page, and now the upstream's description is shown and
33+linked.
34
35 >>> user_browser.open("http://launchpad.dev/ubuntu/+source/iceweasel/")
36 >>> print extract_text(find_tag_by_id(user_browser.contents, 'upstream'))
37 Upstream
38+ Mozilla Firefox
39 The Mozilla Firefox web browser
40
41+ >>> user_browser.getLink('Mozilla Firefox')
42+ <Link text='Mozilla Firefox' url='http://launchpad.dev/firefox'>
43+
44
45 Distribution source packages side-bar
46 -------------------------------------
47
48=== modified file 'lib/lp/registry/stories/milestone/object-milestones.txt'
49--- lib/lp/registry/stories/milestone/object-milestones.txt 2009-09-23 11:10:00 +0000
50+++ lib/lp/registry/stories/milestone/object-milestones.txt 2009-10-30 16:15:25 +0000
51@@ -71,6 +71,14 @@
52 Mozilla Firefox 1.0 trunk 2056-10-16
53 not yet released
54
55+When the project is a member of a project group, the the user can see a link
56+to the project groups's milestone's page.
57+
58+ >>> anon_browser.getLink(
59+ ... 'View milestones for the Mozilla Project').click()
60+ >>> print anon_browser.title
61+ Milestones : the Mozilla Project
62+
63
64 === Product Series ===
65
66@@ -235,7 +243,7 @@
67 Observe that both bugs are listed in the 1.0 milestone listing:
68
69 >>> browser.open('http://launchpad.dev/firefox/trunk')
70- >>> browser.getLink('All milestones').click()
71+ >>> browser.getLink('View milestones').click()
72 >>> browser.getLink("Mozilla Firefox 1.0", index=1).click()
73 >>> print browser.title
74 Mozilla Firefox 1.0
75
76=== modified file 'lib/lp/registry/stories/product/xx-product-index.txt'
77--- lib/lp/registry/stories/product/xx-product-index.txt 2009-09-12 06:27:54 +0000
78+++ lib/lp/registry/stories/product/xx-product-index.txt 2009-10-30 16:15:25 +0000
79@@ -315,8 +315,8 @@
80 Commercial subscription expires ...
81
82
83-Focus of development
84---------------------
85+Development
86+-----------
87
88 The project page shows the series that is the focus of development.
89
90@@ -325,6 +325,18 @@
91 ... find_tag_by_id(anon_browser.contents, 'development-focus'))
92 Mozilla Firefox trunk series is the current focus of development
93
94+The page has a link to view the project's milestones.
95+
96+ >>> anon_browser.getLink('View milestones')
97+ <Link ... url='http://launchpad.dev/firefox/+milestones'>
98+
99+Project owners and driver can see a link to register series.
100+
101+ >>> owner_browser = setupBrowser(auth="Basic test@canonical.com:test")
102+ >>> owner_browser.open('http://launchpad.dev/firefox')
103+ >>> owner_browser.getLink('Register a series')
104+ <Link ... url='http://launchpad.dev/firefox/+addseries'>
105+
106
107 Aliases
108 -------
109
110=== modified file 'lib/lp/registry/stories/productseries/xx-productseries-index.txt'
111--- lib/lp/registry/stories/productseries/xx-productseries-index.txt 2009-10-20 16:45:02 +0000
112+++ lib/lp/registry/stories/productseries/xx-productseries-index.txt 2009-10-30 16:15:25 +0000
113@@ -140,9 +140,9 @@
114
115 There is a section that lists related links to this series
116
117- >>> anon_browser.getLink('All series for the Mozilla Firefox project')
118+ >>> anon_browser.getLink('View series for the Mozilla Firefox project')
119 <Link ... url='http://launchpad.dev/firefox/+series'>
120- >>> anon_browser.getLink('All milestones for the Mozilla Firefox project')
121+ >>> anon_browser.getLink('View milestones for the Mozilla Firefox project')
122 <Link ... url='http://launchpad.dev/firefox/+milestones'>
123- >>> anon_browser.getLink('All downloads for the Mozilla Firefox project')
124+ >>> anon_browser.getLink('View downloads for the Mozilla Firefox project')
125 <Link ... url='http://launchpad.dev/firefox/+download'>
126
127=== modified file 'lib/lp/registry/templates/distributionsourcepackage-index.pt'
128--- lib/lp/registry/templates/distributionsourcepackage-index.pt 2009-10-23 12:53:21 +0000
129+++ lib/lp/registry/templates/distributionsourcepackage-index.pt 2009-10-30 16:15:25 +0000
130@@ -116,8 +116,16 @@
131 <tal:project define="project context/upstream_product">
132 <div tal:condition="project">
133 <h2>Upstream</h2>
134- <div style="float:left; padding:0 1em 1em 0;"
135- tal:content="structure project/image:logo"/>
136+ <div style="float:left; padding:0 1em 1em 0;">
137+ <a
138+ tal:attributes="href project/fmt:url"
139+ tal:content="structure project/image:logo" />
140+ </div>
141+ <div>
142+ <a
143+ tal:attributes="href project/fmt:url"
144+ tal:content="project/displayname" />
145+ </div>
146 <div tal:content="structure project/summary" />
147 </div>
148 <tal:noproject condition="not: project">
149
150=== modified file 'lib/lp/registry/templates/milestone-index.pt'
151--- lib/lp/registry/templates/milestone-index.pt 2009-09-17 13:18:54 +0000
152+++ lib/lp/registry/templates/milestone-index.pt 2009-10-30 16:15:25 +0000
153@@ -336,15 +336,24 @@
154
155 <ul>
156 <li>
157- <a tal:attributes="
158- href view/milestone/target/fmt:url/+milestones">All milestones for
159+ <a class="sprite info"
160+ tal:attributes="href view/milestone/target/menu:overview/milestones/fmt:url">View
161+ milestones for
162 <tal:project replace="view/milestone/target/displayname" /></a>
163 </li>
164+ <li tal:condition="view/milestone/target/project|nothing">
165+ <a class="sprite info"
166+ tal:attributes="href view/milestone/target/project/menu:overview/milestones/fmt:url">View
167+ milestones for
168+ <tal:project replace="view/milestone/target/project/displayname" /></a>
169+ </li>
170 <li tal:condition="view/milestone/series_target">
171- <a tal:attributes="
172- href view/milestone/series_target/fmt:url">All releases for the
173+ <a class="sprite info"
174+ tal:attributes="href view/milestone/series_target/fmt:url">View
175+ releases for the
176 <tal:project replace="view/milestone/target/displayname" />
177- <tal:project replace="view/milestone/series_target/displayname" /> series</a>
178+ <tal:project replace="view/milestone/series_target/displayname" />
179+ series</a>
180 </li>
181 </ul>
182 </div>
183
184=== modified file 'lib/lp/registry/templates/object-milestones.pt'
185--- lib/lp/registry/templates/object-milestones.pt 2009-09-15 01:42:42 +0000
186+++ lib/lp/registry/templates/object-milestones.pt 2009-10-30 16:15:25 +0000
187@@ -14,6 +14,15 @@
188 Milestones belong to a series and can be created from the series page
189 by a project owner or series release manager.
190 </p>
191+
192+ <ul class="horizontal"
193+ tal:condition="context/project|nothing">
194+ <li>
195+ <a class="sprite info"
196+ tal:attributes="href context/project/menu:overview/milestones/fmt:url">View milestones for
197+ <tal:project replace="context/project/displayname" /></a>
198+ </li>
199+ </ul>
200 </div>
201
202 <tal:milestones define="milestones context/all_milestones">
203
204=== modified file 'lib/lp/registry/templates/product-index.pt'
205--- lib/lp/registry/templates/product-index.pt 2009-10-08 15:54:09 +0000
206+++ lib/lp/registry/templates/product-index.pt 2009-10-30 16:15:25 +0000
207@@ -161,10 +161,12 @@
208 <a tal:replace="structure overview_menu/edit/fmt:icon" />
209 </p>
210
211- <ul class="horizontal"
212- tal:condition="overview_menu/series_add/enabled">
213+ <ul class="horizontal">
214+ <li tal:condition="overview_menu/series_add/enabled">
215+ <a tal:replace="structure overview_menu/series_add/fmt:link" />
216+ </li>
217 <li>
218- <a tal:replace="structure overview_menu/series_add/fmt:link" />
219+ <a tal:replace="structure overview_menu/milestones/fmt:link" />
220 </li>
221 </ul>
222 </div>
223
224=== modified file 'lib/lp/registry/templates/productseries-index.pt'
225--- lib/lp/registry/templates/productseries-index.pt 2009-10-22 19:16:03 +0000
226+++ lib/lp/registry/templates/productseries-index.pt 2009-10-30 16:15:25 +0000
227@@ -159,19 +159,19 @@
228 <ul id="related-series">
229 <li>
230 <a class="sprite info"
231- tal:attributes="href context/product/fmt:url/+series">All
232+ tal:attributes="href context/product/menu:overview/series/fmt:url">View
233 series for the
234 <tal:project replace="context/product/displayname" /> project</a>
235 </li>
236 <li>
237 <a class="sprite info"
238- tal:attributes="href context/product/fmt:url/+milestones">All
239+ tal:attributes="href context/product/menu:overview/milestones/fmt:url">View
240 milestones for the
241 <tal:project replace="context/product/displayname" /> project</a>
242 </li>
243 <li>
244 <a class="sprite info"
245- tal:attributes="href context/product/fmt:url/+download">All
246+ tal:attributes="href context/product/menu:overview/downloads/fmt:url">View
247 downloads for the
248 <tal:project replace="context/product/displayname" /> project</a>
249 </li>