Merge lp:~flacoste/launchpad/front-page-fix into lp:launchpad
- front-page-fix
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Francis J. Lacoste |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~flacoste/launchpad/front-page-fix |
Merge into: | lp:launchpad |
Diff against target: |
793 lines (+228/-134) 30 files modified
lib/canonical/configure.zcml (+0/-20) lib/canonical/launchpad/security.py (+11/-1) lib/canonical/launchpad/tour/api (+1/-1) lib/canonical/launchpad/tour/branch-hosting-tracking (+1/-1) lib/canonical/launchpad/tour/bugs (+1/-1) lib/canonical/launchpad/tour/community (+1/-1) lib/canonical/launchpad/tour/community-support (+1/-1) lib/canonical/launchpad/tour/feature-tracking (+1/-1) lib/canonical/launchpad/tour/index (+1/-1) lib/canonical/launchpad/tour/join-launchpad (+1/-1) lib/canonical/launchpad/tour/ppa (+1/-1) lib/canonical/launchpad/tour/release-management (+1/-1) lib/canonical/launchpad/tour/translation (+1/-1) lib/canonical/launchpad/zcml/launchpad.zcml (+0/-21) lib/lp/app/browser/configure.zcml (+40/-0) lib/lp/app/browser/root.py (+5/-8) lib/lp/app/browser/tests/launchpad-search-pages.txt (+2/-2) lib/lp/app/browser/tests/root-views.txt (+1/-1) lib/lp/app/browser/tests/test_launchpadroot.py (+80/-0) lib/lp/app/browser/tests/test_views.py (+5/-2) lib/lp/app/stories/basics/copyright.txt (+2/-2) lib/lp/app/stories/basics/xx-beta-testers-redirection.txt (+25/-31) lib/lp/app/stories/launchpad-root/front-pages.txt (+13/-0) lib/lp/app/stories/launchpad-root/xx-featuredprojects.txt (+1/-1) lib/lp/app/templates/base-layout-macros.pt (+2/-2) lib/lp/app/templates/root-index.pt (+1/-18) lib/lp/app/tests/test_doc.py (+17/-0) lib/lp/blueprints/tests/test_doc.py (+1/-2) lib/lp/code/tests/test_doc.py (+2/-3) lib/lp/services/testing/__init__.py (+9/-9) |
To merge this branch: | bzr merge lp:~flacoste/launchpad/front-page-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+17051@code.launchpad.net |
Commit message
Update the copyright in footer. Remove the beta testers box on the front page. Drop the redundant links on the front page in the footer. Allow registry experts to change the featured projects.
Description of the change
Francis J. Lacoste (flacoste) wrote : | # |
Curtis Hovey (sinzui) wrote : | # |
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
...
> + <browser:page
> + for="canonical.
> + class="
> + name="+
> + template=
> + permission=
> + />
I was expecting you to change either the permission or redefine it in
security.py so that registry admins could access this page.
> === added file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -0,0 +1,17 @@
> +# Copyright 2010 Canonical Ltd. This software is licensed under the
> +# GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +"""
> +Run the doctests and pagetests.
> +"""
> +
> +import os
> +
> +from lp.services.testing import build_test_suite
All these tests run on LaunchpadFuncti
want DatabaseFunctio
Francis J. Lacoste (flacoste) wrote : | # |
On January 8, 2010, Curtis Hovey wrote:
> Review: Needs Information code
>
> > === modified file 'lib/lp/
> > --- lib/lp/
> > +++ lib/lp/
>
> ...
>
> > + <browser:page
> > + for="canonical.
> > + class="
> > + name="+
> > + template=
> > + permission=
> > + />
>
> I was expecting you to change either the permission or redefine it in
> security.py so that registry admins could access this page.
That extends the scope of that branch, but why not. Done.
>
> > === added file 'lib/lp/
> > --- lib/lp/
> > +++ lib/lp/
> > @@ -0,0 +1,17 @@
> > +# Copyright 2010 Canonical Ltd. This software is licensed under the
> > +# GNU Affero General Public License version 3 (see the file LICENSE).
> > +
> > +"""
> > +Run the doctests and pagetests.
> > +"""
> > +
> > +import os
> > +
> > +from lp.services.testing import build_test_suite
>
> All these tests run on LaunchpadFuncti
> want DatabaseFunctio
>
Well, since I didn't add a doc subdirectory, it didn't matter. But I changed
the global default since I don't think it's a good idea to have each caller
override the default.
Here are the additional changes:
=== modified file 'lib/canonical/
--- lib/canonical/
+++ lib/canonical/
@@ -110,7 +110,8 @@
ITranslator, IEditTranslator)
from canonical.
-from canonical.
+from canonical.
+ IAuthorization, ILaunchpadRoot)
from lp.answers.
from lp.answers.
@@ -190,6 +191,14 @@
or user.inTeam(
+class EditByRegistryE
+ permission = 'launchpad.Edit'
+ usedfor = ILaunchpadRoot
+
+ def checkAuthentica
+ return is_admin_
+
+
class ReviewByRegistr
permission = 'launchpad.
usedfor = None
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -60,7 +60,7 @@
- permission=
+ permission=
/>
<browser:page
=== added file 'lib/lp/
--- lib/lp/
Curtis Hovey (sinzui) wrote : | # |
Hi Francis.
Thank you for fixing the behaviour of the doc tests. As I said on IRC, you should change the permissions on the link to edit the featured projects since you changed the permission on the view. root-index.pt should use:
<li tal:condition=
Your branch is fine to land with this additional change.
Preview Diff
1 | === modified file 'lib/canonical/configure.zcml' |
2 | --- lib/canonical/configure.zcml 2009-11-17 11:27:51 +0000 |
3 | +++ lib/canonical/configure.zcml 2010-01-13 02:21:17 +0000 |
4 | @@ -71,26 +71,6 @@ |
5 | /> |
6 | |
7 | |
8 | - <!-- This is an index.html view on the root object. |
9 | - The root object is not ever published itself. Only its views are. |
10 | - --> |
11 | - |
12 | - <browser:page |
13 | - for="canonical.launchpad.interfaces.ILaunchpadRoot" |
14 | - class="lp.registry.browser.root.LaunchpadRootIndexView" |
15 | - name="index.html" |
16 | - template="launchpad/templates/root-index.pt" |
17 | - permission="zope.Public" |
18 | - /> |
19 | - |
20 | - <browser:page |
21 | - for="canonical.launchpad.interfaces.ILaunchpadRoot" |
22 | - class="lp.registry.browser.featuredproject.FeaturedProjectsView" |
23 | - name="+featuredprojects" |
24 | - template="launchpad/templates/root-featuredprojects.pt" |
25 | - permission="launchpad.Admin" |
26 | - /> |
27 | - |
28 | <!-- The following directives set up root front pages for the different |
29 | virtual host layers. The directives come in pairs. |
30 | The separate registration for the resources namespace (@@) is needed |
31 | |
32 | === modified file 'lib/canonical/launchpad/security.py' |
33 | --- lib/canonical/launchpad/security.py 2010-01-09 03:31:20 +0000 |
34 | +++ lib/canonical/launchpad/security.py 2010-01-13 02:21:17 +0000 |
35 | @@ -109,7 +109,8 @@ |
36 | ITranslator, IEditTranslator) |
37 | |
38 | from canonical.launchpad.webapp.authorization import check_permission |
39 | -from canonical.launchpad.webapp.interfaces import IAuthorization |
40 | +from canonical.launchpad.webapp.interfaces import ( |
41 | + IAuthorization, ILaunchpadRoot) |
42 | |
43 | from lp.answers.interfaces.faq import IFAQ |
44 | from lp.answers.interfaces.faqtarget import IFAQTarget |
45 | @@ -189,6 +190,15 @@ |
46 | or user.inTeam(celebrities.admin)) |
47 | |
48 | |
49 | +class EditByRegistryExpertsOrAdmins(AuthorizationBase): |
50 | + permission = 'launchpad.Edit' |
51 | + usedfor = ILaunchpadRoot |
52 | + |
53 | + def checkAuthenticated(self, user): |
54 | + user = IPersonRoles(user) |
55 | + return user.in_admin or user.in_registry_experts |
56 | + |
57 | + |
58 | class ReviewByRegistryExpertsOrAdmins(AuthorizationBase): |
59 | permission = 'launchpad.ProjectReview' |
60 | usedfor = None |
61 | |
62 | === modified file 'lib/canonical/launchpad/tour/api' |
63 | --- lib/canonical/launchpad/tour/api 2009-06-12 16:36:02 +0000 |
64 | +++ lib/canonical/launchpad/tour/api 2010-01-13 02:21:17 +0000 |
65 | @@ -131,7 +131,7 @@ |
66 | <a href="feature-tracking" accesskey="g" tabindex="5">Next</a> |
67 | </li> |
68 | <li class="copyright"> |
69 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
70 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
71 | </li> |
72 | </ul> |
73 | </div> |
74 | |
75 | === modified file 'lib/canonical/launchpad/tour/branch-hosting-tracking' |
76 | --- lib/canonical/launchpad/tour/branch-hosting-tracking 2009-09-21 21:31:28 +0000 |
77 | +++ lib/canonical/launchpad/tour/branch-hosting-tracking 2010-01-13 02:21:17 +0000 |
78 | @@ -126,7 +126,7 @@ |
79 | <a href="translation" accesskey="g" tabindex="5" title="Read about software translation in Launchpad">Next</a> |
80 | </li> |
81 | <li class="copyright"> |
82 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
83 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
84 | </li> |
85 | </ul> |
86 | </div> |
87 | |
88 | === modified file 'lib/canonical/launchpad/tour/bugs' |
89 | --- lib/canonical/launchpad/tour/bugs 2009-09-21 21:31:28 +0000 |
90 | +++ lib/canonical/launchpad/tour/bugs 2010-01-13 02:21:17 +0000 |
91 | @@ -132,7 +132,7 @@ |
92 | <a href="branch-hosting-tracking" accesskey="g" tabindex="5" title="Read about code hosting and review in Launchpad">Next</a> |
93 | </li> |
94 | <li class="copyright"> |
95 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="i" tabindex="7">Terms of Use</a> | <a href="https://help.launchpad.net/Feedback" accesskey="j" tabindex="8">Feedback</a> | <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="k" tabindex="9">FAQ</a> |
96 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="i" tabindex="7">Terms of Use</a> | <a href="https://help.launchpad.net/Feedback" accesskey="j" tabindex="8">Feedback</a> | <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="k" tabindex="9">FAQ</a> |
97 | </li> |
98 | </ul> |
99 | </div> |
100 | |
101 | === modified file 'lib/canonical/launchpad/tour/community' |
102 | --- lib/canonical/launchpad/tour/community 2009-09-21 21:31:28 +0000 |
103 | +++ lib/canonical/launchpad/tour/community 2010-01-13 02:21:17 +0000 |
104 | @@ -113,7 +113,7 @@ |
105 | <a href="ppa" accesskey="g" tabindex="5" title="Read about building and distributing Ubuntu packages">Next</a> |
106 | </li> |
107 | <li class="copyright"> |
108 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
109 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
110 | </li> |
111 | </ul> |
112 | </div> |
113 | |
114 | === modified file 'lib/canonical/launchpad/tour/community-support' |
115 | --- lib/canonical/launchpad/tour/community-support 2009-06-12 16:36:02 +0000 |
116 | +++ lib/canonical/launchpad/tour/community-support 2010-01-13 02:21:17 +0000 |
117 | @@ -106,7 +106,7 @@ |
118 | <a href="api" tabindex="5" accesskey="g">Next</a> |
119 | </li> |
120 | <li class="copyright"> |
121 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
122 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
123 | </li> |
124 | </ul> |
125 | </div> |
126 | |
127 | === modified file 'lib/canonical/launchpad/tour/feature-tracking' |
128 | --- lib/canonical/launchpad/tour/feature-tracking 2009-09-21 21:31:28 +0000 |
129 | +++ lib/canonical/launchpad/tour/feature-tracking 2010-01-13 02:21:17 +0000 |
130 | @@ -88,7 +88,7 @@ |
131 | <a href="release-management" accesskey="g" tabindex="5" title="Read about managing software releases">Next</a> |
132 | </li> |
133 | <li class="copyright"> |
134 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
135 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
136 | </li> |
137 | </ul> |
138 | </div> |
139 | |
140 | === modified file 'lib/canonical/launchpad/tour/index' |
141 | --- lib/canonical/launchpad/tour/index 2009-09-21 17:07:26 +0000 |
142 | +++ lib/canonical/launchpad/tour/index 2010-01-13 02:21:17 +0000 |
143 | @@ -174,7 +174,7 @@ |
144 | <a href="bugs" accesskey="l" tabindex="10" title="Read about bug tracking in Launchpad">Next</a> |
145 | </li> |
146 | <li class="copyright"> |
147 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="i" tabindex="7">Terms of Use</a> | <a href="https://help.launchpad.net/Feedback" accesskey="j" tabindex="8">Feedback</a> | <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="k" tabindex="9">FAQ</a> |
148 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="i" tabindex="7">Terms of Use</a> | <a href="https://help.launchpad.net/Feedback" accesskey="j" tabindex="8">Feedback</a> | <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="k" tabindex="9">FAQ</a> |
149 | </li> |
150 | </ul> |
151 | </div> |
152 | |
153 | === modified file 'lib/canonical/launchpad/tour/join-launchpad' |
154 | --- lib/canonical/launchpad/tour/join-launchpad 2009-06-12 09:42:47 +0000 |
155 | +++ lib/canonical/launchpad/tour/join-launchpad 2010-01-13 02:21:17 +0000 |
156 | @@ -114,7 +114,7 @@ |
157 | <a href="index" title="Return to the start of the Launchpad tour" accesskey="g" tabindex="5">Start</a> |
158 | </li> |
159 | <li class="copyright"> |
160 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
161 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
162 | </li> |
163 | </ul> |
164 | </div> |
165 | |
166 | === modified file 'lib/canonical/launchpad/tour/ppa' |
167 | --- lib/canonical/launchpad/tour/ppa 2009-06-12 16:36:02 +0000 |
168 | +++ lib/canonical/launchpad/tour/ppa 2010-01-13 02:21:17 +0000 |
169 | @@ -115,7 +115,7 @@ |
170 | <a href="community-support" accesskey="g" tabindex="5">Next</a> |
171 | </li> |
172 | <li class="copyright"> |
173 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
174 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
175 | </li> |
176 | </ul> |
177 | </div> |
178 | |
179 | === modified file 'lib/canonical/launchpad/tour/release-management' |
180 | --- lib/canonical/launchpad/tour/release-management 2009-06-12 16:36:02 +0000 |
181 | +++ lib/canonical/launchpad/tour/release-management 2010-01-13 02:21:17 +0000 |
182 | @@ -96,7 +96,7 @@ |
183 | <a href="join-launchpad" title="Read about commercial subscriptions and free access to Launchpad" accesskey="g" tabindex="5" title="Read about commercial subscriptions and free access to Launchpad">Next</a> |
184 | </li> |
185 | <li class="copyright"> |
186 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
187 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
188 | </li> |
189 | </ul> |
190 | </div> |
191 | |
192 | === modified file 'lib/canonical/launchpad/tour/translation' |
193 | --- lib/canonical/launchpad/tour/translation 2009-06-12 16:36:02 +0000 |
194 | +++ lib/canonical/launchpad/tour/translation 2010-01-13 02:21:17 +0000 |
195 | @@ -113,7 +113,7 @@ |
196 | <a href="community" accesskey="g" tabindex="5" title="Read about mailing lists and teams in Launchpad">Next</a> |
197 | </li> |
198 | <li class="copyright"> |
199 | - © 2004-2009 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
200 | + © 2004-2010 Canonical Ltd. <a href="https://help.launchpad.net/Legal" accesskey="h" tabindex="6">Terms of Use</a> : <a href="https://help.launchpad.net/Feedback" accesskey="i" tabindex="7">Feedback</a> : <a href="https://answers.launchpad.net/launchpad-project/+faqs" accesskey="j" tabindex="8">FAQ</a> |
201 | </li> |
202 | </ul> |
203 | </div> |
204 | |
205 | === modified file 'lib/canonical/launchpad/zcml/launchpad.zcml' |
206 | --- lib/canonical/launchpad/zcml/launchpad.zcml 2010-01-06 10:34:01 +0000 |
207 | +++ lib/canonical/launchpad/zcml/launchpad.zcml 2010-01-13 02:21:17 +0000 |
208 | @@ -279,27 +279,6 @@ |
209 | class="canonical.launchpad.browser.OAuthAccessTokenView" |
210 | permission="zope.Public" /> |
211 | |
212 | - <browser:page |
213 | - for="canonical.launchpad.webapp.interfaces.ILaunchpadRoot" |
214 | - name="+search" |
215 | - class="lp.registry.browser.root.LaunchpadSearchView" |
216 | - template="../templates/launchpad-search.pt" |
217 | - permission="zope.Public" /> |
218 | - |
219 | - <browser:page |
220 | - for="*" |
221 | - name="+search-form" |
222 | - class="lp.registry.browser.root.LaunchpadSearchFormView" |
223 | - template="../templates/launchpad-search-form.pt" |
224 | - permission="zope.Public" /> |
225 | - |
226 | - <browser:page |
227 | - for="*" |
228 | - name="+primary-search-form" |
229 | - class="lp.registry.browser.root.LaunchpadPrimarySearchFormView" |
230 | - template="../templates/launchpad-search-form.pt" |
231 | - permission="zope.Public" /> |
232 | - |
233 | <!-- Declare robots.txt file for the root --> |
234 | <browser:page |
235 | for="canonical.launchpad.interfaces.ILaunchpadRoot" |
236 | |
237 | === modified file 'lib/lp/app/browser/configure.zcml' |
238 | --- lib/lp/app/browser/configure.zcml 2009-11-23 03:10:04 +0000 |
239 | +++ lib/lp/app/browser/configure.zcml 2010-01-13 02:21:17 +0000 |
240 | @@ -44,6 +44,46 @@ |
241 | permission="zope.Public" |
242 | /> |
243 | |
244 | + <!-- This is an index.html view on the root object. |
245 | + The root object is not ever published itself. Only its views are. |
246 | + --> |
247 | + <browser:page |
248 | + for="canonical.launchpad.interfaces.ILaunchpadRoot" |
249 | + class="lp.app.browser.root.LaunchpadRootIndexView" |
250 | + name="index.html" |
251 | + template="../templates/root-index.pt" |
252 | + permission="zope.Public" |
253 | + /> |
254 | + |
255 | + <browser:page |
256 | + for="canonical.launchpad.interfaces.ILaunchpadRoot" |
257 | + class="lp.registry.browser.featuredproject.FeaturedProjectsView" |
258 | + name="+featuredprojects" |
259 | + template="../templates/root-featuredprojects.pt" |
260 | + permission="launchpad.Edit" |
261 | + /> |
262 | + |
263 | + <browser:page |
264 | + for="canonical.launchpad.webapp.interfaces.ILaunchpadRoot" |
265 | + name="+search" |
266 | + class="lp.app.browser.root.LaunchpadSearchView" |
267 | + template="../templates/launchpad-search.pt" |
268 | + permission="zope.Public" /> |
269 | + |
270 | + <browser:page |
271 | + for="*" |
272 | + name="+search-form" |
273 | + class="lp.app.browser.root.LaunchpadSearchFormView" |
274 | + template="../templates/launchpad-search-form.pt" |
275 | + permission="zope.Public" /> |
276 | + |
277 | + <browser:page |
278 | + for="*" |
279 | + name="+primary-search-form" |
280 | + class="lp.app.browser.root.LaunchpadPrimarySearchFormView" |
281 | + template="../templates/launchpad-search-form.pt" |
282 | + permission="zope.Public" /> |
283 | + |
284 | <!-- TALES watermark: namespace --> |
285 | <adapter |
286 | for="*" |
287 | |
288 | === renamed file 'lib/lp/registry/browser/root.py' => 'lib/lp/app/browser/root.py' |
289 | --- lib/lp/registry/browser/root.py 2009-11-17 16:24:54 +0000 |
290 | +++ lib/lp/app/browser/root.py 2010-01-13 02:21:17 +0000 |
291 | @@ -20,12 +20,11 @@ |
292 | from zope.schema.vocabulary import getVocabularyRegistry |
293 | |
294 | |
295 | -from canonical.config import config |
296 | from canonical.cachedproperty import cachedproperty |
297 | from lp.registry.browser.announcement import HasAnnouncementsView |
298 | from canonical.launchpad.interfaces.launchpadstatistic import ( |
299 | ILaunchpadStatisticSet) |
300 | -from canonical.launchpad.utilities.celebrities import ILaunchpadCelebrities |
301 | +from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
302 | from canonical.launchpad.webapp.publisher import canonical_url |
303 | from lp.code.interfaces.branchcollection import IAllBranches |
304 | from lp.bugs.interfaces.bug import IBugSet |
305 | @@ -57,6 +56,10 @@ |
306 | featured_projects = [] |
307 | featured_projects_top = None |
308 | |
309 | + |
310 | + # Used by the footer to display the lp-arcana section. |
311 | + is_root_page = True |
312 | + |
313 | @staticmethod |
314 | def _get_day_of_year(): |
315 | """Calculate the number of the current day. |
316 | @@ -83,12 +86,6 @@ |
317 | self.featured_projects_top = self.featured_projects.pop( |
318 | top_project) |
319 | |
320 | - def canRedirect(self): |
321 | - """Return True if the beta server is available to the user.""" |
322 | - return bool( |
323 | - config.launchpad.beta_testers_redirection_host is not None and |
324 | - self.isBetaUser) |
325 | - |
326 | @cachedproperty |
327 | def apphomes(self): |
328 | return { |
329 | |
330 | === renamed file 'lib/canonical/launchpad/doc/launchpad-search-pages.txt' => 'lib/lp/app/browser/tests/launchpad-search-pages.txt' |
331 | --- lib/canonical/launchpad/doc/launchpad-search-pages.txt 2009-04-17 10:32:16 +0000 |
332 | +++ lib/lp/app/browser/tests/launchpad-search-pages.txt 2010-01-13 02:21:17 +0000 |
333 | @@ -604,7 +604,7 @@ |
334 | matching pages. The WindowList claims to be 25 items in length, but |
335 | the first 20 items are None. Only the last 5 items are PageMatches. |
336 | |
337 | - >>> from lp.registry.browser.root import WindowedList |
338 | + >>> from lp.app.browser.root import WindowedList |
339 | >>> from canonical.launchpad.utilities.searchservice import ( |
340 | ... GoogleSearchService) |
341 | |
342 | @@ -626,7 +626,7 @@ |
343 | the 'batch' parameter to 100 has no affect upon the Google search |
344 | or on the navigator object. |
345 | |
346 | - >>> from lp.registry.browser.root import GoogleBatchNavigator |
347 | + >>> from lp.app.browser.root import GoogleBatchNavigator |
348 | |
349 | >>> GoogleBatchNavigator.batch_variable_name |
350 | 'batch' |
351 | |
352 | === renamed file 'lib/lp/registry/browser/tests/root-views.txt' => 'lib/lp/app/browser/tests/root-views.txt' |
353 | --- lib/lp/registry/browser/tests/root-views.txt 2009-11-13 18:14:27 +0000 |
354 | +++ lib/lp/app/browser/tests/root-views.txt 2010-01-13 02:21:17 +0000 |
355 | @@ -6,7 +6,7 @@ |
356 | |
357 | # The _get_day_of_year() method must be hacked to return a predicable day |
358 | # to testing the view. |
359 | - >>> from lp.registry.browser.root import LaunchpadRootIndexView |
360 | + >>> from lp.app.browser.root import LaunchpadRootIndexView |
361 | >>> def day(): |
362 | ... return 4 |
363 | >>> LaunchpadRootIndexView._get_day_of_year = staticmethod(day) |
364 | |
365 | === added file 'lib/lp/app/browser/tests/test_launchpadroot.py' |
366 | --- lib/lp/app/browser/tests/test_launchpadroot.py 1970-01-01 00:00:00 +0000 |
367 | +++ lib/lp/app/browser/tests/test_launchpadroot.py 2010-01-13 02:21:17 +0000 |
368 | @@ -0,0 +1,80 @@ |
369 | +# Copyright 2010 Canonical Ltd. This software is licensed under the |
370 | +# GNU Affero General Public License version 3 (see the file LICENSE). |
371 | + |
372 | +"""Tests related to ILaunchpadRoot.""" |
373 | + |
374 | +__metaclass__ = type |
375 | + |
376 | +import unittest |
377 | + |
378 | + |
379 | +from BeautifulSoup import BeautifulSoup, SoupStrainer |
380 | + |
381 | +from zope.component import getUtility |
382 | +from zope.security.checker import selectChecker |
383 | + |
384 | +from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
385 | +from canonical.launchpad.webapp.interfaces import ILaunchpadRoot |
386 | +from canonical.launchpad.webapp.authorization import check_permission |
387 | +from canonical.testing.layers import DatabaseFunctionalLayer |
388 | + |
389 | +from lp.registry.interfaces.person import IPersonSet |
390 | +from lp.testing import login_person, TestCaseWithFactory |
391 | +from lp.testing.views import create_initialized_view, create_view |
392 | + |
393 | + |
394 | +class LaunchpadRootPermissionTest(TestCaseWithFactory): |
395 | + """Test for the ILaunchpadRoot permission""" |
396 | + layer = DatabaseFunctionalLayer |
397 | + |
398 | + def setUp(self): |
399 | + TestCaseWithFactory.setUp(self) |
400 | + self.root = getUtility(ILaunchpadRoot) |
401 | + self.admin = getUtility(IPersonSet).getByEmail( |
402 | + 'foo.bar@canonical.com') |
403 | + |
404 | + def setUpRegistryExpert(self): |
405 | + """Create a registry expert and logs in as them.""" |
406 | + login_person(self.admin) |
407 | + self.expert = self.factory.makePersonNoCommit() |
408 | + getUtility(ILaunchpadCelebrities).registry_experts.addMember( |
409 | + self.expert, self.admin) |
410 | + login_person(self.expert) |
411 | + |
412 | + def test_anonymous_cannot_edit(self): |
413 | + self.failIf(check_permission('launchpad.Edit', self.root), |
414 | + "Anonymous user shouldn't have launchpad.Edit on ILaunchpadRoot") |
415 | + |
416 | + def test_regular_user_cannot_edit(self): |
417 | + login_person(self.factory.makePersonNoCommit()) |
418 | + self.failIf(check_permission('launchpad.Edit', self.root), |
419 | + "Regular users shouldn't have launchpad.Edit on ILaunchpadRoot") |
420 | + |
421 | + def test_registry_expert_can_edit(self): |
422 | + self.setUpRegistryExpert() |
423 | + self.failUnless(check_permission('launchpad.Edit', self.root), |
424 | + "Registry experts should have launchpad.Edit on ILaunchpadRoot") |
425 | + |
426 | + def test_admins_can_edit(self): |
427 | + login_person(self.admin) |
428 | + self.failUnless(check_permission('launchpad.Edit', self.root), |
429 | + "Admins should have launchpad.Edit on ILaunchpadRoot") |
430 | + |
431 | + def test_featured_projects_view_requires_edit(self): |
432 | + view = create_view(self.root, '+featuredprojects') |
433 | + checker = selectChecker(view) |
434 | + self.assertEquals('launchpad.Edit', checker.permission_id('__call__')) |
435 | + |
436 | + def test_featured_projects_manage_link_requires_edit(self): |
437 | + self.setUpRegistryExpert() |
438 | + view = create_initialized_view( |
439 | + self.root, 'index.html', principal=self.expert) |
440 | + content = BeautifulSoup(view(), parseOnlyThese=SoupStrainer('a')) |
441 | + self.failUnless( |
442 | + content.find('a', href='+featuredprojects'), |
443 | + "Cannot find the +featuredprojects link on the first page") |
444 | + |
445 | + |
446 | +def test_suite(): |
447 | + return unittest.TestLoader().loadTestsFromName(__name__) |
448 | + |
449 | |
450 | === modified file 'lib/lp/app/browser/tests/test_views.py' |
451 | --- lib/lp/app/browser/tests/test_views.py 2009-07-17 02:25:09 +0000 |
452 | +++ lib/lp/app/browser/tests/test_views.py 2010-01-13 02:21:17 +0000 |
453 | @@ -11,7 +11,8 @@ |
454 | |
455 | from canonical.launchpad.testing.systemdocs import ( |
456 | LayeredDocFileSuite, setUp, tearDown) |
457 | -from canonical.testing import DatabaseFunctionalLayer |
458 | +from canonical.testing import ( |
459 | + DatabaseFunctionalLayer, LaunchpadFunctionalLayer) |
460 | |
461 | |
462 | here = os.path.dirname(os.path.realpath(__file__)) |
463 | @@ -19,7 +20,9 @@ |
464 | # The default layer of view tests is the DatabaseFunctionalLayer. Tests |
465 | # that require something special like the librarian or mailman must run |
466 | # on a layer that sets those services up. |
467 | -special_test_layer = {} |
468 | +special_test_layer = { |
469 | + 'launchpad-search-pages.txt': LaunchpadFunctionalLayer, |
470 | + } |
471 | |
472 | |
473 | def test_suite(): |
474 | |
475 | === added directory 'lib/lp/app/stories' |
476 | === added file 'lib/lp/app/stories/__init__.py' |
477 | === added directory 'lib/lp/app/stories/basics' |
478 | === renamed file 'lib/canonical/launchpad/pagetests/basics/xx-copyright.txt' => 'lib/lp/app/stories/basics/copyright.txt' |
479 | --- lib/canonical/launchpad/pagetests/basics/xx-copyright.txt 2009-09-18 18:04:16 +0000 |
480 | +++ lib/lp/app/stories/basics/copyright.txt 2010-01-13 02:21:17 +0000 |
481 | @@ -5,11 +5,11 @@ |
482 | >>> browser.open('http://launchpad.dev/') |
483 | >>> browser.getLink('Take the tour').click() |
484 | >>> print extract_text(find_tag_by_id(browser.contents, 'footer-navigation')) |
485 | - Next...© 2004-2009 Canonical Ltd... |
486 | + Next...© 2004-2010 Canonical Ltd... |
487 | |
488 | The main template. |
489 | |
490 | >>> browser.open('http://launchpad.dev') |
491 | >>> print extract_text(find_tag_by_id(browser.contents, 'footer')) |
492 | - • ... © 2004-2009 Canonical Ltd. |
493 | + © 2004-2010 Canonical Ltd. |
494 | ... |
495 | |
496 | === renamed file 'lib/canonical/launchpad/pagetests/standalone/xx-beta-testers-redirection.txt' => 'lib/lp/app/stories/basics/xx-beta-testers-redirection.txt' |
497 | --- lib/canonical/launchpad/pagetests/standalone/xx-beta-testers-redirection.txt 2009-12-24 01:41:54 +0000 |
498 | +++ lib/lp/app/stories/basics/xx-beta-testers-redirection.txt 2010-01-13 02:21:17 +0000 |
499 | @@ -13,11 +13,10 @@ |
500 | |
501 | >>> beta_browser = setupBrowser(auth='Basic beta-admin@launchpad.net:test') |
502 | |
503 | -# XXX jamesh 2007-01-31: |
504 | +# XXX jamesh 2007-01-31 bug=98482: |
505 | # zope.testbrowser does not handle redirects to remote sites, so we |
506 | # disable the redirection handling at the mechanize layer. We then need |
507 | # to check the HTTPError directly. |
508 | -# See http://www.zope.org/Collectors/Zope3-dev/755 |
509 | |
510 | >>> user_browser.mech_browser.set_handle_redirect(False) |
511 | >>> beta_browser.mech_browser.set_handle_redirect(False) |
512 | @@ -108,29 +107,36 @@ |
513 | # Now retore our mainsite's hostname. |
514 | >>> dummy = config.pop('mainsite_data') |
515 | |
516 | -So that beta testers can still access the production site, the front |
517 | -page of Launchpad does not redirect. They will also see a message |
518 | -explaining why they get redirected, and provide a link to disable the |
519 | -redirection for 2 hours: |
520 | +The front page of Launchpad does not redirect. |
521 | |
522 | >>> check(beta_browser.open, 'http://launchpad.dev/') |
523 | >>> print beta_browser.url |
524 | http://launchpad.dev/ |
525 | - >>> print find_tags_by_class(beta_browser.contents, |
526 | - ... 'informational message')[0] |
527 | - <div class="informational message"> |
528 | - <p>As a member of the Launchpad Beta Testers team, you will be |
529 | - redirected to the beta site when viewing Launchpad pages other |
530 | - than the front page.</p> |
531 | - <p><button onclick="setBetaRedirect(false)">Disable redirection |
532 | - for 2 hours</button></p> |
533 | + |
534 | +On the beta site, a client side JS is available on every page (except |
535 | +the home page) in the footer that sets a cookie to inhibit |
536 | +the redirection. |
537 | + |
538 | + # Configure the site as the beta site. |
539 | + >>> config.push('fake_beta_site', """ |
540 | + ... [launchpad] |
541 | + ... beta_testers_redirection_host = none |
542 | + ... is_edge: True |
543 | + ... site_message: This is the beta site |
544 | + ... """) |
545 | + |
546 | + >>> check(beta_browser.open, 'http://launchpad.dev/ubuntu') |
547 | + >>> print beta_browser.url |
548 | + http://launchpad.dev/ubuntu |
549 | + >>> print find_tags_by_class(beta_browser.contents, 'sitemessage')[0] |
550 | + <div class="sitemessage"> |
551 | + This is the beta site |
552 | + <a href="#" class="js-action" onclick="setBetaRedirect(false)"> |
553 | + Disable edge redirect. |
554 | + </a> |
555 | </div> |
556 | |
557 | -This is so that the user can make use of some client side JS on that |
558 | -page that sets a cookie to inhibit the redirection. When the |
559 | -redirection is inhibited, the info message changes to one that lets |
560 | -them inhibit the redirection (a lower cookie expiry is used, since the |
561 | -default is to redirect if no cookie exists): |
562 | + >>> dummy = config.pop('fake_beta_site') |
563 | |
564 | # Workaround bug in mechanize where you cannot use the Cookie |
565 | # header with the CookieJar |
566 | @@ -144,18 +150,6 @@ |
567 | ... domain_specified=True, domain_initial_dot=True, path='/', |
568 | ... path_specified=True, secure=False, expires=None, |
569 | ... discard=None, comment=None, comment_url=None, rest={})) |
570 | - >>> check(beta_browser.open, 'http://launchpad.dev/') |
571 | - >>> print beta_browser.url |
572 | - http://launchpad.dev/ |
573 | - >>> print find_tags_by_class(beta_browser.contents, |
574 | - ... 'informational message')[0] |
575 | - <div class="informational message"> |
576 | - <p>As a member of the Launchpad Beta Testers team, you would |
577 | - normally be redirected to the beta site when viewing Launchpad |
578 | - pages. However, you currently have this disabled.</p> |
579 | - <p><button onclick="setBetaRedirect(true)">Enable beta site |
580 | - redirection</button></p> |
581 | - </div> |
582 | |
583 | Now when they go to a page on the site, it loads as normal: |
584 | |
585 | |
586 | === renamed directory 'lib/lp/registry/stories/launchpad-root' => 'lib/lp/app/stories/launchpad-root' |
587 | === modified file 'lib/lp/app/stories/launchpad-root/front-pages.txt' |
588 | --- lib/lp/registry/stories/launchpad-root/front-pages.txt 2009-11-13 16:47:51 +0000 |
589 | +++ lib/lp/app/stories/launchpad-root/front-pages.txt 2010-01-13 02:21:17 +0000 |
590 | @@ -35,6 +35,11 @@ |
591 | Ubuntu |
592 | ... |
593 | |
594 | +The footer doesn't contain the links that are already present on the page. |
595 | + |
596 | + >>> print find_tags_by_class(browser.contents, 'lp-arcana') |
597 | + [] |
598 | + |
599 | The homepage looks different when the use is logged in: |
600 | |
601 | >>> user_browser = setupBrowser(auth="Basic test@canonical.com:test") |
602 | @@ -50,6 +55,7 @@ |
603 | >>> people_link.url |
604 | 'http://launchpad.dev/people/+newteam' |
605 | |
606 | + |
607 | The front pages for the other applications, however, do have |
608 | application tabs. On these pages, the tab normally named "Overview" |
609 | is labelled "Launchpad Home" to make clear where it goes. |
610 | @@ -71,3 +77,10 @@ |
611 | * Blueprints - http://blueprints.launchpad.dev/ |
612 | * Translations - http://translations.launchpad.dev/ |
613 | * Answers (selected) - http://answers.launchpad.dev/ |
614 | + |
615 | +The footer of those pages contains the link to the front page, tour |
616 | +and guide: |
617 | + |
618 | + >>> print extract_text( |
619 | + ... find_tags_by_class(user_browser.contents, 'lp-arcana')[0]) |
620 | + • Take the tour • Read the guide |
621 | |
622 | === modified file 'lib/lp/app/stories/launchpad-root/xx-featuredprojects.txt' |
623 | --- lib/lp/registry/stories/launchpad-root/xx-featuredprojects.txt 2009-11-18 11:24:10 +0000 |
624 | +++ lib/lp/app/stories/launchpad-root/xx-featuredprojects.txt 2010-01-13 02:21:17 +0000 |
625 | @@ -16,7 +16,7 @@ |
626 | |
627 | >>> def fake_get_day_of_year(): |
628 | ... return 4 |
629 | - >>> from lp.registry.browser.root import LaunchpadRootIndexView |
630 | + >>> from lp.app.browser.root import LaunchpadRootIndexView |
631 | >>> LaunchpadRootIndexView._get_day_of_year = staticmethod( |
632 | ... fake_get_day_of_year) |
633 | |
634 | |
635 | === modified file 'lib/lp/app/templates/base-layout-macros.pt' |
636 | --- lib/lp/app/templates/base-layout-macros.pt 2010-01-05 20:48:57 +0000 |
637 | +++ lib/lp/app/templates/base-layout-macros.pt 2010-01-13 02:21:17 +0000 |
638 | @@ -319,7 +319,7 @@ |
639 | |
640 | <metal:footer define-macro="footer"> |
641 | <div id="footer" class="footer"> |
642 | - <div class="lp-arcana"> |
643 | + <div class="lp-arcana" tal:condition="not:view/is_root_page|nothing"> |
644 | <div class="lp-branding"> |
645 | <a tal:attributes="href string:${rooturl}"><img src="/@@/launchpad-logo-and-name-hierarchy.png" alt="Launchpad"/></a> |
646 | • |
647 | @@ -339,7 +339,7 @@ |
648 | </div> |
649 | |
650 | <div class="colophon"> |
651 | - © 2004-2009 |
652 | + © 2004-2010 |
653 | <a href="http://canonical.com/">Canonical Ltd.</a> |
654 | • |
655 | <a href="/legal">Terms of use</a> |
656 | |
657 | === renamed file 'lib/canonical/launchpad/templates/launchpad-search-form.pt' => 'lib/lp/app/templates/launchpad-search-form.pt' |
658 | === renamed file 'lib/canonical/launchpad/templates/launchpad-search.pt' => 'lib/lp/app/templates/launchpad-search.pt' |
659 | === renamed file 'lib/canonical/launchpad/templates/root-featuredprojects.pt' => 'lib/lp/app/templates/root-featuredprojects.pt' |
660 | === renamed file 'lib/canonical/launchpad/templates/root-index.pt' => 'lib/lp/app/templates/root-index.pt' |
661 | --- lib/canonical/launchpad/templates/root-index.pt 2009-12-14 17:27:45 +0000 |
662 | +++ lib/lp/app/templates/root-index.pt 2010-01-13 02:21:17 +0000 |
663 | @@ -68,23 +68,6 @@ |
664 | <body> |
665 | <div metal:fill-slot="main"> |
666 | |
667 | - <div class="informational message" tal:condition="view/canRedirect"> |
668 | - <tal:redirect_inhibited condition="view/isRedirectInhibited"> |
669 | - <p>As a member of the Launchpad Beta Testers team, you would |
670 | - normally be redirected to the beta site when viewing Launchpad |
671 | - pages. However, you currently have this disabled.</p> |
672 | - <p><button onclick="setBetaRedirect(true)">Enable beta site |
673 | - redirection</button></p> |
674 | - </tal:redirect_inhibited> |
675 | - <tal:redirect_enabled condition="not:view/isRedirectInhibited"> |
676 | - <p>As a member of the Launchpad Beta Testers team, you will be |
677 | - redirected to the beta site when viewing Launchpad pages other |
678 | - than the front page.</p> |
679 | - <p><button onclick="setBetaRedirect(false)">Disable redirection |
680 | - for 2 hours</button></p> |
681 | - </tal:redirect_enabled> |
682 | - </div> |
683 | - |
684 | <tal:comment replace="nothing"> |
685 | Do not replace the line below: "Is your project registered yet?" |
686 | without contacting the IS team. It's used by Nagios to verify |
687 | @@ -269,7 +252,7 @@ |
688 | <tal:count content="view/project_count">42</tal:count> |
689 | projects</a>!</strong> |
690 | </li> |
691 | - <li tal:condition="context/required:launchpad.Admin"> |
692 | + <li tal:condition="context/required:launchpad.Edit"> |
693 | <a class="sprite edit" href="+featuredprojects">Manage |
694 | featured project list</a> |
695 | </li> |
696 | |
697 | === added file 'lib/lp/app/tests/test_doc.py' |
698 | --- lib/lp/app/tests/test_doc.py 1970-01-01 00:00:00 +0000 |
699 | +++ lib/lp/app/tests/test_doc.py 2010-01-13 02:21:17 +0000 |
700 | @@ -0,0 +1,17 @@ |
701 | +# Copyright 2010 Canonical Ltd. This software is licensed under the |
702 | +# GNU Affero General Public License version 3 (see the file LICENSE). |
703 | + |
704 | +""" |
705 | +Run the doctests and pagetests. |
706 | +""" |
707 | + |
708 | +import os |
709 | + |
710 | +from lp.services.testing import build_test_suite |
711 | + |
712 | + |
713 | +here = os.path.dirname(os.path.realpath(__file__)) |
714 | + |
715 | + |
716 | +def test_suite(): |
717 | + return build_test_suite(here) |
718 | |
719 | === modified file 'lib/lp/blueprints/tests/test_doc.py' |
720 | --- lib/lp/blueprints/tests/test_doc.py 2009-10-27 19:30:59 +0000 |
721 | +++ lib/lp/blueprints/tests/test_doc.py 2010-01-13 02:21:17 +0000 |
722 | @@ -12,7 +12,6 @@ |
723 | LayeredDocFileSuite, setUp, tearDown) |
724 | from canonical.launchpad.ftests.test_system_documentation import( |
725 | ProcessMailLayer) |
726 | -from canonical.testing import DatabaseFunctionalLayer |
727 | |
728 | from lp.services.testing import build_test_suite |
729 | |
730 | @@ -31,4 +30,4 @@ |
731 | |
732 | |
733 | def test_suite(): |
734 | - return build_test_suite(here, special, layer=DatabaseFunctionalLayer) |
735 | + return build_test_suite(here, special) |
736 | |
737 | === modified file 'lib/lp/code/tests/test_doc.py' |
738 | --- lib/lp/code/tests/test_doc.py 2009-09-01 06:13:55 +0000 |
739 | +++ lib/lp/code/tests/test_doc.py 2010-01-13 02:21:17 +0000 |
740 | @@ -14,8 +14,7 @@ |
741 | from canonical.launchpad.ftests.test_system_documentation import ( |
742 | branchscannerSetUp) |
743 | from canonical.launchpad.webapp.authorization import LaunchpadSecurityPolicy |
744 | -from canonical.testing import ( |
745 | - DatabaseFunctionalLayer, LaunchpadFunctionalLayer, LaunchpadZopelessLayer) |
746 | +from canonical.testing import LaunchpadFunctionalLayer, LaunchpadZopelessLayer |
747 | from lp.services.testing import build_test_suite |
748 | |
749 | |
750 | @@ -69,4 +68,4 @@ |
751 | |
752 | |
753 | def test_suite(): |
754 | - return build_test_suite(here, special, layer=DatabaseFunctionalLayer) |
755 | + return build_test_suite(here, special) |
756 | |
757 | === modified file 'lib/lp/services/testing/__init__.py' |
758 | --- lib/lp/services/testing/__init__.py 2009-06-25 04:06:00 +0000 |
759 | +++ lib/lp/services/testing/__init__.py 2010-01-13 02:21:17 +0000 |
760 | @@ -19,24 +19,24 @@ |
761 | from canonical.launchpad.testing.pages import PageTestSuite |
762 | from canonical.launchpad.testing.systemdocs import ( |
763 | LayeredDocFileSuite, setUp, tearDown) |
764 | -from canonical.testing import LaunchpadFunctionalLayer |
765 | +from canonical.testing import DatabaseFunctionalLayer |
766 | from canonical.launchpad.testing.systemdocs import strip_prefix |
767 | |
768 | def build_test_suite(base_dir, special_tests={}, |
769 | - layer=LaunchpadFunctionalLayer, |
770 | + layer=DatabaseFunctionalLayer, |
771 | setUp=setUp, tearDown=tearDown): |
772 | """Build a test suite from a directory containing test files. |
773 | |
774 | - The 'stories' subdirectory will be checked for pagetests and the |
775 | - 'doc' subdirectory will be checked for doctests. |
776 | + The parent's 'stories' subdirectory will be checked for pagetests and |
777 | + the parent's 'doc' subdirectory will be checked for doctests. |
778 | |
779 | - :param base_dir: The directory to check for tests. |
780 | + :param base_dir: The tests subdirectory that. |
781 | |
782 | :param special_tests: A dict mapping filenames to TestSuite |
783 | - objects. These files need special treatment (for instance, they |
784 | - should be run in a different layer, or they need custom |
785 | - setup/teardown). The given TestSuite object will be used for that |
786 | - file, rather than a new one generated. |
787 | + objects. These files need special treatment (for instance, they |
788 | + should be run in a different layer, or they need custom |
789 | + setup/teardown). The given TestSuite object will be used for that |
790 | + file, rather than a new one generated. |
791 | |
792 | :param layer: The layer in which to run the tests. |
793 | """ |
= Summary =
This branch cleans a couple of things related to the front page. As a bonus,
it also moves some files out of lib/canonical/
== Proposed fix ==
* Update the footer copyright year to 2010.
* Remove the beta redirection box from the front page.
* Don't display the blue bar section in the footer on the home page (because
the links there are redundant with the content.)
== Pre-implementation notes ==
These changes were suggested by Kiko and I discussed them with Martin. The
main drawback to this change is that it won't be possible anymore to control
the edge redirection from the edge home page. Both Kiko and Martin felt that
this wasn't a problem. Martin was also fine about not displaying the site
message on the edge front page.
== Implementation details ==
I also moved the root views into lp.app. I had to add the test fixture there.
I wasn't sure what to do with the FeaturedProjectView which are in
lp.registry. I didn't feel like moving the model and interfaces into lp.app)
So I left the view in lp.registry, even though the test and registrations for
the porlet are still in lp.app.
== Tests ==
bin/test -vvm lp.app
== Demo and Q/A ==
Browse to the front page and:
* Notice the copyright was updated.
* See that the blue box isn't there anymore.
Browse to any other page, see that the blue footer box is there.
Browse through the tour and see that the copyright dates are updated.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: /launchpad/ zcml/launchpad. zcml /launchpad/ tour/bugs /launchpad/ tour/join- launchpad /launchpad/ tour/community app/browser/ root.py app/tests/ test_doc. py /launchpad/ tour/translatio n /launchpad/ tour/feature- tracking app/stories/ launchpad- root/xx- featuredproject s.txt /launchpad/ tour/release- management /launchpad/ tour/api app/templates/ base-layout- macros. pt /launchpad/ tour/branch- hosting- tracking app/templates/ root-index. pt app/browser/ tests/launchpad -search- pages.txt app/stories/ __init_ _.py /configure. zcml app/browser/ configure. zcml /launchpad/ tour/index /launchpad/ tour/ppa app/browser/ tests/test_ views.py /launchpad/ tour/community- support app/stories/ launchpad- root/front- pages.txt app/stories/ basics/ copyright. txt app/stories/ basics/ xx-beta- testers- redirection. txt app/browser/ tests/root- views.txt
lib/canonical
lib/canonical
lib/canonical
lib/canonical
lib/lp/
lib/lp/
lib/canonical
lib/canonical
lib/lp/
lib/canonical
lib/canonical
lib/lp/
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/canonical
lib/lp/
lib/canonical
lib/canonical
lib/lp/
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pyflakes notices ==
lib/lp/ app/browser/ root.py
23: 'config' imported but unused
== Pylint notices ==
lib/lp/ app/browser/ root.py gator.z3batchin g' (No module ch.__iter_ _] Use super on an old style class
45: [F0401] Unable to import 'lazr.batchnavi
named batchnavigator)
505: [E1002, WindowedListBat
23: [W0611] Unused import config