From a5aad9ad26388ba0865015cd2be8eb6eb0b8bb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Bokros?= Date: Mon, 27 Nov 2017 18:11:20 +0100 Subject: [PATCH] Add Login UIModule --- src/app/templates/module-login.html | 17 +++++++++++++++++ src/app/ui_modules/__init__.py | 1 + src/app/ui_modules/login.py | 11 +++++++++++ 3 files changed, 29 insertions(+) create mode 100644 src/app/templates/module-login.html create mode 100644 src/app/ui_modules/login.py diff --git a/src/app/templates/module-login.html b/src/app/templates/module-login.html new file mode 100644 index 0000000..fb766fb --- /dev/null +++ b/src/app/templates/module-login.html @@ -0,0 +1,17 @@ +

Login page

+
+ {% for type_, id_, label, placeholder in form_data %} +
+ + + +
+ {% end %} + +
\ No newline at end of file diff --git a/src/app/ui_modules/__init__.py b/src/app/ui_modules/__init__.py index 92a2f16..f4a7c5e 100644 --- a/src/app/ui_modules/__init__.py +++ b/src/app/ui_modules/__init__.py @@ -1 +1,2 @@ from .logger import Logger +from .login import Login diff --git a/src/app/ui_modules/login.py b/src/app/ui_modules/login.py new file mode 100644 index 0000000..91b520f --- /dev/null +++ b/src/app/ui_modules/login.py @@ -0,0 +1,11 @@ +from tornado.web import UIModule + + +class Login(UIModule): + def render(self, anchor_id, form_data=None): + if form_data is None: + form_data = ( + ('email', 'email_input', 'Email address', 'Enter email'), + ('password', 'password_input', 'Password', 'Password'), + ) + return self.render_string('module-login.html', anchor_id=anchor_id, form_data=form_data)