parcel/templates/user/signin.html
2023-10-17 20:36:31 +01:00

36 lines
1.2 KiB
HTML

{% extends "base.html" %}
{% block title %}Sign In{% endblock %}
{% block content %}
<div class="container mx-auto flex justify-center">
<div class="panel thin">
<h1 class="heading">
Sign in to your account
</h1>
{% if error %}
<div id="error" class="text-danger">
{{ error }}
</div>
{% endif %}
<form method="POST" action="/user/signin" class="form" id="signin-form">
<input type="hidden" name="token" value="{{ token }}">
<label for="username">Your username</label>
<input class="field" type="text" name="username" id="username" placeholder="Username" required>
<label for="password">Your password</label>
<input class="field" type="password" name="password" id="password" placeholder="••••••••" required>
<button type="submit" class="button">Sign in</button>
</form>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
document.querySelector("form#signin-form").addEventListener("submit", (event) => {
// Disable the submit button so we don't try multiple submissions.
document.querySelector("button[type=submit]").disabled = true;
});
</script>
{% endblock %}