Merge lp:~salgado/launchpad/combined-css into lp:launchpad/db-devel

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: not available
Proposed branch: lp:~salgado/launchpad/combined-css
Merge into: lp:launchpad/db-devel
Diff against target: 319 lines (+77/-107)
11 files modified
.bzrignore (+1/-0)
Makefile (+5/-2)
buildout-templates/bin/combine-css.in (+36/-0)
lib/canonical/launchpad/icing/style.css (+2/-2)
lib/canonical/launchpad/scripts/runlaunchpad.py (+0/-15)
lib/lp/app/templates/base-layout-macros.pt (+6/-68)
lib/lp/bugs/browser/bugtask.py (+4/-2)
lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt (+22/-0)
lib/lp/registry/templates/object-timeline-graph.pt (+0/-2)
scripts/make-static.py (+0/-15)
versions.cfg (+1/-1)
To merge this branch: bzr merge lp:~salgado/launchpad/combined-css
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Review via email: mp+16288@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

This branch uses lazr-js's combine_files() function to combine all our
CSS files into a single one so that browsers can get all the styles
needed in a single request rather than 13.

Revision history for this message
Māris Fogels (mars) wrote :

Hi Salgado,

This is a nice change; it is always good to see so much code getting consolidated. And this will lead to a very nice speed boost for our users.

I assume that the windmill test suite passes? And you have checked the widgets on staging? The Windmill suite can test if JavaScript changed the DOM, but it can not test that a CSS style is being correctly applied: that must still be done manually.

Mars

review: Needs Information
Revision history for this message
Guilherme Salgado (salgado) wrote :

Hi Maris,

I've tried a bunch of different pages that use js widgets and they all
work and seem to have the correct styling. I must admit I didn't run the
windmill tests, though. I'll use Bjorn's branch and run them on ec2
now. Will let you know the results as soon as I have them

Cheers

--
Guilherme Salgado <email address hidden>

Revision history for this message
Māris Fogels (mars) wrote :

As said on IRC:

<salgado> mars, the windmill tests are "passing" on my branch. one of them actually fails, but it's the same one that fails on db-devel
<mars> salgado, ok
<salgado> and the styling looks just like before in a few random pages I picked up, as well as on js widgets
<mars> salgado, ok, the widgets are what I was worried about. You didn't mention what was included in the lazr-js upgrade.
<mars> and we don't have formal releases, and I didn't generate any sort of CHANGELOG :/
<salgado> mars, mostly browser-specific fixes, but there's also a minimal error widget for use with the lazr error api
<mars> ok, so no build system or widget API changes. Good.
<mars> salgado, r=mars then

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2009-11-20 16:56:27 +0000
3+++ .bzrignore 2009-12-18 11:38:11 +0000
4@@ -35,6 +35,7 @@
5 lib/canonical/launchpad/apidoc/wadl-development.xml
6 lib/canonical/launchpad/apidoc/wadl-test-playground.xml
7 lib/canonical/launchpad/icing/build/*
8+lib/canonical/launchpad/icing/combo.css
9 trace.log
10 test-appserver-layer-trace.log
11 bin
12
13=== modified file 'Makefile'
14--- Makefile 2009-12-09 22:32:48 +0000
15+++ Makefile 2009-12-18 11:38:11 +0000
16@@ -109,13 +109,16 @@
17
18 inplace: build
19
20-build: $(BZR_VERSION_INFO) compile apidoc jsbuild
21+build: $(BZR_VERSION_INFO) compile apidoc jsbuild css_combine
22+
23+css_combine:
24+ ${SHHH} bin/combine-css
25
26 jsbuild_lazr:
27 # We absolutely do not want to include the lazr.testing module and its
28 # jsTestDriver test harness modifications in the lazr.js and launchpad.js
29 # roll-up files. They fiddle with built-in functions! See Bug 482340.
30- ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/
31+ ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/ -c $(LAZR_BUILT_JS_ROOT)/yui
32
33 jsbuild: jsbuild_lazr
34 ${SHHH} bin/jsbuild \
35
36=== added file 'buildout-templates/bin/combine-css.in'
37--- buildout-templates/bin/combine-css.in 1970-01-01 00:00:00 +0000
38+++ buildout-templates/bin/combine-css.in 2009-12-18 11:38:11 +0000
39@@ -0,0 +1,36 @@
40+#! /usr/bin/env ${buildout:directory}/bin/py
41+
42+import os
43+
44+from lazr.js.combo import combine_files
45+
46+
47+root = '${buildout:directory}'
48+icing = os.path.join(root, 'lib/canonical/launchpad/icing')
49+# It'd probably be nice to have this script find all the CSS files we might
50+# need and combine them together, but if we do that we'd certainly end up
51+# including lots of styles that we don't need/want, so keeping this hard-coded
52+# list seems like the best option for now.
53+names = [
54+ 'style.css',
55+ 'lazr/build/yui/cssreset/reset.css',
56+ 'lazr/build/yui/cssfonts/fonts.css',
57+ 'lazr/build/yui/cssgrids/grids.css',
58+ 'lazr/build/lazr/assets/skins/sam/lazr.css',
59+ 'lazr/build/inlineedit/assets/skins/sam/editor.css',
60+ 'lazr/build/autocomplete/assets/skins/sam/autocomplete.css',
61+ 'lazr/build/overlay/assets/skins/sam/pretty-overlay.css',
62+ 'lazr/build/formoverlay/assets/formoverlay-core.css',
63+ 'lazr/build/picker/assets/skins/sam/picker.css',
64+ 'lazr/build/activator/assets/skins/sam/activator.css',
65+ 'lazr/build/choiceedit/assets/choiceedit-core.css',
66+ # This one goes at the end because it's our main stylesheet and should
67+ # take precedence over the others.
68+ 'style-3-0.css']
69+result = ''
70+for content in combine_files(names, icing):
71+ result += content
72+
73+f = open(os.path.join(icing, 'combo.css'), 'w')
74+f.write(result)
75+f.close()
76
77=== modified file 'lib/canonical/launchpad/icing/style.css'
78--- lib/canonical/launchpad/icing/style.css 2009-12-08 10:57:44 +0000
79+++ lib/canonical/launchpad/icing/style.css 2009-12-18 11:38:11 +0000
80@@ -1434,12 +1434,12 @@
81
82 #project-cloud-preview a {
83 padding-left: 0.5em;
84- padding-right: 0.5em,
85+ padding-right: 0.5em;
86 }
87
88 #project-tags a {
89 padding-left: 0.5em;
90- padding-right: 0.5em,
91+ padding-right: 0.5em;
92 }
93
94 /* Clouds of links. */
95
96=== modified file 'lib/canonical/launchpad/scripts/runlaunchpad.py'
97--- lib/canonical/launchpad/scripts/runlaunchpad.py 2009-08-12 21:45:06 +0000
98+++ lib/canonical/launchpad/scripts/runlaunchpad.py 2009-12-18 11:38:11 +0000
99@@ -183,18 +183,6 @@
100 }
101
102
103-def make_css_slimmer():
104- import contrib.slimmer
105- inputfile = make_abspath(
106- 'lib/canonical/launchpad/icing/style.css')
107- outputfile = make_abspath(
108- 'lib/canonical/launchpad/icing/+style-slimmer.css')
109-
110- cssdata = open(inputfile, 'rb').read()
111- slimmed = contrib.slimmer.slimmer(cssdata, 'css')
112- open(outputfile, 'w').write(slimmed)
113-
114-
115 def get_services_to_run(requested_services):
116 """Return a list of services (TacFiles) given a list of service names.
117
118@@ -259,9 +247,6 @@
119 # Store our process id somewhere
120 make_pidfile('launchpad')
121
122- # Create a new compressed +style-slimmer.css from style.css in +icing.
123- make_css_slimmer()
124-
125 # Create the ZCML override file based on the instance.
126 config.generate_overrides()
127
128
129=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
130--- lib/lp/app/templates/base-layout-macros.pt 2009-12-08 16:43:44 +0000
131+++ lib/lp/app/templates/base-layout-macros.pt 2009-12-18 11:38:11 +0000
132@@ -43,7 +43,7 @@
133 rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl;
134 icingroot string:${rooturl}+icing/rev${revno};
135 devmode modules/canonical.config/config/devmode;
136- yui string:${icingroot}/yui/current/build;
137+ yui string:${icingroot}/yui;
138 lazr_js string:${icingroot}/lazr/build;
139 lp_js string:${icingroot}/build"
140 >
141@@ -243,80 +243,18 @@
142 </metal:page-javascript>
143
144
145-<metal:launchpad-stylesheet define-macro="launchpad-stylesheet"
146- tal:define="
147- revno modules/canonical.launchpad.versioninfo/revno | string:unknown;
148- rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl;
149- icingroot string:${rooturl}+icing/rev${revno};
150- devmode modules/canonical.config/config/devmode"
151- >
152- <style
153- type="text/css"
154- media="screen, print"
155- tal:condition="not: devmode"
156- tal:content="string:@import url(${icingroot}/+style-slimmer.css);"/>
157- <style
158- type="text/css"
159- media="screen, print"
160- tal:condition="devmode"
161- tal:content="string:@import url(${icingroot}/style.css);"/>
162-
163- <link rel="stylesheet" type="text/css"
164- tal:attributes="href
165- string:${icingroot}/lazr/build/lazr/assets/skins/sam/lazr.css"
166- />
167- <link rel="stylesheet" type="text/css"
168- tal:attributes="href
169- string:${icingroot}/lazr/build/inlineedit/assets/skins/sam/editor.css"
170- />
171- <link rel="stylesheet" type="text/css"
172- tal:attributes="href
173- string:${icingroot}/lazr/build/autocomplete/assets/skins/sam/autocomplete.css"
174- />
175- <link rel="stylesheet" type="text/css"
176- tal:attributes="href
177- string:${icingroot}/lazr/build/overlay/assets/skins/sam/pretty-overlay.css"
178- />
179- <link rel="stylesheet" type="text/css"
180- tal:attributes="href
181- string:${icingroot}/lazr/build/formoverlay/assets/formoverlay.css"
182- />
183- <link rel="stylesheet" type="text/css"
184- tal:attributes="href
185- string:${icingroot}/lazr/build/picker/assets/skins/sam/picker.css"
186- />
187- <link rel="stylesheet" type="text/css"
188- tal:attributes="href
189- string:${icingroot}/lazr/build/activator/assets/skins/sam/activator.css"
190- />
191- <link rel="stylesheet" type="text/css"
192- tal:attributes="href
193- string:${icingroot}/lazr/build/choiceedit/assets/choiceedit-core.css"
194- />
195-</metal:launchpad-stylesheet>
196-
197-
198 <metal:launchpad-stylesheet-3-0 define-macro="launchpad-stylesheet-3-0"
199 tal:define="
200 revno modules/canonical.launchpad.versioninfo/revno | string:unknown;
201 rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl;
202- icingroot string:${rooturl}+icing/rev${revno};
203- yui string:${icingroot}/yui/current/build;
204- devmode modules/canonical.config/config/devmode">
205+ icingroot string:${rooturl}+icing/rev${revno}">
206 <tal:comment replace="nothing">
207- This macro loads the old stylesheet, then the YUI CSS, and finally
208- the new stylesheet.
209+ This macro loads a single css file containing all our stylesheets.
210+ If you need to include a new css file here, add it to
211+ buildout-templates/bin/combine-css.in instead.
212 </tal:comment>
213- <metal:old-style-sheet use-macro="context/@@+base-layout-macros/launchpad-stylesheet" />
214- <link rel="stylesheet" type="text/css"
215- tal:attributes="href string:${yui}/cssreset/reset.css" />
216- <link rel="stylesheet" type="text/css"
217- tal:attributes="href string:${yui}/cssfonts/fonts.css" />
218- <link rel="stylesheet" type="text/css"
219- tal:attributes="href string:${yui}/cssgrids/grids.css" />
220-
221 <style type="text/css" media="screen, print"
222- tal:content="string:@import url(${icingroot}/style-3-0.css);"/>
223+ tal:content="string:@import url(${icingroot}/combo.css);"/>
224 </metal:launchpad-stylesheet-3-0>
225
226
227
228=== modified file 'lib/lp/bugs/browser/bugtask.py'
229--- lib/lp/bugs/browser/bugtask.py 2009-12-12 00:27:49 +0000
230+++ lib/lp/bugs/browser/bugtask.py 2009-12-18 11:38:11 +0000
231@@ -2720,8 +2720,10 @@
232 def hot_bugtasks(self):
233 """Return the 10 most recently updated bugtasks for this target."""
234 params = BugTaskSearchParams(
235- orderby="-date_last_updated", omit_dupes=True, user=self.user)
236- return list(self.context.searchTasks(params)[:10])
237+ orderby="-date_last_updated", omit_dupes=True, user=self.user,
238+ status=any(*UNRESOLVED_BUGTASK_STATUSES))
239+ search = self.context.searchTasks(params)
240+ return list(search[:10])
241
242 @property
243 def addquestion_url(self):
244
245=== modified file 'lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt'
246--- lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt 2009-10-02 15:16:03 +0000
247+++ lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt 2009-12-18 11:38:11 +0000
248@@ -177,3 +177,25 @@
249 #4 Reflow problems... New Medium on 2006-07-14
250 #1 Firefox does no... New Low on 2006-05-19
251
252+
253+Fix released bugs are not shown. We demonstrate this by setting the bugtask
254+for bug 4 to be "Fix released".
255+
256+ >>> from zope.component import getUtility
257+ >>> from lp.bugs.interfaces.bug import BugTaskStatus, IBugSet
258+ >>> from lp.registry.interfaces.person import IPersonSet
259+ >>> login('foo.bar@canonical.com')
260+ >>> bug_4 = getUtility(IBugSet).get(4)
261+ >>> project_owner = getUtility(IPersonSet).getByName('name12')
262+ >>> bug_4.bugtasks[0].transitionToStatus(
263+ ... BugTaskStatus.FIXRELEASED, project_owner)
264+ >>> logout()
265+
266+And then reloading the page. The Fix released bug, bug 4, is no longer shown.
267+
268+ >>> anon_browser.reload()
269+ >>> print extract_text(
270+ ... find_tag_by_id(anon_browser.contents, 'hot-bugs'))
271+ Summary Status Importance Last changed
272+ #5 Firefox install... New Critical on 2006-07-14
273+ #1 Firefox does no... New Low on 2006-05-19
274
275=== modified file 'lib/lp/registry/templates/object-timeline-graph.pt'
276--- lib/lp/registry/templates/object-timeline-graph.pt 2009-12-03 18:33:22 +0000
277+++ lib/lp/registry/templates/object-timeline-graph.pt 2009-12-18 11:38:11 +0000
278@@ -9,8 +9,6 @@
279 i18n:domain="launchpad"
280 >
281 <head>
282- <metal:launchpad-stylesheet
283- use-macro="context/@@+base-layout-macros/launchpad-stylesheet" />
284 <metal:load-javascript
285 use-macro="context/@@+base-layout-macros/load-javascript" />
286 <metal:lp-client-cache
287
288=== removed file 'scripts/make-static.py'
289--- scripts/make-static.py 2009-10-13 14:38:07 +0000
290+++ scripts/make-static.py 1970-01-01 00:00:00 +0000
291@@ -1,15 +0,0 @@
292-#!/usr/bin/python2.5
293-#
294-# Copyright 2009 Canonical Ltd. This software is licensed under the
295-# GNU Affero General Public License version 3 (see the file LICENSE).
296-
297-"""
298-Create static files such as +style-slimmer.css
299-"""
300-
301-import _pythonpath
302-from canonical.launchpad.scripts.runlaunchpad import make_css_slimmer
303-
304-if __name__=="__main__":
305- make_css_slimmer()
306-
307
308=== modified file 'versions.cfg'
309--- versions.cfg 2009-12-11 13:23:47 +0000
310+++ versions.cfg 2009-12-18 11:38:11 +0000
311@@ -31,7 +31,7 @@
312 lazr.smtptest = 1.1
313 lazr.testing = 0.1.1
314 lazr.uri = 1.0.2
315-lazr-js = 0.9dev-r153-1
316+lazr-js = 0.9.2DEV
317 martian = 0.11
318 mechanize = 0.1.11
319 mocker = 0.10.1

Subscribers

People subscribed via source and target branches

to status/vote changes: