Major Refactor: Refactor the codebase to improve readability and maintainability

This commit is contained in:
2026-06-21 23:38:49 -04:00
parent 9c4753cd1f
commit 801b0b97fc
46 changed files with 2378 additions and 2031 deletions

View File

@@ -1,4 +1,5 @@
{% extends "macros/base.html" %}
{% from "macros/ui.html" import flashed_messages %}
{% block title %}Inicio de sesión{% endblock %}
@@ -10,14 +11,8 @@
<h4 class="mb-0">Iniciar Sesión</h4>
</div>
<div class="card-body p-4">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message|safe }}</div>
{% endfor %}
{% endif %}
{% endwith %}
{{ flashed_messages() }}
<form method="POST">
<div class="mb-3">
<label class="form-label">RUT</label>
@@ -43,22 +38,5 @@
{% endblock %}
{% block scripts %}
<script>
document.getElementById('rutInput').addEventListener('input', function(e) {
let value = this.value.replace(/[^0-9kK]/g, '').toUpperCase();
if (value.length > 9) {
value = value.slice(0, 9);
}
if (value.length > 1) {
let body = value.slice(0, -1);
let dv = value.slice(-1);
body = body.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
this.value = `${body}-${dv}`;
} else {
this.value = value;
}
});
</script>
{% endblock %}
<script src="{{ url_for('static', filename='js/login.js') }}"></script>
{% endblock %}