Mercurial > libervia-web
comparison libervia/server/pages.py @ 1266:6b7f9c3558cc
server, pages: better identities handling:
- own identity is now retrieve on connection
- use session identities all the time, fixed pages where an empty dict was used
- identities and own_jid are alway set in template_data for normal rendering
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 19 May 2020 11:02:32 +0200 |
parents | 92ff09cdd6dd |
children | b5f920845d34 |
comparison
equal
deleted
inserted
replaced
1265:24e2973378f6 | 1266:6b7f9c3558cc |
---|---|
1306 def _render_template(self, __, request): | 1306 def _render_template(self, __, request): |
1307 template_data = request.template_data | 1307 template_data = request.template_data |
1308 | 1308 |
1309 # if confirm variable is set in case of successfuly data post | 1309 # if confirm variable is set in case of successfuly data post |
1310 session_data = self.host.getSessionData(request, session_iface.ISATSession) | 1310 session_data = self.host.getSessionData(request, session_iface.ISATSession) |
1311 template_data['identities'] = session_data.identities | |
1311 if session_data.popPageFlag(self, C.FLAG_CONFIRM): | 1312 if session_data.popPageFlag(self, C.FLAG_CONFIRM): |
1312 template_data["confirm"] = True | 1313 template_data["confirm"] = True |
1313 notifs = session_data.popPageNotifications(self) | 1314 notifs = session_data.popPageNotifications(self) |
1314 if notifs: | 1315 if notifs: |
1315 template_data["notifications"] = notifs | 1316 template_data["notifications"] = notifs |
1317 if session_data.jid is not None: | |
1318 template_data["own_jid"] = session_data.jid | |
1316 if session_data.locale is not None: | 1319 if session_data.locale is not None: |
1317 template_data['locale'] = session_data.locale | 1320 template_data['locale'] = session_data.locale |
1318 if self.vhost_root.site_name: | 1321 if self.vhost_root.site_name: |
1319 template_data['site'] = self.vhost_root.site_name | 1322 template_data['site'] = self.vhost_root.site_name |
1320 if self.dyn_data: | 1323 if self.dyn_data: |