misuzu/templates/auth/auth.twig

64 lines
2.4 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'auth/master.twig' %}
2018-10-22 19:53:21 +00:00
{% from 'macros.twig' import container_title %}
{% from '_layout/input.twig' import input_hidden, input_csrf, input_text %}
{% from 'auth/macros.twig' import auth_login %}
2018-03-22 02:56:41 +00:00
{% block content %}
{{ auth_login(
auth_username|default(''),
auth_register_message|default(auth_login_error|default('')),
auth_register_message is defined,
auth_redirect|default('/'),
auth_mode == 'login'
) }}
{% if can_create_account %}
<form class="container auth" method="post" action="">
{{ input_hidden('auth[mode]', 'register') }}
{{ input_csrf('register') }}
2018-10-02 19:16:42 +00:00
2018-10-22 19:53:21 +00:00
{{ container_title('Register') }}
{% if auth_register_error is defined %}
<div class="warning auth__warning">
<div class="warning__content">
{{ auth_register_error }}
</div>
</div>
{% endif %}
<div class="auth__form">
{{ input_text('auth[username]', 'auth__input', auth_username|default(''), 'text', 'Username', true, null, 0, auth_mode == 'register') }}
{{ input_text('auth[password]', 'auth__input', '', 'password', 'Password', true) }}
{{ input_text('auth[email]', 'auth__input', auth_email|default(''), 'text', 'E-mail', true) }}
{{ input_text('auth[meow]', 'auth__input', '', 'text', 'What is the outcome of nine plus ten?', true) }}
2018-09-30 21:24:15 +00:00
<button class="input__button">Sign up</button>
2018-03-22 02:56:41 +00:00
</div>
</form>
{% endif %}
{% if can_reset_password %}
<form class="container auth" method="post" action="">
{{ input_hidden('auth[mode]', 'forgot') }}
{{ input_csrf('passforgot') }}
2018-10-02 19:16:42 +00:00
2018-10-22 19:53:21 +00:00
{{ container_title('Forgot password') }}
{% if auth_forgot_error is defined %}
<div class="warning auth__warning">
<div class="warning__content">
{{ auth_forgot_error }}
</div>
</div>
{% endif %}
<div class="auth__form">
{{ input_text('auth[email]', 'auth__input', auth_email|default(''), 'text', 'E-mail', true, null, 0, auth_mode == 'forgot') }}
<button class="input__button">Send reminder</button>
</div>
</form>
{% endif %}
2018-03-22 02:56:41 +00:00
{% endblock %}