{% extends 'base_narrow.html' %}

{% block body %}
<form action="{{ url_for("session.login", ref=ref) }}" method="POST">
	<div class="col-12">
		<h2 class="text-center">{{_("Login")}}</h2>
	</div>
	<div class="form-group col-12">
		<label for="user-loginname">{{_("Login Name")}}</label>
		<input type="text" class="form-control" id="user-loginname" name="loginname" required="required" tabindex = "1" autofocus>
	</div>
	<div class="form-group col-12">
		<label for="user-password1">{{_("Password")}}</label>
		<input type="password" class="form-control" id="user-password1" name="password" required="required" tabindex = "2">
	</div>
	<div class="form-group col-12">
		<button type="submit" class="btn btn-primary btn-block" tabindex = "3">{{_("Login")}}</button>
	</div>
	{% if request.values.get('devicelogin') %}
	<div class="text-center text-muted mb-3">{{_("- or -")}}</div>
	<div class="form-group col-12">
		<a href="{{ url_for('session.devicelogin_start', ref=ref) }}" class="btn btn-primary btn-block" tabindex="0">{{_("Login with another device")}}</a>
	</div>
	{% endif %}
	<div class="clearfix col-12">
		{% if config['SELF_SIGNUP'] %}
		<a href="{{ url_for("signup.signup_start") }}" class="float-left">{{_("Register")}}</a>
		{% endif %}
		{% if config['ENABLE_PASSWORDRESET'] %}
		<a href="{{ url_for("selfservice.forgot_password") }}" class="float-right">{{_("Forgot Password?")}}</a>
		{% endif %}
	</div>
</form>
{% endblock %}
