344 libuiprops = join(self.shared_dir(), 'data', 'uiprops.py') |
344 libuiprops = join(self.shared_dir(), 'data', 'uiprops.py') |
345 uiprops.load(libuiprops) |
345 uiprops.load(libuiprops) |
346 for path in reversed([self.apphome] + self.cubes_path()): |
346 for path in reversed([self.apphome] + self.cubes_path()): |
347 self._load_ui_properties_file(uiprops, path) |
347 self._load_ui_properties_file(uiprops, path) |
348 self._load_ui_properties_file(uiprops, self.apphome) |
348 self._load_ui_properties_file(uiprops, self.apphome) |
|
349 datadir_url = uiprops.context['datadir_url'] |
349 # XXX pre 3.9 css compat |
350 # XXX pre 3.9 css compat |
350 if self['use-old-css']: |
351 if self['use-old-css']: |
351 datadir_url = uiprops.context['datadir_url'] |
|
352 if (datadir_url+'/cubicweb.css') in uiprops['STYLESHEETS']: |
352 if (datadir_url+'/cubicweb.css') in uiprops['STYLESHEETS']: |
353 idx = uiprops['STYLESHEETS'].index(datadir_url+'/cubicweb.css') |
353 idx = uiprops['STYLESHEETS'].index(datadir_url+'/cubicweb.css') |
354 uiprops['STYLESHEETS'][idx] = datadir_url+'/cubicweb.old.css' |
354 uiprops['STYLESHEETS'][idx] = datadir_url+'/cubicweb.old.css' |
355 if datadir_url+'/cubicweb.reset.css' in uiprops['STYLESHEETS']: |
355 if datadir_url+'/cubicweb.reset.css' in uiprops['STYLESHEETS']: |
356 uiprops['STYLESHEETS'].remove(datadir_url+'/cubicweb.reset.css') |
356 uiprops['STYLESHEETS'].remove(datadir_url+'/cubicweb.reset.css') |
|
357 cubicweb_js_url = datadir_url + '/cubicweb.js' |
|
358 if cubicweb_js_url not in uiprops['JAVASCRIPTS']: |
|
359 uiprops['JAVASCRIPTS'].insert(0, cubicweb_js_url) |
357 |
360 |
358 def _load_ui_properties_file(self, uiprops, path): |
361 def _load_ui_properties_file(self, uiprops, path): |
359 resourcesfile = join(path, 'data', 'external_resources') |
362 resourcesfile = join(path, 'data', 'external_resources') |
360 if exists(resourcesfile): |
363 if exists(resourcesfile): |
361 warn('[3.9] %s file is deprecated, use an uiprops.py file' |
364 warn('[3.9] %s file is deprecated, use an uiprops.py file' |