Merge lp:~jcsackett/launchpad/broken-help-link into lp:launchpad

Proposed by j.c.sackett
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 11358
Proposed branch: lp:~jcsackett/launchpad/broken-help-link
Merge into: lp:launchpad
Diff against target: 29 lines (+6/-2)
2 files modified
lib/lp/code/stories/branches/xx-product-branches.txt (+3/-0)
lib/lp/code/templates/product-branch-summary.pt (+3/-2)
To merge this branch: bzr merge lp:~jcsackett/launchpad/broken-help-link
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+32603@code.launchpad.net

Commit message

Changes a download link on the template to point to the correct page on http://launchpad.net instead of code.launchpad.net. Previously the help link was broken b/c the initial download file link was on the wrong host.

Description of the change

Summary

Fixes a broken help link by buildling a correct link for +download on a product.

Proposed fix

We thought it might be possible to use the menu to create a link to the right page on the right host, but the menu doesn't behave as expected; instead we looked into using a better hand crafted url.

Pre-implementation notes

Spoke with Curtis Hovey (sinzui) to investigate the use of a menu for the link, where we discovered that the menu didn't behave as expected with respect to rootsite definitions.

Implementation details

A link on the product-branch-summary template was updated to point to +download on the mainsite instead of on code. This page is the same page, but as a result the broken help link renders correctly.

Demo and Q/A

Go to http://code.launchpad.dev/firefox and follow the link for downloads. You should end up on http://launchpad.dev/firefox/+download, not http://code.launchpad.dev/firefox/+dev. The help link referenced in the bug should now work.

lint
= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/code/stories/branches/xx-product-branches.txt
  lib/lp/code/templates/product-branch-summary.pt

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

This looks good to land

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

Wow, thanks for fixing this so quickly!

I am surprised, though, that so much has to be done in TAL to achieve this. This looks like a fairly common task (switch to a different vhost) that I'd hope we have short cuts for it. Is there a bug for this or should I file one?

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

On Tue, 2010-08-17 at 08:36 +0000, Henning Eggers wrote:
> Wow, thanks for fixing this so quickly!
>
> I am surprised, though, that so much has to be done in TAL to achieve
> this. This looks like a fairly common task (switch to a different
> vhost) that I'd hope we have short cuts for it. Is there a bug for
> this or should I file one?

1. the official link in the overview menu did not work because stupid
menus always make links for the host they are one. This seems to
contradict the intent of putting a menu on a facet. eg:
object/menu:overview/downloads

2. The tales fmt/link:mainsite did not work because the menu
pregenerated the URL eg:
object/menu:overview/downloads/fmt:link:mainsite

I am sending a email about this and other menu problems later today.

--
__Curtis C. Hovey_________
http://launchpad.net/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/stories/branches/xx-product-branches.txt'
2--- lib/lp/code/stories/branches/xx-product-branches.txt 2010-06-28 14:00:17 +0000
3+++ lib/lp/code/stories/branches/xx-product-branches.txt 2010-08-16 16:58:46 +0000
4@@ -66,6 +66,9 @@
5 There are no branches for NetApplet in Launchpad.
6 ...
7 There are download files available for NetApplet.
8+ >>> browser.getLink('download files')
9+ <Link...url='http://launchpad.dev/netapplet/+download'>
10+
11
12
13 Development focus branches
14
15=== modified file 'lib/lp/code/templates/product-branch-summary.pt'
16--- lib/lp/code/templates/product-branch-summary.pt 2010-06-25 17:40:07 +0000
17+++ lib/lp/code/templates/product-branch-summary.pt 2010-08-16 16:58:46 +0000
18@@ -60,9 +60,10 @@
19 </div>
20
21 </tal:has-branches>
22-
23 <p tal:condition="view/latest_release_with_download_files">
24- <img src="/@@/download"/> There are <a href="+download">download files</a>
25+ <img src="/@@/download"/> There are
26+ <a tal:define="rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl"
27+ tal:attributes="href string:${rooturl}${context/name}/+download">download files</a>
28 available for <tal:project-name replace="context/displayname"/>.
29 </p>
30