Merge lp:~julian-edwards/launchpad/mechanical-30-ui-changes-5 into lp:launchpad
- mechanical-30-ui-changes-5
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Barry Warsaw |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~julian-edwards/launchpad/mechanical-30-ui-changes-5 |
Merge into: | lp:launchpad |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~julian-edwards/launchpad/mechanical-30-ui-changes-5 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Barry Warsaw (community) | code ui | Approve | |
Review via email:
|
Commit message
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Julian Edwards (julian-edwards) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Barry Warsaw (barry) wrote : | # |
review approve code ui
status approve
On Aug 21, 2009, at 04:05 PM, Julian Edwards wrote:
>https:/
Hi Julian,
As mentioned on IRC, I have a few ui comments. My UI review must be seconded
by a ui mentor. Here are the things I noticed:
* Wrapping the "1" in "This archive contains 1 software packages" in a
<bold class="
* Removing the info icon and "Show" prefix from the navmenu. However,
because it is too expensive at this late date to retrofit all the already
converted pages, we've decided to leave this the way it is.
* The +builds page batch navigation shouldn't show the navbar when there is
only one page of results, but this is out-of-scope for this branch
* The placement of the "This archive contains" text to above the search box
instead of below it, in normal narrative text
Other than these small issues, the ui looks great. I have only minor comments
about the code, so r=me, ui=me. merge-conditional
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
> @@ -591,7 +591,7 @@
> <browser:menus
> module=
> classes="
> - DistroArchSerie
> + DistroArchSerie
When I was making similar changes, I ended up putting the "/> on a separate
line underneath the first letter of the menu name. It made it much easier to
sort the lines alphabetically later. You only have one class in this case, so
I'll leave it up to you, but I just wanted to share that :).
> <browser:url
> for="lp.
> path_expression
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
> @@ -4,14 +4,17 @@
> __metaclass__ = type
>
> __all__ = [
> + 'DistroArchSeri
> 'DistroArchSeri
> 'DistroArchSeri
> 'DistroArchSeri
> - 'DistroArchSeri
> 'DistroArchSeri
> 'DistroArchSeri
> ]
>
> +from zope.component import provideAdapter
> +from zope.interface import implements, Interface
> +
> from canonical.launchpad import _
> from lp.soyuz.
> from canonical.
> @@ -20,8 +23,9 @@
> GetitemNavigation, LaunchpadEditFo
> from canonical.
> action, LaunchpadFormView)
> +from canonical.
> from canonical.
> - ContextMenu, enabled_
> + ContextMenu, enabled_
> from canonical.
> from canonical.
>
...
Preview Diff
1 | === modified file 'lib/lp/soyuz/browser/configure.zcml' |
2 | --- lib/lp/soyuz/browser/configure.zcml 2009-08-19 02:58:06 +0000 |
3 | +++ lib/lp/soyuz/browser/configure.zcml 2009-08-21 15:29:49 +0000 |
4 | @@ -591,7 +591,7 @@ |
5 | <browser:menus |
6 | module="lp.soyuz.browser.distroarchseries" |
7 | classes=" |
8 | - DistroArchSeriesContextMenu"/> |
9 | + DistroArchSeriesActionMenu"/> |
10 | <browser:url |
11 | for="lp.soyuz.interfaces.distroarchseries.IDistroArchSeries" |
12 | path_expression="architecturetag" |
13 | @@ -614,22 +614,19 @@ |
14 | name="+builds" |
15 | facet="overview" |
16 | template="../templates/distroarchseries-builds.pt"/> |
17 | - <browser:page |
18 | - name="+builds-list" |
19 | - template="../templates/builds-list.pt"/> |
20 | </browser:pages> |
21 | <browser:page |
22 | + permission="zope.Public" |
23 | + for="lp.soyuz.interfaces.distroarchseries.IDistroArchSeries" |
24 | + class="lp.soyuz.browser.distroarchseries.DistroArchSeriesBuildsView" |
25 | + name="+builds-list" |
26 | + template="../templates/builds-list.pt"/> |
27 | + <browser:page |
28 | for="lp.soyuz.interfaces.distroarchseries.IDistroArchSeries" |
29 | name="+macros" |
30 | permission="zope.Public" |
31 | template="../../registry/templates/packagesearch-macros.pt"/> |
32 | <browser:page |
33 | - for="lp.soyuz.interfaces.distroarchseries.IDistroArchSeries" |
34 | - permission="zope.Public" |
35 | - name="+search" |
36 | - class="lp.soyuz.browser.distroarchseries.DistroArchSeriesPackageSearchView" |
37 | - template="../templates/distroarchseries-search.pt"/> |
38 | - <browser:page |
39 | name="+admin" |
40 | for="lp.soyuz.interfaces.distroarchseries.IDistroArchSeries" |
41 | class="lp.soyuz.browser.distroarchseries.DistroArchSeriesAdminView" |
42 | |
43 | === modified file 'lib/lp/soyuz/browser/distroarchseries.py' |
44 | --- lib/lp/soyuz/browser/distroarchseries.py 2009-08-18 18:17:25 +0000 |
45 | +++ lib/lp/soyuz/browser/distroarchseries.py 2009-08-21 15:29:49 +0000 |
46 | @@ -4,14 +4,17 @@ |
47 | __metaclass__ = type |
48 | |
49 | __all__ = [ |
50 | + 'DistroArchSeriesActionMenu', |
51 | 'DistroArchSeriesAddView', |
52 | 'DistroArchSeriesAdminView', |
53 | 'DistroArchSeriesPackageSearchView', |
54 | - 'DistroArchSeriesContextMenu', |
55 | 'DistroArchSeriesNavigation', |
56 | 'DistroArchSeriesView', |
57 | ] |
58 | |
59 | +from zope.component import provideAdapter |
60 | +from zope.interface import implements, Interface |
61 | + |
62 | from canonical.launchpad import _ |
63 | from lp.soyuz.browser.build import BuildRecordsView |
64 | from canonical.launchpad.browser.packagesearch import PackageSearchViewBase |
65 | @@ -20,8 +23,9 @@ |
66 | GetitemNavigation, LaunchpadEditFormView) |
67 | from canonical.launchpad.webapp.launchpadform import ( |
68 | action, LaunchpadFormView) |
69 | +from canonical.launchpad.webapp.interfaces import INavigationMenu |
70 | from canonical.launchpad.webapp.menu import ( |
71 | - ContextMenu, enabled_with_permission, Link) |
72 | + ContextMenu, enabled_with_permission, Link, NavigationMenu) |
73 | from canonical.launchpad.webapp.publisher import canonical_url |
74 | from canonical.lazr.utils import smartquote |
75 | |
76 | @@ -31,9 +35,15 @@ |
77 | usedfor = IDistroArchSeries |
78 | |
79 | |
80 | -class DistroArchSeriesContextMenu(ContextMenu): |
81 | - |
82 | - usedfor = IDistroArchSeries |
83 | +class IDistroArchSeriesActionMenu(Interface): |
84 | + """Marker interface for the action menu.""" |
85 | + |
86 | + |
87 | +class DistroArchSeriesActionMenu(NavigationMenu): |
88 | + """Action menu for distro arch series.""" |
89 | + usedfor = IDistroArchSeriesActionMenu |
90 | + facet = "overview" |
91 | + title = "Actions" |
92 | links = ['admin', 'builds'] |
93 | |
94 | @enabled_with_permission('launchpad.Admin') |
95 | @@ -49,10 +59,6 @@ |
96 | return Link('+builds', text, icon='info') |
97 | |
98 | |
99 | -class DistroArchSeriesView(BuildRecordsView): |
100 | - """Default DistroArchSeries view class.""" |
101 | - |
102 | - |
103 | class DistroArchSeriesPackageSearchView(PackageSearchViewBase): |
104 | """Customised PackageSearchView for DistroArchSeries""" |
105 | |
106 | @@ -61,6 +67,16 @@ |
107 | return self.context.searchBinaryPackages(self.text) |
108 | |
109 | |
110 | +class DistroArchSeriesView(BuildRecordsView, |
111 | + DistroArchSeriesPackageSearchView): |
112 | + """Default DistroArchSeries view class.""" |
113 | + implements(IDistroArchSeriesActionMenu) |
114 | + |
115 | + |
116 | +class DistroArchSeriesBuildsView(BuildRecordsView): |
117 | + """View for +builds on a distro arch series.""" |
118 | + |
119 | + |
120 | class DistroArchSeriesAddView(LaunchpadFormView): |
121 | |
122 | schema = IDistroArchSeries |
123 | |
124 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt' |
125 | --- lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt 2009-08-17 13:10:51 +0000 |
126 | +++ lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt 2009-08-21 15:48:52 +0000 |
127 | @@ -25,6 +25,11 @@ |
128 | Ubuntu Warty for i386 |
129 | Search binary packages |
130 | This archive contains 5 software packages. |
131 | + Details for Ubuntu Warty i386 |
132 | + Architecture tag: i386 |
133 | + Processor family: Intel 386 compatible chips |
134 | + Port registrant: Mark Shuttleworth |
135 | + 5 binary packages |
136 | |
137 | |
138 | == Searching BinaryPackages == |
139 | @@ -38,7 +43,7 @@ |
140 | >>> anon_browser.getControl(name="text").value = "firefox" |
141 | >>> anon_browser.getControl("Search Packages").click() |
142 | >>> anon_browser.url |
143 | - 'http://launchpad.dev/ubuntu/warty/i386/+search?text=firefox' |
144 | + 'http://launchpad.dev/ubuntu/warty/i386/+index?text=firefox' |
145 | |
146 | Searching for "firefox" finds several binary packages. Each search |
147 | result is displayed as the binary package name followed by the binary |
148 | @@ -68,15 +73,16 @@ |
149 | All users can browse to the builds page from the DistroArchSeries |
150 | page. The builds page is described in 23-builds-page.txt. |
151 | |
152 | - >>> print extract_text(find_tag_by_id(anon_browser.contents, 'actions')) |
153 | - Administer (disabled) |
154 | + >>> print extract_text( |
155 | + ... find_tag_by_id(anon_browser.contents, 'global-actions')) |
156 | Show builds |
157 | |
158 | Only administrators can edit ('administer', in fact) the |
159 | distroarchseries details. |
160 | |
161 | >>> admin_browser.open("http://launchpad.dev/ubuntu/warty/i386/") |
162 | - >>> print extract_text(find_tag_by_id(admin_browser.contents, 'actions')) |
163 | + >>> print extract_text( |
164 | + ... find_tag_by_id(admin_browser.contents, 'global-actions')) |
165 | Administer |
166 | Show builds |
167 | |
168 | |
169 | === modified file 'lib/lp/soyuz/templates/distroarchseries-index.pt' |
170 | --- lib/lp/soyuz/templates/distroarchseries-index.pt 2009-07-17 17:59:07 +0000 |
171 | +++ lib/lp/soyuz/templates/distroarchseries-index.pt 2009-08-21 15:29:49 +0000 |
172 | @@ -3,19 +3,13 @@ |
173 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
174 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
175 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
176 | - xml:lang="en" |
177 | - lang="en" |
178 | - dir="ltr" |
179 | - metal:use-macro="context/@@main_template/master" |
180 | + metal:use-macro="view/macro:page/main_side" |
181 | i18n:domain="launchpad" |
182 | > |
183 | <body> |
184 | |
185 | -<metal:portlets fill-slot="portlets"> |
186 | - <div tal:replace="structure context/@@+portlet-details" /> |
187 | -</metal:portlets> |
188 | |
189 | -<div metal:fill-slot="main" |
190 | +<div metal:fill-slot="heading" |
191 | tal:define="distroseries context/distroseries; |
192 | distro distroseries/distribution"> |
193 | |
194 | @@ -25,26 +19,42 @@ |
195 | <tal:series replace="distroseries/displayname">3.1</tal:series> for |
196 | <tal:arch replace="context/architecturetag">i386</tal:arch> |
197 | </h1> |
198 | - |
199 | - <h2>Search binary packages</h2> |
200 | - |
201 | - <form name="search" action="+search" method="GET"> |
202 | - |
203 | - <input type="text" |
204 | - name="text" |
205 | - size="35" |
206 | - tal:attributes="value request/text|nothing" /> |
207 | - |
208 | - <input type="submit" value="Search Packages"/> |
209 | - |
210 | - </form> |
211 | - |
212 | - <p class="discreet"> |
213 | - This archive contains |
214 | - <tal:count replace="context/package_count">bazillions of</tal:count> software packages. |
215 | - </p> |
216 | - |
217 | -</div> |
218 | +</div> |
219 | + |
220 | +<div metal:fill-slot="side"> |
221 | + <tal:menu replace="structure view/@@+global-actions" /> |
222 | +</div> |
223 | + |
224 | +<div metal:fill-slot="main"> |
225 | + |
226 | + <div class="top-portlet"> |
227 | + <h2>Search binary packages</h2> |
228 | + |
229 | + <form name="search" method="GET"> |
230 | + |
231 | + <input type="text" |
232 | + name="text" |
233 | + size="35" |
234 | + tal:attributes="value request/text|nothing" /> |
235 | + |
236 | + <input type="submit" value="Search Packages"/> |
237 | + |
238 | + </form> |
239 | + |
240 | + <p class="discreet"> |
241 | + This archive contains |
242 | + <tal:count replace="context/package_count">bazillions of</tal:count> software packages. |
243 | + </p> |
244 | + </div><!--portlet--> |
245 | + |
246 | + <metal:package-search use-macro="context/@@+macros/search-results" /> |
247 | + |
248 | + <tal:details condition="not: view/search_requested" |
249 | + replace="structure context/@@+portlet-details" /> |
250 | + |
251 | + |
252 | + |
253 | +</div><!--metal--> |
254 | |
255 | </body> |
256 | </html> |
257 | |
258 | === removed file 'lib/lp/soyuz/templates/distroarchseries-search.pt' |
259 | --- lib/lp/soyuz/templates/distroarchseries-search.pt 2009-07-17 17:59:07 +0000 |
260 | +++ lib/lp/soyuz/templates/distroarchseries-search.pt 1970-01-01 00:00:00 +0000 |
261 | @@ -1,48 +0,0 @@ |
262 | -<html |
263 | - xmlns="http://www.w3.org/1999/xhtml" |
264 | - xmlns:tal="http://xml.zope.org/namespaces/tal" |
265 | - xmlns:metal="http://xml.zope.org/namespaces/metal" |
266 | - xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
267 | - xml:lang="en" |
268 | - lang="en" |
269 | - dir="ltr" |
270 | - metal:use-macro="context/@@main_template/master" |
271 | - i18n:domain="launchpad" |
272 | -> |
273 | - <body> |
274 | - <metal:portlets fill-slot="portlets"> |
275 | - <div tal:replace="structure context/@@+portlet-details" /> |
276 | - </metal:portlets> |
277 | - |
278 | -<div metal:fill-slot="main"> |
279 | - <h1>Binary package search results</h1> |
280 | - |
281 | - <form name="search" method="GET"> |
282 | - <div> |
283 | - <div> |
284 | - <label for="name">Find binary packages in |
285 | - <span tal:replace="context/title" /> |
286 | - matching: |
287 | - </label> |
288 | - </div> |
289 | - <div> |
290 | - <input type="text" |
291 | - name="text" |
292 | - size="35" |
293 | - tal:attributes="value request/text|nothing" |
294 | - /> |
295 | - <input type="submit" value="Search"/> |
296 | - </div> |
297 | - <div class="discreet"> |
298 | - Includes package names and descriptions. |
299 | - </div> |
300 | - </div> |
301 | - </form> |
302 | - |
303 | - <metal:package-search use-macro="context/@@+macros/search-results" /> |
304 | - |
305 | -</div> |
306 | - |
307 | -</body> |
308 | - |
309 | -</html> |
= Summary =
Convert distroarchseries page index to 3.0
== Implementation details ==
The +search template 95% duplicated the +index template, so I deleted it and
moved the search functionality into the index page.
Talked to beuno about where to put the details portlet. Consensus was to have
it below the search form, but to disappear if search results were present.
== Tests ==
bin/test -vvt stories.soyuz
== Demo and Q/A == /launchpad. dev/ubuntu/ hoary/i386/
https:/
Please ignore this lint. Seeing the warning after I've typed this email out
is extremely irritating, so it'll be fixed after this MP appears.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: soyuz/templates /distroarchseri es-index. pt soyuz/stories/ soyuz/xx- distroarchserie s.txt soyuz/browser/ configure. zcml soyuz/browser/ distroarchserie s.py
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pyflakes notices ==
lib/lp/ soyuz/browser/ distroarchserie s.py
15: 'provideAdapter' imported but unused
26: 'INavigationMenu' imported but unused
27: 'ContextMenu' imported but unused
== Pylint notices ==
lib/lp/ soyuz/browser/ distroarchserie s.py
26: [W0611] Unused import INavigationMenu
15: [W0611] Unused import provideAdapter
27: [W0611] Unused import ContextMenu