diff libervia/web/server/pages.py @ 1580:08342aca8c1e

pages: make `tz_data` always available as template data and exposed to scripts
author Goffi <goffi@goffi.org>
date Tue, 28 Nov 2023 17:52:09 +0100
parents 66c1a90da1bc
children 291a7026cb2b
line wrap: on
line diff
--- a/libervia/web/server/pages.py	Wed Nov 22 16:31:36 2023 +0100
+++ b/libervia/web/server/pages.py	Tue Nov 28 17:52:09 2023 +0100
@@ -1406,7 +1406,9 @@
             request,
             cache_path=session_data.cache_dir,
             templates_root_url=str(self.vhost_root.get_front_url(theme)),
-            profile=session_data.profile)
+            profile=session_data.profile,
+            tz_name=template_data["tz_name"]
+        )
 
         uri = request.uri.decode()
         try:
@@ -1676,7 +1678,8 @@
                 # is used because the page may be cached, and the token then leaked
                 "csrf_token": "" if profile is None else session_data.csrf_token,
                 "session_uuid": "public" if profile is None else session_data.uuid,
-                "breadcrumbs": []
+                "breadcrumbs": [],
+                "tz_name": time.tzname[0]
             }
 
             # XXX: here is the code which need to be executed once