2020-10-19 08:26:08 +00:00
|
|
|
{% extends "base.html" %}
|
2015-03-02 15:31:25 +00:00
|
|
|
{% load i18n %}
|
2020-10-19 08:26:08 +00:00
|
|
|
{% load static %}
|
|
|
|
|
2023-05-11 12:31:42 +00:00
|
|
|
|
|
|
|
{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In" %}{% endblock title %}
|
2020-10-19 08:26:08 +00:00
|
|
|
|
|
|
|
{% block style %}
|
|
|
|
<link href="{% static "css/signin.css" %}" rel="stylesheet">
|
|
|
|
{% endblock style %}
|
|
|
|
|
2015-03-02 15:31:25 +00:00
|
|
|
{% block content %}
|
2023-04-27 13:02:29 +00:00
|
|
|
<div class="login-box">
|
|
|
|
<div class="page-header">
|
2023-05-11 12:31:42 +00:00
|
|
|
<a href="/"><h1>WebVirtCloud</h1></a>
|
2023-04-27 13:02:29 +00:00
|
|
|
</div>
|
2023-05-11 12:31:42 +00:00
|
|
|
<hr>
|
2023-04-27 13:02:29 +00:00
|
|
|
<div class="col-12" role="main">
|
|
|
|
{% if form.errors %}
|
2023-05-11 12:31:42 +00:00
|
|
|
<div class="alert alert-danger" role="alert">
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
2023-04-27 13:02:29 +00:00
|
|
|
{% trans "Incorrect username or password." %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2023-05-12 09:01:54 +00:00
|
|
|
<form id="form-signin" class="form-signin" method="post" role="form" aria-label="Login form">{% csrf_token %}
|
2023-04-27 13:02:29 +00:00
|
|
|
<h2 class="form-signin-heading">{% trans "Sign In" %}</h2>
|
2023-05-11 12:31:42 +00:00
|
|
|
<input type="text" class="form-control" name="username" placeholder="{% trans 'User' %}" autocapitalize="none" autocorrect="off" autofocus required>
|
|
|
|
<input type="password" class="form-control" name="password" placeholder="{% trans 'Password' %}" required>
|
2023-04-27 13:02:29 +00:00
|
|
|
<input type="hidden" name="next" value="{{ next }}">
|
|
|
|
<div class="d-grid">
|
2023-05-12 09:01:54 +00:00
|
|
|
<button id="btn-signin" class="btn btn-lg btn-success" type="submit">{% trans "Sign In" %}</button>
|
2023-04-27 13:02:29 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2020-10-19 08:26:08 +00:00
|
|
|
</div>
|
2023-05-12 09:01:54 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block script %}
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$("#btn-signin").click(function() {
|
|
|
|
// disable button
|
|
|
|
$(this).prop("disabled", true);
|
|
|
|
// add spinner to button
|
|
|
|
$(this).html(
|
|
|
|
`
|
|
|
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
|
|
{% trans "Loading" %}...
|
|
|
|
`
|
|
|
|
);
|
|
|
|
$("#form-signin").submit();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock script%}
|