Merge lp:~thumper/launchpad/branch-visibility-fubar into lp:launchpad

Proposed by Tim Penhey
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: not available
Merged at revision: 9904
Proposed branch: lp:~thumper/launchpad/branch-visibility-fubar
Merge into: lp:launchpad
Diff against target: 73 lines (+41/-3)
2 files modified
lib/lp/registry/stories/product/xx-product-development-focus.txt (+37/-0)
lib/lp/registry/templates/product-index.pt (+4/-3)
To merge this branch: bzr merge lp:~thumper/launchpad/branch-visibility-fubar
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+14982@code.launchpad.net

Commit message

Check that the user can see the branch on the project overview page.

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

When I added the branch link on the front page for projects, I forgot to make sure that the user can see the branch.

This branch fixes that problem.

Tests:
  xx-product-development-focus

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks fine. Nice to get this fixed quickly :)

review: Approve

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 2009-11-11 01:11:04 +0000
3+++ lib/lp/registry/stories/product/xx-product-development-focus.txt 2009-11-18 06:30:32 +0000
4@@ -120,3 +120,40 @@
5 (http://launchpad.dev/fooix/trunk/+linkbranch)
6 View the branch content
7 (http://bazaar.launchpad.dev/~eric/fooix/trunk/files)
8+
9+
10+Private development focus branches
11+----------------------------------
12+
13+If the development focus branch is private, then for unauthorized viewers, it
14+appears as if there is no series branch set.
15+
16+ >>> login('admin@canonical.com')
17+ >>> from zope.security.proxy import removeSecurityProxy
18+ >>> removeSecurityProxy(branch).private = True
19+ >>> logout()
20+
21+ >>> anon_browser.open('http://launchpad.dev/fooix')
22+ >>> print_development_focus(anon_browser)
23+ Development focus:
24+ trunk series
25+ Development focus branch has not been specified
26+ Links:
27+ trunk series (/fooix/trunk)
28+
29+ >>> owner_browser.open('http://launchpad.dev/fooix')
30+ >>> print_development_focus(owner_browser)
31+ Development focus:
32+ trunk series Change details
33+ lp://dev/~eric/fooix/trunk Change branch
34+ View the branch content
35+ Links:
36+ trunk series (/fooix/trunk)
37+ <span class="invisible-link">Change details</span>
38+ (http://launchpad.dev/fooix/+edit)
39+ lp://dev/~eric/fooix/trunk (http://code.launchpad.dev/~eric/fooix/trunk)
40+ <span class="invisible-link">Change branch</span>
41+ Change the branch for this series
42+ (http://launchpad.dev/fooix/trunk/+linkbranch)
43+ View the branch content
44+ (https://bazaar.launchpad.dev/~eric/fooix/trunk/files)
45
46=== modified file 'lib/lp/registry/templates/product-index.pt'
47--- lib/lp/registry/templates/product-index.pt 2009-11-11 01:01:55 +0000
48+++ lib/lp/registry/templates/product-index.pt 2009-11-18 06:30:32 +0000
49@@ -102,20 +102,21 @@
50
51 <dl id="dev-focus"
52 tal:define="dev_focus context/development_focus;
53- trunk dev_focus/branch">
54+ trunk dev_focus/branch;
55+ trunk_visible trunk/required:launchpad.View|nothing">
56 <dt>Development focus:</dt>
57 <dd>
58 <p>
59 <a tal:attributes="href dev_focus/fmt:url"
60 tal:content="string:${dev_focus/name} series" />&nbsp;
61 <a tal:replace="structure overview_menu/edit/fmt:icon" /></p>
62- <p tal:condition="trunk">
63+ <p tal:condition="trunk_visible">
64 <a tal:replace="structure trunk/fmt:link" />&nbsp;
65 <a tal:replace="structure dev_focus/menu:overview/link_branch/fmt:icon" />
66 <br/>
67 <a tal:replace="structure trunk/menu:context/source/fmt:link"/>
68 </p>
69- <p tal:condition="not: trunk">
70+ <p tal:condition="not: trunk_visible">
71 Development focus branch has not been specified
72 <a tal:replace="structure dev_focus/menu:overview/link_branch/fmt:icon" />
73 </p>