39 lines
1.6 KiB
Twig
39 lines
1.6 KiB
Twig
{% macro auth_login(username, message, is_welcome, redirect, autofocus) %}
|
|
{% set is_welcome = is_welcome|default(false) %}
|
|
{% set autofocus = autofocus|default(false) %}
|
|
|
|
{% from '_layout/input.twig' import input_hidden, input_csrf, input_text %}
|
|
|
|
<form class="container auth js-login-form" method="post" action="{{ url('auth-login') }}">
|
|
{{ input_hidden('auth[mode]', 'login') }}
|
|
{{ input_csrf('login') }}
|
|
|
|
{% if redirect|length > 0 %}
|
|
{{ input_hidden('auth[redirect]', redirect) }}
|
|
{% endif %}
|
|
|
|
<div class="container__title">
|
|
<div class="container__title__background"></div>
|
|
<div class="auth__header">
|
|
<div class="avatar auth__avatar js-login-avatar" style="background-image:url('{{ url('user-avatar') }}');"></div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if message|length > 0 %}
|
|
<div class="warning auth__warning{% if is_welcome %} auth__warning--welcome{% endif %}">
|
|
<div class="warning__content">
|
|
{{ message }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="auth__form">
|
|
{{ input_text('auth[username]', 'auth__input js-login-username', username|default(''), 'text', 'Username', true, null, 0, autofocus) }}
|
|
{{ input_text('auth[password]', 'auth__input', '', 'password', 'Password', true, null) }}
|
|
|
|
<div class="auth__buttons">
|
|
<button class="input__button auth__button">Log in</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
{% endmacro %}
|