Hi, thanks David for looking into this!
On Jun 25, 2010, at 00:27 , David Winslow wrote: > Here's what I was thinking for an interim implementation of more > fine-grained JS includes: > http://github.com/dwins/geonode/commit/47f43fa54b87af8e980ec4005afd3023dce545b1 > > btw, if you want to play with this locally, do the following: > git remote add dwins git://github.com/dwins/geonode.git -f > # add 'dwins' as an alias for my github fork. the '-f' means "go ahead > and fetch from that repo now" > git checkout dwins/fewer-includes -b fewer-includes --track > # create a local branch (checkout -b) that you can work on that tracks > my github repo (eg, uses it for pull and merge) Works great, but I have yet to figure out how to switch back to the main branch, and how to do merge in case one branch misses recent changes of the other. > There are two tricks going on here that I just didn't know about when we > wrote the current include system: > > * {{ block.super }} renders the contents of the block that is being > overridden in a {% block foo %} section > * {% include "path" %} renders another template inline > > So now we have four templates that do "something" for including ExtJS, > OpenLayers, GeoExt, and gxp + geonode's custom stuff, and can > selectively include whichever ones are needed in a page. This makes the whole template story much clearer! > Playing with this exposed a couple of problems: lang.js doesn't > gracefully degrade when GeoExplorer is not in scope, Good point. I have fixed this on trunk for all namespaces. Checking for GeoExplorer will fail, we have to check for window.GeoExplorer instead. > and a number of our > other-wise non-spatial components are dependent upon GeoExt for similar > reasons. An example is the AME file upload dialog. I think there should also be a template for ux. Right now the gxp template loads gxp and ux resources. In the case of AME upload, only ux is required, but not gxp. > Anyway, just wanted to get some opinions before digging further on it. My opinion? dwins++, and this is definitely the way to go. Thanks! Andreas. > > -- > David Winslow > OpenGeo - http://opengeo.org/ > >> Actually it's somewhat complicated to do and still support switching >> between minified and not. Ariel has some ideas for improving the >> situation (based on a Django extension: >> http://code.google.com/p/django-compress/) but I think some discussion >> is in order. In the meantime, I'll take a stab at just breaking things >> up a bit more with our current setup. >> >> >>> I think these two things are easy to fix for the more Django savvy team >>> members. If you feel like wanting to take this on and have questions, >>> please don't hesitate to contact me. >>> >>> -Andreas. >>> >>> [1] http://bit.ly/aov6xp >>> >>> > > -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers.
