comparison libervia/server/pages.py @ 1305:db9ea167c409

pages: `profile` is now exposed to scripts
author Goffi <goffi@goffi.org>
date Thu, 16 Jul 2020 09:08:50 +0200
parents 70e3341d25bf
children a7ab4d244982
comparison
equal deleted inserted replaced
1304:70e3341d25bf 1305:db9ea167c409
951 """Add to template_data if suitable 951 """Add to template_data if suitable
952 952
953 "previous_page_url" and "next_page_url" will be added using respectively 953 "previous_page_url" and "next_page_url" will be added using respectively
954 "before" and "after" URL parameters 954 "before" and "after" URL parameters
955 @param request(server.Request): current HTTP request 955 @param request(server.Request): current HTTP request
956 @param pubsub_data(dict): pubsub metadata parsed with 956 @param pubsub_data(dict): pubsub metadata
957 data_objects.parsePubSubMetadata
958 """ 957 """
959 template_data = request.template_data 958 template_data = request.template_data
960 try: 959 try:
961 rsm = pubsub_data["rsm"] 960 rsm = pubsub_data["rsm"]
962 last_id = rsm["last"] 961 last_id = rsm["last"]
1396 template_data[key] = value 1395 template_data[key] = value
1397 1396
1398 theme = session_data.theme or self.default_theme 1397 theme = session_data.theme or self.default_theme
1399 self.exposeToScripts( 1398 self.exposeToScripts(
1400 request, 1399 request,
1401 templates_root_url=str(self.vhost_root.getFrontURL(theme))) 1400 templates_root_url=str(self.vhost_root.getFrontURL(theme)),
1401 profile=session_data.profile)
1402 1402
1403 return self.host.renderer.render( 1403 return self.host.renderer.render(
1404 self.template, 1404 self.template,
1405 theme=theme, 1405 theme=theme,
1406 site_themes=self.site_themes, 1406 site_themes=self.site_themes,