{% extends "base.html" %}

{% block title %}
	{{ _("Sign in") }}
{% endblock %}

{% block container %}
	<main class="text-center pt-5">
		{% from "macros/forms.html" import render_field, render_checkbox_field, render_submit_field %}
		<form class="signin" method="POST">
			{{ form.hidden_tag() }}

			<h1 class="h3 mb-4 font-weight-normal">{{ self.title() }}</h1>

			{{ render_field(form.username, tabindex=110, label_visible=False, placeholder=_("Username or email")) }}
			{{ render_field(form.password, tabindex=120, label_visible=False, placeholder=_("Password")) }}
			<div class="d-flex gap-2 mb-4">
				{{ render_checkbox_field(form.remember_me, tabindex=130, class_="flex-grow-1") }}
				<a class="flex-grow-1" href="{{ url_for('users.forgot_password') }}">
					{{ _("Forgot my password") }}
				</a>
			</div>
			{{ render_submit_field(form.submit, tabindex=140, class_="btn btn-lg btn-primary d-block w-100") }}

			<hr class="my-5" />

			<p>
				<a class="btn btn-secondary me-3" href="{{ url_for('vcs.github_start', next=next) }}">
					<i class="fab fa-github me-1"></i>
					{{ _("GitHub") }}
				</a>
				<a class="btn btn-secondary" href="{{ url_for('users.claim') }}">
					<i class="fas fa-user-plus me-1"></i>
					{{ _("Register") }}
				</a>
			</p>
		</form>
	</main>
{% endblock %}
