annotate libervia/pages/login/logged/page_meta.py @ 1124:28e3eb3bb217

files reorganisation and installation rework: - files have been reorganised to follow other SàT projects and usual Python organisation (no more "/src" directory) - VERSION file is now used, as for other SàT projects - replace the overcomplicated setup.py be a more sane one. Pyjamas part is not compiled anymore by setup.py, it must be done separatly - removed check for data_dir if it's empty - installation tested working in virtual env - libervia launching script is now in bin/libervia
author Goffi <goffi@goffi.org>
date Sat, 25 Aug 2018 17:59:48 +0200
parents src/pages/login/logged/page_meta.py@cdd389ef97bc
children 29eb15062416
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
963
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/env python2.7
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
3
1102
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
4 from libervia.server import session_iface
963
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
5 from sat.core.log import getLogger
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1102
diff changeset
6
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1102
diff changeset
7 log = getLogger("pages/login")
963
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
8
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
9 """SàT log-in page, with link to create an account"""
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
10
2932170bb526 pages: added login/logged and register pages
Goffi <goffi@goffi.org>
parents:
diff changeset
11 template = u"login/logged.html"
1102
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
12
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
13
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
14 def prepare_render(self, request):
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
15 template_data = request.template_data
8b70c838ed14 login (logged): set guest_session and session_started template variables
Goffi <goffi@goffi.org>
parents: 994
diff changeset
16 session_data = self.host.getSessionData(request, session_iface.ISATSession)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1102
diff changeset
17 template_data["guest_session"] = session_data.guest
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1102
diff changeset
18 template_data["session_started"] = session_data.started