# HG changeset patch # User Sylvain Thénault # Date 1273507611 -7200 # Node ID d3e155cab54258adb62360afbf36a10338af28ea # Parent 6718ba5db0eb0d56f6c00e4b5dbb6e59afb1e822 [css] keep old css according to a configuration variable (true by default) diff -r 6718ba5db0eb -r d3e155cab542 web/webconfig.py --- a/web/webconfig.py Mon May 10 16:59:32 2010 +0200 +++ b/web/webconfig.py Mon May 10 18:06:51 2010 +0200 @@ -208,6 +208,14 @@ 'group': 'web', 'level': 3, }), + ('use-old-css', + {'type' : 'yn', + 'default': True, + 'help': 'use cubicweb.old.css instead of 3.9 cubicweb.css', + 'group': 'web', 'level': 2, + }), + + )) def fckeditor_installed(self): @@ -338,6 +346,14 @@ for path in reversed([self.apphome] + self.cubes_path()): self._load_ui_properties_file(uiprops, path) self._load_ui_properties_file(uiprops, self.apphome) + # XXX pre 3.9 css compat + if self['use-old-css']: + datadir_url = uiprops.context['datadir_url'] + if (datadir_url+'/cubicweb.css') in uiprops['STYLESHEETS']: + idx = uiprops['STYLESHEETS'].index(datadir_url+'/cubicweb.css') + uiprops['STYLESHEETS'][idx] = datadir_url+'/cubicweb.old.css' + if datadir_url+'/cubicweb.reset.css' in uiprops['STYLESHEETS']: + uiprops['STYLESHEETS'].remove(datadir_url+'/cubicweb.reset.css') def _load_ui_properties_file(self, uiprops, path): resourcesfile = join(path, 'data', 'external_resources')