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

58 lines
2.8 KiB
Twig
Raw Normal View History

{% extends 'stdgrid.html.twig' %}
{% block title %}{% trans %}Log in!{% endtrans %}{% endblock %}
{% block body %}
<section class="frame-section">
<form class="section-form" method="post">
<fieldset class="container-block">
<legend class="section-form-legend">
<h1>{% trans %}Login{% endtrans %}</h1>
</legend>
{% if error %}
<label class="alert alert-danger">
{{ error.getMessage() }}
</label>
{% endif %}
{% if app.user %}
<span>
{% trans %}You are logged in as %app.user.username%{% endtrans %}
<button class="btn btn-lg btn-primary">
<a href="{{ path('app_logout') }}">{% trans %}Logout{% endtrans %}</a>
</button>
</span>
{% else %}
2021-12-28 04:04:30 +09:00
<div class="form-row">
<label class="section-form-label" for="inputNicknameOrEmail">{% trans %}Nickname or Email{% endtrans %}</label>
<input type="text" value="{{ last_login_id }}" name="_username" id="inputNicknameOrEmail" class="form-control" required autofocus>
<p class="help-text">{% trans %}Your nickname or email address{% endtrans %}</p>
</div>
2021-12-28 04:04:30 +09:00
<div class="form-row">
<label class="section-form-label" for="inputPassword">{% trans %}Password{% endtrans %}</label>
<input type="password" name="_password" id="inputPassword" class="form-control" required>
<p class="help-text">{% trans %}Your account's password{% endtrans %}</p>
</div>
2021-12-28 04:04:30 +09:00
<span class="form-row-checkbox">
<label for="inputRememberMe">{% trans %}Remember me{% endtrans %}</label>
<input type="checkbox" name="_remember_me" id="inputRememberMe">
</span>
2022-03-14 07:27:59 +09:00
{% if app.request.query.has('next') or app.request.query.has('_next') or app.request.query.has('_target_path') %}
<input type="hidden" name="_target_path" value="{{ (app.request.query.get('next') ?? app.request.query.get('_next') ?? app.request.query.get('_target_path')) | url_encode }}">
{% endif %}
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<div>
<button id="signIn" class="btn btn-lg btn-primary" type="submit">Sign in</button>
</div>
{% endif %}
</fieldset>
</form>
</section>
{% endblock body %}
{% block javascripts %}{% endblock %}