Merge lp:~cjwatson/launchpad/git-recipe-browser-listing into lp:launchpad
- git-recipe-browser-listing
- Merge into devel
Proposed by
Colin Watson
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 17900 | ||||
Proposed branch: | lp:~cjwatson/launchpad/git-recipe-browser-listing | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~cjwatson/launchpad/recipe-name-policy | ||||
Diff against target: |
509 lines (+233/-35) 11 files modified
lib/lp/code/browser/configure.zcml (+21/-3) lib/lp/code/browser/gitref.py (+23/-3) lib/lp/code/browser/gitrepository.py (+24/-3) lib/lp/code/browser/sourcepackagerecipelisting.py (+6/-4) lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt (+99/-14) lib/lp/code/templates/branch-recipes.pt (+1/-1) lib/lp/code/templates/gitref-index.pt (+11/-2) lib/lp/code/templates/gitref-recipes.pt (+19/-0) lib/lp/code/templates/gitrepository-index.pt (+7/-2) lib/lp/code/templates/gitrepository-recipes.pt (+19/-0) lib/lp/code/templates/sourcepackagerecipe-listing.pt (+3/-3) |
||||
To merge this branch: | bzr merge lp:~cjwatson/launchpad/git-recipe-browser-listing | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+282321@code.launchpad.net |
Commit message
Add views to list existing Git recipes.
Description of the change
Add views to list existing Git recipes.
To post a comment you must log in.
Revision history for this message
William Grant (wgrant) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/code/browser/configure.zcml' | |||
2 | --- lib/lp/code/browser/configure.zcml 2015-11-23 11:34:15 +0000 | |||
3 | +++ lib/lp/code/browser/configure.zcml 2016-01-12 15:24:34 +0000 | |||
4 | @@ -1,4 +1,4 @@ | |||
6 | 1 | <!-- Copyright 2009-2015 Canonical Ltd. This software is licensed under the | 1 | <!-- Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
7 | 2 | GNU Affero General Public License version 3 (see the file LICENSE). | 2 | GNU Affero General Public License version 3 (see the file LICENSE). |
8 | 3 | --> | 3 | --> |
9 | 4 | 4 | ||
10 | @@ -800,6 +800,9 @@ | |||
11 | 800 | <browser:page | 800 | <browser:page |
12 | 801 | name="++repository-management" | 801 | name="++repository-management" |
13 | 802 | template="../templates/gitrepository-management.pt"/> | 802 | template="../templates/gitrepository-management.pt"/> |
14 | 803 | <browser:page | ||
15 | 804 | name="++repository-recipes" | ||
16 | 805 | template="../templates/gitrepository-recipes.pt"/> | ||
17 | 803 | </browser:pages> | 806 | </browser:pages> |
18 | 804 | <browser:page | 807 | <browser:page |
19 | 805 | for="lp.code.interfaces.gitrepository.IGitRepository" | 808 | for="lp.code.interfaces.gitrepository.IGitRepository" |
20 | @@ -884,11 +887,14 @@ | |||
21 | 884 | name="++ref-commits" | 887 | name="++ref-commits" |
22 | 885 | template="../templates/gitref-commits.pt"/> | 888 | template="../templates/gitref-commits.pt"/> |
23 | 886 | <browser:page | 889 | <browser:page |
24 | 890 | name="++ref-management" | ||
25 | 891 | template="../templates/gitref-management.pt"/> | ||
26 | 892 | <browser:page | ||
27 | 887 | name="++ref-pending-merges" | 893 | name="++ref-pending-merges" |
28 | 888 | template="../templates/gitref-pending-merges.pt"/> | 894 | template="../templates/gitref-pending-merges.pt"/> |
29 | 889 | <browser:page | 895 | <browser:page |
32 | 890 | name="++ref-management" | 896 | name="++ref-recipes" |
33 | 891 | template="../templates/gitref-management.pt"/> | 897 | template="../templates/gitref-recipes.pt"/> |
34 | 892 | </browser:pages> | 898 | </browser:pages> |
35 | 893 | <browser:page | 899 | <browser:page |
36 | 894 | for="lp.code.interfaces.gitref.IGitRef" | 900 | for="lp.code.interfaces.gitref.IGitRef" |
37 | @@ -1232,6 +1238,18 @@ | |||
38 | 1232 | name="+recipes" | 1238 | name="+recipes" |
39 | 1233 | template="../templates/sourcepackagerecipe-listing.pt"/> | 1239 | template="../templates/sourcepackagerecipe-listing.pt"/> |
40 | 1234 | <browser:page | 1240 | <browser:page |
41 | 1241 | for="lp.code.interfaces.gitrepository.IGitRepository" | ||
42 | 1242 | class="lp.code.browser.sourcepackagerecipelisting.BranchRecipeListingView" | ||
43 | 1243 | permission="zope.Public" | ||
44 | 1244 | name="+recipes" | ||
45 | 1245 | template="../templates/sourcepackagerecipe-listing.pt"/> | ||
46 | 1246 | <browser:page | ||
47 | 1247 | for="lp.code.interfaces.gitref.IGitRef" | ||
48 | 1248 | class="lp.code.browser.sourcepackagerecipelisting.BranchRecipeListingView" | ||
49 | 1249 | permission="zope.Public" | ||
50 | 1250 | name="+recipes" | ||
51 | 1251 | template="../templates/sourcepackagerecipe-listing.pt"/> | ||
52 | 1252 | <browser:page | ||
53 | 1235 | for="lp.registry.interfaces.product.IProduct" | 1253 | for="lp.registry.interfaces.product.IProduct" |
54 | 1236 | class="lp.code.browser.sourcepackagerecipelisting.ProductRecipeListingView" | 1254 | class="lp.code.browser.sourcepackagerecipelisting.ProductRecipeListingView" |
55 | 1237 | permission="zope.Public" | 1255 | permission="zope.Public" |
56 | 1238 | 1256 | ||
57 | === modified file 'lib/lp/code/browser/gitref.py' | |||
58 | --- lib/lp/code/browser/gitref.py 2015-11-30 03:03:14 +0000 | |||
59 | +++ lib/lp/code/browser/gitref.py 2016-01-12 15:24:34 +0000 | |||
60 | @@ -1,4 +1,4 @@ | |||
62 | 1 | # Copyright 2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2015-2016 Canonical Ltd. This software is licensed under the |
63 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
64 | 3 | 3 | ||
65 | 4 | """Git reference views.""" | 4 | """Git reference views.""" |
66 | @@ -35,6 +35,7 @@ | |||
67 | 35 | from lp.code.browser.branchmergeproposal import ( | 35 | from lp.code.browser.branchmergeproposal import ( |
68 | 36 | latest_proposals_for_each_branch, | 36 | latest_proposals_for_each_branch, |
69 | 37 | ) | 37 | ) |
70 | 38 | from lp.code.browser.sourcepackagerecipelisting import HasRecipesMenuMixin | ||
71 | 38 | from lp.code.errors import InvalidBranchMergeProposal | 39 | from lp.code.errors import InvalidBranchMergeProposal |
72 | 39 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal | 40 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal |
73 | 40 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference | 41 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference |
74 | @@ -49,18 +50,19 @@ | |||
75 | 49 | Link, | 50 | Link, |
76 | 50 | ) | 51 | ) |
77 | 51 | from lp.services.webapp.authorization import check_permission | 52 | from lp.services.webapp.authorization import check_permission |
78 | 53 | from lp.services.webapp.escaping import structured | ||
79 | 52 | from lp.snappy.browser.hassnaps import ( | 54 | from lp.snappy.browser.hassnaps import ( |
80 | 53 | HasSnapsMenuMixin, | 55 | HasSnapsMenuMixin, |
81 | 54 | HasSnapsViewMixin, | 56 | HasSnapsViewMixin, |
82 | 55 | ) | 57 | ) |
83 | 56 | 58 | ||
84 | 57 | 59 | ||
86 | 58 | class GitRefContextMenu(ContextMenu, HasSnapsMenuMixin): | 60 | class GitRefContextMenu(ContextMenu, HasRecipesMenuMixin, HasSnapsMenuMixin): |
87 | 59 | """Context menu for Git references.""" | 61 | """Context menu for Git references.""" |
88 | 60 | 62 | ||
89 | 61 | usedfor = IGitRef | 63 | usedfor = IGitRef |
90 | 62 | facet = 'branches' | 64 | facet = 'branches' |
92 | 63 | links = ['create_snap', 'register_merge', 'source'] | 65 | links = ['create_snap', 'register_merge', 'source', 'view_recipes'] |
93 | 64 | 66 | ||
94 | 65 | def source(self): | 67 | def source(self): |
95 | 66 | """Return a link to the branch's browsing interface.""" | 68 | """Return a link to the branch's browsing interface.""" |
96 | @@ -144,6 +146,24 @@ | |||
97 | 144 | def dependent_landing_count_text(self): | 146 | def dependent_landing_count_text(self): |
98 | 145 | return self._getBranchCountText(len(self.dependent_landings)) | 147 | return self._getBranchCountText(len(self.dependent_landings)) |
99 | 146 | 148 | ||
100 | 149 | @property | ||
101 | 150 | def recipes_link(self): | ||
102 | 151 | """A link to recipes for this reference.""" | ||
103 | 152 | count = self.context.recipes.count() | ||
104 | 153 | if count == 0: | ||
105 | 154 | # Nothing to link to. | ||
106 | 155 | return 'No recipes using this branch.' | ||
107 | 156 | elif count == 1: | ||
108 | 157 | # Link to the single recipe. | ||
109 | 158 | return structured( | ||
110 | 159 | '<a href="%s">1 recipe</a> using this branch.', | ||
111 | 160 | canonical_url(self.context.recipes.one())).escapedtext | ||
112 | 161 | else: | ||
113 | 162 | # Link to a recipe listing. | ||
114 | 163 | return structured( | ||
115 | 164 | '<a href="+recipes">%s recipes</a> using this branch.', | ||
116 | 165 | count).escapedtext | ||
117 | 166 | |||
118 | 147 | 167 | ||
119 | 148 | class GitRefRegisterMergeProposalSchema(Interface): | 168 | class GitRefRegisterMergeProposalSchema(Interface): |
120 | 149 | """The schema to define the form for registering a new merge proposal.""" | 169 | """The schema to define the form for registering a new merge proposal.""" |
121 | 150 | 170 | ||
122 | === modified file 'lib/lp/code/browser/gitrepository.py' | |||
123 | --- lib/lp/code/browser/gitrepository.py 2015-10-07 16:14:42 +0000 | |||
124 | +++ lib/lp/code/browser/gitrepository.py 2016-01-12 15:24:34 +0000 | |||
125 | @@ -1,4 +1,4 @@ | |||
127 | 1 | # Copyright 2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2015-2016 Canonical Ltd. This software is licensed under the |
128 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
129 | 3 | 3 | ||
130 | 4 | """Git repository views.""" | 4 | """Git repository views.""" |
131 | @@ -52,6 +52,7 @@ | |||
132 | 52 | from lp.app.vocabularies import InformationTypeVocabulary | 52 | from lp.app.vocabularies import InformationTypeVocabulary |
133 | 53 | from lp.app.widgets.itemswidgets import LaunchpadRadioWidgetWithDescription | 53 | from lp.app.widgets.itemswidgets import LaunchpadRadioWidgetWithDescription |
134 | 54 | from lp.code.browser.branch import CodeEditOwnerMixin | 54 | from lp.code.browser.branch import CodeEditOwnerMixin |
135 | 55 | from lp.code.browser.sourcepackagerecipelisting import HasRecipesMenuMixin | ||
136 | 55 | from lp.code.browser.widgets.gitrepositorytarget import ( | 56 | from lp.code.browser.widgets.gitrepositorytarget import ( |
137 | 56 | GitRepositoryTargetDisplayWidget, | 57 | GitRepositoryTargetDisplayWidget, |
138 | 57 | GitRepositoryTargetWidget, | 58 | GitRepositoryTargetWidget, |
139 | @@ -203,12 +204,14 @@ | |||
140 | 203 | return Link("+delete", text, icon="trash-icon") | 204 | return Link("+delete", text, icon="trash-icon") |
141 | 204 | 205 | ||
142 | 205 | 206 | ||
144 | 206 | class GitRepositoryContextMenu(ContextMenu): | 207 | class GitRepositoryContextMenu(ContextMenu, HasRecipesMenuMixin): |
145 | 207 | """Context menu for `IGitRepository`.""" | 208 | """Context menu for `IGitRepository`.""" |
146 | 208 | 209 | ||
147 | 209 | usedfor = IGitRepository | 210 | usedfor = IGitRepository |
148 | 210 | facet = "branches" | 211 | facet = "branches" |
150 | 211 | links = ["add_subscriber", "source", "subscription", "visibility"] | 212 | links = [ |
151 | 213 | "add_subscriber", "source", "subscription", | ||
152 | 214 | "view_recipes", "visibility"] | ||
153 | 212 | 215 | ||
154 | 213 | @enabled_with_permission("launchpad.AnyPerson") | 216 | @enabled_with_permission("launchpad.AnyPerson") |
155 | 214 | def subscription(self): | 217 | def subscription(self): |
156 | @@ -291,6 +294,24 @@ | |||
157 | 291 | """All branches in this repository, sorted for display.""" | 294 | """All branches in this repository, sorted for display.""" |
158 | 292 | return GitRefBatchNavigator(self, self.context) | 295 | return GitRefBatchNavigator(self, self.context) |
159 | 293 | 296 | ||
160 | 297 | @property | ||
161 | 298 | def recipes_link(self): | ||
162 | 299 | """A link to recipes for this repository.""" | ||
163 | 300 | count = self.context.recipes.count() | ||
164 | 301 | if count == 0: | ||
165 | 302 | # Nothing to link to. | ||
166 | 303 | return 'No recipes using this repository.' | ||
167 | 304 | elif count == 1: | ||
168 | 305 | # Link to the single recipe. | ||
169 | 306 | return structured( | ||
170 | 307 | '<a href="%s">1 recipe</a> using this repository.', | ||
171 | 308 | canonical_url(self.context.recipes.one())).escapedtext | ||
172 | 309 | else: | ||
173 | 310 | # Link to a recipe listing. | ||
174 | 311 | return structured( | ||
175 | 312 | '<a href="+recipes">%s recipes</a> using this repository.', | ||
176 | 313 | count).escapedtext | ||
177 | 314 | |||
178 | 294 | 315 | ||
179 | 295 | class GitRepositoryEditFormView(LaunchpadEditFormView): | 316 | class GitRepositoryEditFormView(LaunchpadEditFormView): |
180 | 296 | """Base class for forms that edit a Git repository.""" | 317 | """Base class for forms that edit a Git repository.""" |
181 | 297 | 318 | ||
182 | === modified file 'lib/lp/code/browser/sourcepackagerecipelisting.py' | |||
183 | --- lib/lp/code/browser/sourcepackagerecipelisting.py 2015-10-05 13:36:06 +0000 | |||
184 | +++ lib/lp/code/browser/sourcepackagerecipelisting.py 2016-01-12 15:24:34 +0000 | |||
185 | @@ -1,4 +1,4 @@ | |||
187 | 1 | # Copyright 2010-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2016 Canonical Ltd. This software is licensed under the |
188 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
189 | 3 | 3 | ||
190 | 4 | """Base class view for sourcepackagerecipe listings.""" | 4 | """Base class view for sourcepackagerecipe listings.""" |
191 | @@ -14,6 +14,7 @@ | |||
192 | 14 | 14 | ||
193 | 15 | 15 | ||
194 | 16 | from lp.code.browser.decorations import DecoratedBranch | 16 | from lp.code.browser.decorations import DecoratedBranch |
195 | 17 | from lp.code.interfaces.branch import IBranch | ||
196 | 17 | from lp.services.feeds.browser import FeedsMixin | 18 | from lp.services.feeds.browser import FeedsMixin |
197 | 18 | from lp.services.webapp import ( | 19 | from lp.services.webapp import ( |
198 | 19 | LaunchpadView, | 20 | LaunchpadView, |
199 | @@ -42,8 +43,8 @@ | |||
200 | 42 | 43 | ||
201 | 43 | @property | 44 | @property |
202 | 44 | def page_title(self): | 45 | def page_title(self): |
205 | 45 | return 'Source Package Recipes for %(displayname)s' % { | 46 | return 'Source Package Recipes for %(display_name)s' % { |
206 | 46 | 'displayname': self.context.displayname} | 47 | 'display_name': self.context.display_name} |
207 | 47 | 48 | ||
208 | 48 | 49 | ||
209 | 49 | class BranchRecipeListingView(RecipeListingView): | 50 | class BranchRecipeListingView(RecipeListingView): |
210 | @@ -54,7 +55,8 @@ | |||
211 | 54 | super(BranchRecipeListingView, self).initialize() | 55 | super(BranchRecipeListingView, self).initialize() |
212 | 55 | # Replace our context with a decorated branch, if it is not already | 56 | # Replace our context with a decorated branch, if it is not already |
213 | 56 | # decorated. | 57 | # decorated. |
215 | 57 | if not isinstance(self.context, DecoratedBranch): | 58 | if (IBranch.providedBy(self.context) and |
216 | 59 | not isinstance(self.context, DecoratedBranch)): | ||
217 | 58 | self.context = DecoratedBranch(self.context) | 60 | self.context = DecoratedBranch(self.context) |
218 | 59 | 61 | ||
219 | 60 | 62 | ||
220 | 61 | 63 | ||
221 | === modified file 'lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt' | |||
222 | --- lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt 2011-06-29 16:49:05 +0000 | |||
223 | +++ lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt 2016-01-12 15:24:34 +0000 | |||
224 | @@ -52,18 +52,84 @@ | |||
225 | 52 | >>> print nopriv_browser.url | 52 | >>> print nopriv_browser.url |
226 | 53 | http://code.launchpad.dev/%7Eperson-name.../product-name.../branch.../+recipes | 53 | http://code.launchpad.dev/%7Eperson-name.../product-name.../branch.../+recipes |
227 | 54 | 54 | ||
240 | 55 | The "Base branch" column should not be shown. | 55 | The "Base Source" column should not be shown. |
241 | 56 | 56 | ||
242 | 57 | >>> print_recipe_listing_head(nopriv_browser) | 57 | >>> print_recipe_listing_head(nopriv_browser) |
243 | 58 | Name | 58 | Name |
244 | 59 | Owner | 59 | Owner |
245 | 60 | Registered | 60 | Registered |
246 | 61 | 61 | ||
247 | 62 | The branch page should have a list of all the recipes the branch is a | 62 | The recipe listing page should have a list of all the recipes the branch is |
248 | 63 | base_branch for. | 63 | a base for. |
249 | 64 | 64 | ||
250 | 65 | >>> print_recipe_listing_contents(nopriv_browser) | 65 | >>> print_recipe_listing_contents(nopriv_browser) |
251 | 66 | spr-name... Person-name... | 66 | spr-name... Person-name... |
252 | 67 | spr-name... Person-name... | ||
253 | 68 | spr-name... Person-name... | ||
254 | 69 | |||
255 | 70 | |||
256 | 71 | Git Recipe Listings | ||
257 | 72 | =================== | ||
258 | 73 | |||
259 | 74 | Create a new sample repository, some branches in it, and some source package | ||
260 | 75 | recipes to go along with them. | ||
261 | 76 | |||
262 | 77 | >>> login('foo.bar@canonical.com') | ||
263 | 78 | >>> repository = factory.makeGitRepository() | ||
264 | 79 | >>> ref1, ref2, ref3 = factory.makeGitRefs( | ||
265 | 80 | ... repository=repository, | ||
266 | 81 | ... paths=[u"refs/heads/a", u"refs/heads/b", u"refs/heads/c"]) | ||
267 | 82 | >>> recipe1a = factory.makeSourcePackageRecipe(branches=[ref1]) | ||
268 | 83 | >>> recipe1b = factory.makeSourcePackageRecipe(branches=[ref1]) | ||
269 | 84 | >>> recipe2 = factory.makeSourcePackageRecipe(branches=[ref2]) | ||
270 | 85 | >>> recipe3 = factory.makeSourcePackageRecipe(branches=[ref3]) | ||
271 | 86 | |||
272 | 87 | Keep these urls, including the target url. We'll use these later. | ||
273 | 88 | |||
274 | 89 | >>> repository_url = canonical_url(repository) | ||
275 | 90 | >>> ref1_url = canonical_url(ref1) | ||
276 | 91 | >>> target_url = canonical_url(repository.target) | ||
277 | 92 | |||
278 | 93 | >>> logout() | ||
279 | 94 | |||
280 | 95 | Since there are 4 recipes associated with this repository now, the link | ||
281 | 96 | should now read "4 recipes." Let's click through. | ||
282 | 97 | |||
283 | 98 | >>> nopriv_browser.open(repository_url) | ||
284 | 99 | >>> nopriv_browser.getLink('4 recipes').click() | ||
285 | 100 | >>> print nopriv_browser.url | ||
286 | 101 | http://code.launchpad.dev/%7Eperson-name.../product-name.../+git/gitrepository.../+recipes | ||
287 | 102 | |||
288 | 103 | The "Base Source" column should not be shown. | ||
289 | 104 | |||
290 | 105 | >>> print_recipe_listing_head(nopriv_browser) | ||
291 | 106 | Name | ||
292 | 107 | Owner | ||
293 | 108 | Registered | ||
294 | 109 | |||
295 | 110 | The recipe listing page should have a list of all the recipes the repository | ||
296 | 111 | is a base for. | ||
297 | 112 | |||
298 | 113 | >>> print_recipe_listing_contents(nopriv_browser) | ||
299 | 114 | spr-name... Person-name... | ||
300 | 115 | spr-name... Person-name... | ||
301 | 116 | spr-name... Person-name... | ||
302 | 117 | spr-name... Person-name... | ||
303 | 118 | |||
304 | 119 | If we start from one of the branches instead, then only two recipes are | ||
305 | 120 | listed. | ||
306 | 121 | |||
307 | 122 | >>> nopriv_browser.open(ref1_url) | ||
308 | 123 | >>> nopriv_browser.getLink('2 recipes').click() | ||
309 | 124 | >>> print nopriv_browser.url | ||
310 | 125 | http://code.launchpad.dev/%7Eperson-name.../product-name.../+git/gitrepository.../+ref/a/+recipes | ||
311 | 126 | |||
312 | 127 | >>> print_recipe_listing_head(nopriv_browser) | ||
313 | 128 | Name | ||
314 | 129 | Owner | ||
315 | 130 | Registered | ||
316 | 131 | |||
317 | 132 | >>> print_recipe_listing_contents(nopriv_browser) | ||
318 | 67 | spr-name... Person-name... | 133 | spr-name... Person-name... |
319 | 68 | spr-name... Person-name... | 134 | spr-name... Person-name... |
320 | 69 | 135 | ||
321 | @@ -81,7 +147,7 @@ | |||
322 | 81 | >>> print_recipe_listing_head(nopriv_browser) | 147 | >>> print_recipe_listing_head(nopriv_browser) |
323 | 82 | Name | 148 | Name |
324 | 83 | Owner | 149 | Owner |
326 | 84 | Base Branch | 150 | Base Source |
327 | 85 | Registered | 151 | Registered |
328 | 86 | 152 | ||
329 | 87 | The listings should now show all recipes whose base branch is a branch from | 153 | The listings should now show all recipes whose base branch is a branch from |
330 | @@ -92,6 +158,25 @@ | |||
331 | 92 | spr-name... Person-name... lp://dev/... ... | 158 | spr-name... Person-name... lp://dev/... ... |
332 | 93 | spr-name... Person-name... lp://dev/... ... | 159 | spr-name... Person-name... lp://dev/... ... |
333 | 94 | 160 | ||
334 | 161 | The same thing works for the target of the former Git repository test. | ||
335 | 162 | |||
336 | 163 | >>> nopriv_browser.open(target_url) | ||
337 | 164 | >>> nopriv_browser.getLink('View source package recipes').click() | ||
338 | 165 | >>> print nopriv_browser.url | ||
339 | 166 | http://code.launchpad.dev/product-name.../+recipes | ||
340 | 167 | |||
341 | 168 | >>> print_recipe_listing_head(nopriv_browser) | ||
342 | 169 | Name | ||
343 | 170 | Owner | ||
344 | 171 | Base Source | ||
345 | 172 | Registered | ||
346 | 173 | |||
347 | 174 | >>> print_recipe_listing_contents(nopriv_browser) | ||
348 | 175 | spr-name... Person-name... lp:~.../+git/... ... | ||
349 | 176 | spr-name... Person-name... lp:~.../+git/... ... | ||
350 | 177 | spr-name... Person-name... lp:~.../+git/... ... | ||
351 | 178 | spr-name... Person-name... lp:~.../+git/... ... | ||
352 | 179 | |||
353 | 95 | 180 | ||
354 | 96 | Person Recipe Listings | 181 | Person Recipe Listings |
355 | 97 | ====================== | 182 | ====================== |
356 | @@ -115,7 +200,7 @@ | |||
357 | 115 | 200 | ||
358 | 116 | >>> print_recipe_listing_head(nopriv_browser) | 201 | >>> print_recipe_listing_head(nopriv_browser) |
359 | 117 | Name | 202 | Name |
361 | 118 | Base Branch | 203 | Base Source |
362 | 119 | Registered | 204 | Registered |
363 | 120 | 205 | ||
364 | 121 | The listings should now show all recipes whose base branch is a branch from | 206 | The listings should now show all recipes whose base branch is a branch from |
365 | 122 | 207 | ||
366 | === modified file 'lib/lp/code/templates/branch-recipes.pt' | |||
367 | --- lib/lp/code/templates/branch-recipes.pt 2015-10-05 13:36:06 +0000 | |||
368 | +++ lib/lp/code/templates/branch-recipes.pt 2016-01-12 15:24:34 +0000 | |||
369 | @@ -3,7 +3,7 @@ | |||
370 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
371 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
372 | 5 | tal:define="context_menu view/context/menu:context" | 5 | tal:define="context_menu view/context/menu:context" |
374 | 6 | id="related-bugs-and-blueprints"> | 6 | id="related-recipes"> |
375 | 7 | 7 | ||
376 | 8 | <h3>Related source package recipes</h3> | 8 | <h3>Related source package recipes</h3> |
377 | 9 | 9 | ||
378 | 10 | 10 | ||
379 | === modified file 'lib/lp/code/templates/gitref-index.pt' | |||
380 | --- lib/lp/code/templates/gitref-index.pt 2015-09-18 15:41:08 +0000 | |||
381 | +++ lib/lp/code/templates/gitref-index.pt 2016-01-12 15:24:34 +0000 | |||
382 | @@ -7,6 +7,15 @@ | |||
383 | 7 | i18n:domain="launchpad" | 7 | i18n:domain="launchpad" |
384 | 8 | > | 8 | > |
385 | 9 | 9 | ||
386 | 10 | <metal:block fill-slot="head_epilogue"> | ||
387 | 11 | <style type="text/css"> | ||
388 | 12 | #merge-summary, #recipe-summary { | ||
389 | 13 | margin-top: .5em; | ||
390 | 14 | margin-bottom: .1em; | ||
391 | 15 | } | ||
392 | 16 | </style> | ||
393 | 17 | </metal:block> | ||
394 | 18 | |||
395 | 10 | <body> | 19 | <body> |
396 | 11 | 20 | ||
397 | 12 | <tal:registering metal:fill-slot="registering"> | 21 | <tal:registering metal:fill-slot="registering"> |
398 | @@ -24,10 +33,10 @@ | |||
399 | 24 | </div> | 33 | </div> |
400 | 25 | 34 | ||
401 | 26 | <div class="yui-g"> | 35 | <div class="yui-g"> |
404 | 27 | <div id="ref-relations" class="portlet" | 36 | <div id="ref-relations" class="portlet"> |
403 | 28 | tal:condition="python: view.show_merge_links or view.show_snap_information"> | ||
405 | 29 | <tal:ref-pending-merges | 37 | <tal:ref-pending-merges |
406 | 30 | replace="structure context/@@++ref-pending-merges" /> | 38 | replace="structure context/@@++ref-pending-merges" /> |
407 | 39 | <tal:ref-recipes replace="structure context/@@++ref-recipes" /> | ||
408 | 31 | <div metal:use-macro="context/@@+snap-macros/related-snaps" /> | 40 | <div metal:use-macro="context/@@+snap-macros/related-snaps" /> |
409 | 32 | </div> | 41 | </div> |
410 | 33 | </div> | 42 | </div> |
411 | 34 | 43 | ||
412 | === added file 'lib/lp/code/templates/gitref-recipes.pt' | |||
413 | --- lib/lp/code/templates/gitref-recipes.pt 1970-01-01 00:00:00 +0000 | |||
414 | +++ lib/lp/code/templates/gitref-recipes.pt 2016-01-12 15:24:34 +0000 | |||
415 | @@ -0,0 +1,19 @@ | |||
416 | 1 | <div | ||
417 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
418 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
419 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
420 | 5 | id="related-recipes"> | ||
421 | 6 | |||
422 | 7 | <h3>Related source package recipes</h3> | ||
423 | 8 | |||
424 | 9 | <div id="recipe-links" class="actions"> | ||
425 | 10 | <div id="recipe-summary"> | ||
426 | 11 | <img src="/@@/source-package-recipe" /> | ||
427 | 12 | <tal:recipes replace="structure view/recipes_link" /> | ||
428 | 13 | |||
429 | 14 | <a href="/+help-code/related-recipes.html" target="help" | ||
430 | 15 | class="sprite maybe action-icon">(?)</a> | ||
431 | 16 | </div> | ||
432 | 17 | </div> | ||
433 | 18 | |||
434 | 19 | </div> | ||
435 | 0 | 20 | ||
436 | === modified file 'lib/lp/code/templates/gitrepository-index.pt' | |||
437 | --- lib/lp/code/templates/gitrepository-index.pt 2015-12-04 15:48:39 +0000 | |||
438 | +++ lib/lp/code/templates/gitrepository-index.pt 2016-01-12 15:24:34 +0000 | |||
439 | @@ -9,6 +9,10 @@ | |||
440 | 9 | 9 | ||
441 | 10 | <metal:block fill-slot="head_epilogue"> | 10 | <metal:block fill-slot="head_epilogue"> |
442 | 11 | <style type="text/css"> | 11 | <style type="text/css"> |
443 | 12 | #merge-summary, #recipe-summary { | ||
444 | 13 | margin-top: .5em; | ||
445 | 14 | margin-bottom: .1em; | ||
446 | 15 | } | ||
447 | 12 | #clone-url dt { | 16 | #clone-url dt { |
448 | 13 | font-weight: strong; | 17 | font-weight: strong; |
449 | 14 | } | 18 | } |
450 | @@ -41,8 +45,9 @@ | |||
451 | 41 | </div> | 45 | </div> |
452 | 42 | 46 | ||
453 | 43 | <div class="yui-g"> | 47 | <div class="yui-g"> |
456 | 44 | <div id="repository-relations" class="portlet" | 48 | <div id="repository-relations" class="portlet"> |
457 | 45 | tal:condition="view/show_snap_information"> | 49 | <tal:repository-recipes |
458 | 50 | replace="structure context/@@++repository-recipes" /> | ||
459 | 46 | <div metal:use-macro="context/@@+snap-macros/related-snaps"> | 51 | <div metal:use-macro="context/@@+snap-macros/related-snaps"> |
460 | 47 | <metal:context-type fill-slot="context_type">repository</metal:context-type> | 52 | <metal:context-type fill-slot="context_type">repository</metal:context-type> |
461 | 48 | </div> | 53 | </div> |
462 | 49 | 54 | ||
463 | === added file 'lib/lp/code/templates/gitrepository-recipes.pt' | |||
464 | --- lib/lp/code/templates/gitrepository-recipes.pt 1970-01-01 00:00:00 +0000 | |||
465 | +++ lib/lp/code/templates/gitrepository-recipes.pt 2016-01-12 15:24:34 +0000 | |||
466 | @@ -0,0 +1,19 @@ | |||
467 | 1 | <div | ||
468 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
469 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
470 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
471 | 5 | id="related-recipes"> | ||
472 | 6 | |||
473 | 7 | <h3>Related source package recipes</h3> | ||
474 | 8 | |||
475 | 9 | <div id="recipe-links" class="actions"> | ||
476 | 10 | <div id="recipe-summary"> | ||
477 | 11 | <img src="/@@/source-package-recipe" /> | ||
478 | 12 | <tal:recipes replace="structure view/recipes_link" /> | ||
479 | 13 | |||
480 | 14 | <a href="/+help-code/related-recipes.html" target="help" | ||
481 | 15 | class="sprite maybe action-icon">(?)</a> | ||
482 | 16 | </div> | ||
483 | 17 | </div> | ||
484 | 18 | |||
485 | 19 | </div> | ||
486 | 0 | 20 | ||
487 | === modified file 'lib/lp/code/templates/sourcepackagerecipe-listing.pt' | |||
488 | --- lib/lp/code/templates/sourcepackagerecipe-listing.pt 2011-02-23 01:24:09 +0000 | |||
489 | +++ lib/lp/code/templates/sourcepackagerecipe-listing.pt 2016-01-12 15:24:34 +0000 | |||
490 | @@ -15,7 +15,7 @@ | |||
491 | 15 | <tr> | 15 | <tr> |
492 | 16 | <th colspan="2">Name</th> | 16 | <th colspan="2">Name</th> |
493 | 17 | <th tal:condition="view/owner_enabled">Owner</th> | 17 | <th tal:condition="view/owner_enabled">Owner</th> |
495 | 18 | <th tal:condition="view/branch_enabled">Base Branch</th> | 18 | <th tal:condition="view/branch_enabled">Base Source</th> |
496 | 19 | <th>Registered</th> | 19 | <th>Registered</th> |
497 | 20 | </tr> | 20 | </tr> |
498 | 21 | </thead> | 21 | </thead> |
499 | @@ -32,8 +32,8 @@ | |||
500 | 32 | </a> | 32 | </a> |
501 | 33 | </td> | 33 | </td> |
502 | 34 | <td tal:condition="view/branch_enabled"> | 34 | <td tal:condition="view/branch_enabled"> |
505 | 35 | <a tal:replace="structure recipe/base_branch/fmt:link"> | 35 | <a tal:replace="structure recipe/base/fmt:link"> |
506 | 36 | Branch | 36 | Source |
507 | 37 | </a> | 37 | </a> |
508 | 38 | </td> | 38 | </td> |
509 | 39 | <td tal:content="recipe/date_created/fmt:datetime" /> | 39 | <td tal:content="recipe/date_created/fmt:datetime" /> |