mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
- Replace hardcoded colors with Bootstrap & Bootswatch CSS custom properties - Adapt background, card, borders, and inputs dynamically to active light and dark themes - Inherit primary color, border-radius, and font-family from active theme - Use native Bootswatch alert and button styles for consistent visual hierarchy
99 lines
3.9 KiB
HTML
99 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n %}
|
|
{% load static %}
|
|
|
|
{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In" %}{% endblock title %}
|
|
|
|
{% block style %}
|
|
<link href="{% static "css/signin.css" %}" rel="stylesheet">
|
|
{% endblock style %}
|
|
|
|
{% block content %}
|
|
<div class="signin-wrapper">
|
|
<div class="signin-card">
|
|
<div class="signin-brand">
|
|
<div class="signin-logo-badge">
|
|
<i class="bi bi-hdd-network"></i>
|
|
</div>
|
|
<h1 class="signin-title">WebVirtCloud</h1>
|
|
<p class="signin-subtitle">{% trans "Virtualization Management Console" %}</p>
|
|
</div>
|
|
|
|
{% 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" role="form" aria-label="Login form">
|
|
{% csrf_token %}
|
|
<div class="mb-3">
|
|
<label class="signin-field-label" for="id_username">{% trans "Username" %}</label>
|
|
<div class="signin-input-group">
|
|
<span class="signin-input-icon"><i class="bi bi-person"></i></span>
|
|
<input type="text" id="id_username" class="signin-input form-control" name="username" placeholder="{% trans 'Enter username' %}" autocapitalize="none" autocorrect="off" autofocus required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label class="signin-field-label" for="id_password">{% trans "Password" %}</label>
|
|
<div class="signin-input-group">
|
|
<span class="signin-input-icon"><i class="bi bi-shield-lock"></i></span>
|
|
<input type="password" id="id_password" class="signin-input form-control" name="password" placeholder="{% trans 'Enter password' %}" required>
|
|
<button class="signin-toggle-pwd" type="button" id="btn-toggle-pwd" tabindex="-1" aria-label="{% trans 'Toggle password visibility' %}">
|
|
<i class="bi bi-eye" id="toggle-icon"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<input type="hidden" name="next" value="{{ next }}">
|
|
|
|
<button id="btn-signin" class="btn btn-primary btn-signin-submit" type="submit">
|
|
<i class="bi bi-box-arrow-in-right"></i>
|
|
<span id="btn-text">{% trans "Sign In" %}</span>
|
|
</button>
|
|
</form>
|
|
|
|
<div class="signin-footer">
|
|
<span class="d-inline-flex align-items-center">
|
|
<span class="pulse-indicator"></span>
|
|
<span>KVM / Libvirt</span>
|
|
</span>
|
|
<span class="font-monospace">v2.0.0</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block script %}
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('body').addClass('signin-page');
|
|
|
|
// Toggle password visibility
|
|
$('#btn-toggle-pwd').on('click', function(e) {
|
|
e.preventDefault();
|
|
var $pwd = $('#id_password');
|
|
var $icon = $('#toggle-icon');
|
|
if ($pwd.attr('type') === 'password') {
|
|
$pwd.attr('type', 'text');
|
|
$icon.removeClass('bi-eye').addClass('bi-eye-slash');
|
|
} else {
|
|
$pwd.attr('type', 'password');
|
|
$icon.removeClass('bi-eye-slash').addClass('bi-eye');
|
|
}
|
|
});
|
|
|
|
// Submit loading state
|
|
$('#form-signin').on('submit', function() {
|
|
var $btn = $('#btn-signin');
|
|
$btn.prop('disabled', true);
|
|
$btn.html(
|
|
'<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>' +
|
|
'{% trans "Signing in..." %}'
|
|
);
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock script %}
|