Mercurial > libervia-web
comparison libervia/server/pages.py @ 1148:3c7a64adfd42
pages: use absolute path for build_path + added page_url to template (which is getURL() without argument)
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 26 Jan 2019 20:15:24 +0100 |
parents | 02afab1b15c5 |
children | 94f9d81a475e |
comparison
equal
deleted
inserted
replaced
1147:02afab1b15c5 | 1148:3c7a64adfd42 |
---|---|
1114 if self.vhost_root.site_name: | 1114 if self.vhost_root.site_name: |
1115 template_data[u'site'] = self.vhost_root.site_name | 1115 template_data[u'site'] = self.vhost_root.site_name |
1116 | 1116 |
1117 return self.host.renderer.render( | 1117 return self.host.renderer.render( |
1118 self.template, | 1118 self.template, |
1119 page_url=self.getURL(), | |
1119 media_path=u"/" + C.MEDIA_DIR, | 1120 media_path=u"/" + C.MEDIA_DIR, |
1120 cache_path=session_data.cache_dir, | 1121 cache_path=session_data.cache_dir, |
1121 build_path=C.BUILD_DIR + u"/", | 1122 build_path=u"/" + C.BUILD_DIR + u"/", |
1122 main_menu=self.main_menu, | 1123 main_menu=self.main_menu, |
1123 **template_data) | 1124 **template_data) |
1124 | 1125 |
1125 def _renderEb(self, failure_, request): | 1126 def _renderEb(self, failure_, request): |
1126 """don't raise error on CancelError""" | 1127 """don't raise error on CancelError""" |
1312 if self.vhost_root.site_name: | 1313 if self.vhost_root.site_name: |
1313 template_data[u'site'] = self.vhost_root.site_name | 1314 template_data[u'site'] = self.vhost_root.site_name |
1314 | 1315 |
1315 return self.host.renderer.render( | 1316 return self.host.renderer.render( |
1316 template, | 1317 template, |
1317 media_path="/" + C.MEDIA_DIR, | 1318 page_url=self.getURL(), |
1319 media_path=u"/" + C.MEDIA_DIR, | |
1318 cache_path=session_data.cache_dir, | 1320 cache_path=session_data.cache_dir, |
1319 build_path=C.BUILD_DIR + u"/", | 1321 build_path=u"/" + C.BUILD_DIR + u"/", |
1320 main_menu=self.main_menu, | 1322 main_menu=self.main_menu, |
1321 **template_data | 1323 **template_data |
1322 ) | 1324 ) |
1323 | 1325 |
1324 def renderAndUpdate( | 1326 def renderAndUpdate( |