1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00
webvirtcloud/accounts/templates/login.html
catborise 9809e5b79a feat(accounts): a password change card that continues the sign-in
The forced first-login change was a plain settings form under a menu
whose every link led back to it, asked for an "Old password" the user
did not know was the temporary one, and listed Django's four rules as
long sentences, with their refusals under the confirmation field.

The page is now a card like the sign-in page: "Set your own password",
signed in as whom and why, the temporary password named as such, and no
menu but a Log out link. A rule list under the two new entries ticks
what the browser can check (8 characters, not only digits, both entries
match) and says the rest is checked on save; the server's refusals
join that list. The eye button shows both new entries. A change chosen
from the profile uses the same card with the menu and a Cancel link.
base.html gets a navbar block for it. Turkish and Chinese texts.
2026-11-26 14:21:35 +03:00

70 lines
3.8 KiB
HTML

{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign in" %}{% endblock title %}
{% block page_header %}{% endblock page_header %}{# the page has its own heading #}
{% block content %}
<div class="row justify-content-center pt-5">
<div class="col-sm-9 col-md-7 col-lg-6">
<div class="card shadow-sm">
<div class="card-body p-4 p-sm-5">
<div class="text-center mb-4">
<div class="d-inline-block rounded-3 text-bg-primary fs-2 lh-1 p-3 mb-3"><i class="bi bi-hdd-network"></i></div>
<h1 class="h3 fw-bold mb-1">WebVirtCloud</h1>
<p class="text-body-secondary small mb-0">{% trans "Virtualization management console" %}</p>
</div>
{% if app_settings.LOGIN_NOTICE %}
<div class="alert alert-info d-flex align-items-center mb-4" role="note">
<i class="bi bi-info-circle-fill fs-5 me-2 flex-shrink-0"></i>
<div>{{ app_settings.LOGIN_NOTICE }}</div>
</div>
{% endif %}
{% if form.errors %}
<div class="alert alert-danger d-flex align-items-center mb-4" role="alert">
<i class="bi bi-exclamation-triangle-fill fs-5 me-2 flex-shrink-0"></i>
<div>{% trans "Incorrect username or password." %}</div>
</div>
{% endif %}
<form id="form-signin" method="post" aria-label="Login form">
{% csrf_token %}
<div class="mb-3">
<label class="form-label small fw-medium" for="id_username">{% trans "Username" %}</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-person"></i></span>
<input type="text" id="id_username" class="form-control" name="username" value="{{ form.username.value|default:'' }}" placeholder="{% trans 'Enter username' %}" autocomplete="username" autocapitalize="none" autocorrect="off" {% if not form.non_field_errors %}autofocus {% endif %}required>
</div>
</div>
<div class="mb-4">
<label class="form-label small fw-medium" for="id_password">{% trans "Password" %}</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-shield-lock"></i></span>
<input type="password" id="id_password" class="form-control{% if form.non_field_errors %} is-invalid{% endif %}" name="password" placeholder="{% trans 'Enter password' %}" autocomplete="current-password" {% if form.non_field_errors %}autofocus {% endif %}required>
<button class="btn btn-outline-secondary" type="button" id="btn-toggle-pwd" aria-label="{% trans 'Toggle password visibility' %}">
<i class="bi bi-eye" id="toggle-icon"></i>
</button>
</div>
<div id="caps-lock" class="form-text d-none"><i class="bi bi-capslock-fill text-warning me-1"></i>{% trans "Caps Lock is on" %}</div>
</div>
<input type="hidden" name="next" value="{{ next }}">
<button id="btn-signin" class="btn btn-primary w-100 py-2" type="submit">
<i class="bi bi-box-arrow-in-right me-1"></i>
<span id="btn-text">{% trans "Sign in" %}</span>
</button>
</form>
</div>
</div>
</div>
</div>
{% endblock %}
{% block script %}
<script src="{% static 'js/login_form.js' %}"></script>
{% endblock script %}