diff --git a/app.py b/app.py index a307883..cf1a571 100644 --- a/app.py +++ b/app.py @@ -290,7 +290,7 @@ def manage_workers(): flash("El RUT ya existe en el sistema.", "danger") # Fetch workers and JOIN their module name - c.execute('''SELECT w.id, w.rut, w.name, w.phone, m.name + c.execute('''SELECT w.id, w.rut, w.name, w.phone, m.name, w.modulo_id FROM workers w LEFT JOIN modulos m ON w.modulo_id = m.id WHERE w.is_admin = 0''') @@ -378,7 +378,8 @@ def admin_reset_password(id): conn.close() flash(f"Contraseña de {worker[0]} restablecida. La nueva contraseña es: {new_password}", "warning") - return redirect(url_for('edit_worker', id=id)) + + return redirect(url_for('manage_workers')) @app.route('/admin/estructura', methods=['GET', 'POST']) diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..8292d24 --- /dev/null +++ b/static/style.css @@ -0,0 +1,12 @@ + +[data-bs-theme="dark"] .form-control[readonly] { + background-color: #1a1d21; /* Un fondo casi negro, más oscuro que el modal */ + border-color: #373b3e; /* Un borde sutil */ + color: #e3e6e8; /* Texto blanco grisáceo, muy legible */ + opacity: 1; /* Evita la opacidad predeterminada de Bootstrap */ + cursor: not-allowed; /* Refuerza visualmente que no es editable */ +} + +[data-bs-theme="dark"] .text-muted-rut { + color: #adb5bd !important; /* Un gris medio para el label "RUT (No editable)" */ +} diff --git a/templates/admin_productos.html b/templates/admin_productos.html index a1f0ec7..c943478 100644 --- a/templates/admin_productos.html +++ b/templates/admin_productos.html @@ -7,7 +7,6 @@ {% endblock %} - {% block content %}

Catálogo de Productos por Zona

@@ -148,9 +147,7 @@ }); }); } - - {% endblock %} \ No newline at end of file diff --git a/templates/edit_worker.html b/templates/edit_worker.html deleted file mode 100644 index f557844..0000000 --- a/templates/edit_worker.html +++ /dev/null @@ -1,97 +0,0 @@ -{% extends "macros/base.html" %} - - -{% block title %}Editar Trabajador{% endblock %} - -{% block head %} - -{% endblock %} - - -{% block content %} -
-
-

Editar Trabajador

- - {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} - {% for category, message in messages %} -
{{ message|safe }}
- {% endfor %} - {% endif %} - {% endwith %} - -
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- Cancelar - -
-
-
-
- -
-
- Opciones de Seguridad -
-
-
-
Restablecer Contraseña
- Genera una nueva contraseña aleatoria si el trabajador olvidó la suya. -
-
- -
-
-
- -
-
- - -{% endblock %} \ No newline at end of file diff --git a/templates/macros/base.html b/templates/macros/base.html index 9a2a42c..866340f 100644 --- a/templates/macros/base.html +++ b/templates/macros/base.html @@ -5,7 +5,7 @@ Sistema de Rendiciones - {% block title %}{% endblock %} - + diff --git a/templates/macros/modals.html b/templates/macros/modals.html index a83b46f..b545312 100644 --- a/templates/macros/modals.html +++ b/templates/macros/modals.html @@ -61,4 +61,58 @@ +{% endmacro %} + +{% macro edit_worker_modal(modulos) %} + {% endmacro %} \ No newline at end of file