comparison libervia/server/pages.py @ 1293:de3b15d68bb6

pages: expose `templates_root_url` to scripts
author Goffi <goffi@goffi.org>
date Fri, 19 Jun 2020 16:47:51 +0200
parents 63328c793a9e
children 44da7b118b02
comparison
equal deleted inserted replaced
1292:e30e96958fb7 1293:de3b15d68bb6
1386 if "template" in data_common: 1386 if "template" in data_common:
1387 for key, value in data_common["template"].items(): 1387 for key, value in data_common["template"].items():
1388 if key not in template_data: 1388 if key not in template_data:
1389 template_data[key] = value 1389 template_data[key] = value
1390 1390
1391 theme = session_data.theme or self.default_theme
1392 self.exposeToScripts(
1393 request,
1394 templates_root_url=str(self.vhost_root.getFrontURL(theme)))
1395
1391 return self.host.renderer.render( 1396 return self.host.renderer.render(
1392 self.template, 1397 self.template,
1393 theme=session_data.theme or self.default_theme, 1398 theme=theme,
1394 site_themes=self.site_themes, 1399 site_themes=self.site_themes,
1395 page_url=self.getURL(), 1400 page_url=self.getURL(),
1396 media_path=f"/{C.MEDIA_DIR}", 1401 media_path=f"/{C.MEDIA_DIR}",
1397 cache_path=session_data.cache_dir, 1402 cache_path=session_data.cache_dir,
1398 build_path=f"/{C.BUILD_DIR}/", 1403 build_path=f"/{C.BUILD_DIR}/",