gnu-social/templates/security/login.html.twig

60 lines
2.2 KiB
Twig
Raw Normal View History

{% extends 'stdgrid.html.twig' %}
{% block stylesheets %}
{{ parent() }}
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/security/security.css') }}">
{% endblock %}
{% block title %}Log in!{% endblock %}
{% block body %}
2021-04-30 10:51:03 +09:00
<div class='content'>
<form method="post">
<fieldset>
<legend>{{ "Login" | trans }}</legend>
{% if error %}
<div class="alert alert-danger">{{ error.messageKey | trans(error.messageData, 'security') }}</div>
{% endif %}
<p>
{% if app.user %}
<h1 class="mb-3">
You are logged in as {{ app.user.username }}.
<br>
<button class="btn btn-lg btn-primary">
<a href="{{ path('app_logout') }}">{{ "Logout" | trans }}</a>
</button>
</h1>
{% else %}
{# TODO: Login can be done with email, so the id's and stuff should reflect that, along with using the translation facilities #}
<label for="inputNickname">{{ "Nickname or Email" | trans }}</label>
<br>
<input type="text" value="{{ last_login_id }}" name="nickname" id="inputNickname"
2021-04-30 10:51:03 +09:00
class="form-control" required autofocus>
{% endif %}
</p>
<p>
<label for="inputPassword">{{ "Password" | trans }}</label>
<br>
<input type="password" name="password" id="inputPassword" class="form-control" required>
</p>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<p class="checkbox mb-3">
<label>{{ "Remember me" | trans}}</label>
<input type="checkbox" name="_remember_me">
</p>
<button class="btn btn-lg btn-primary" type="submit">
Sign in
</button>
</fieldset>
2021-04-30 10:51:03 +09:00
</form>
</div>
{% endblock body %}
{% block javascripts %}{% endblock %}