from template.template import Template
class LoginTemplate(Template):
def wrap(self, answer):
register = ''
if answer.request.model.users.can_create():
register = self.make_link(answer, ['user_create'], 'Register')
return '''
<div class="login">
<form method="POST">
<input type="hidden" name="action" value="user.login" />
<span class="login">
''' + answer.te('Username:') + '''
<input type="text" name="login" />
</span>
<span class="password">
''' + answer.te('Password:') + '''
<input type="password" name="password" />
</span>
<input type="submit" value="''' + answer.te('Login') + '''" />
''' + register + '''
</form>
</div>
'''