Add Login UIModule

This commit is contained in:
Bálint Bokros 2017-11-27 18:11:20 +01:00
parent b96c8e4457
commit a5aad9ad26
3 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<h1>Login page</h1>
<form id="{{ anchor_id }}_event"
action="/login"
method="post">
{% for type_, id_, label, placeholder in form_data %}
<div class="form-group">
<label for="{{ id_ }}">{{ label }}</label>
<input type="{{ type_ }}"
class="form-control"
id="{{ id_ }}"
name="{{ id_.replace('_input', '') }}"
placeholder="{{ placeholder }}">
</div>
{% end %}
<button type="submit" class="btn btn-primary">Submit</button>
</form>

View File

@ -1 +1,2 @@
from .logger import Logger
from .login import Login

View File

@ -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)