bank fields, date range filters, add worker modal, fix empty report crash
This commit is contained in:
@@ -1,53 +1,20 @@
|
||||
{% extends "macros/base.html" %}
|
||||
{% from 'macros/modals.html' import confirm_modal, edit_worker_modal %}
|
||||
{% from 'macros/modals.html' import confirm_modal, edit_worker_modal, add_worker_modal %}
|
||||
{% from "macros/ui.html" import flashed_messages %}
|
||||
|
||||
{% block title %}Gestión de Trabajadores{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 class="mb-4">Gestión de Trabajadores</h2>
|
||||
|
||||
{{ flashed_messages() }}
|
||||
|
||||
{{ edit_worker_modal(modulos) }}
|
||||
{{ edit_worker_modal(modulos, bancos) }}
|
||||
{{ add_worker_modal(modulos, bancos) }}
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-primary text-white">Agregar Nuevo Trabajador</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ url_for('admin.manage_workers') }}">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-2">
|
||||
<label class="form-label">RUT</label>
|
||||
<input type="text" class="form-control" name="rut" id="rutInput" placeholder="12.345.678-9" value="{{ form.get('rut', '') }}" maxlength="12" required>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Nombre Completo</label>
|
||||
<input type="text" class="form-control" name="name" value="{{ form.get('name', '') }}" required>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label">Teléfono</label>
|
||||
<input type="text" class="form-control" name="phone" id="phoneInput" placeholder="9 1234 5678" value="{{ form.get('phone', '') }}" required>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Módulo Asignado</label>
|
||||
<select class="form-select" name="modulo_id" required>
|
||||
<option value="" selected disabled>Seleccionar Módulo...</option>
|
||||
{% for mod in modulos %}
|
||||
<option value="{{ mod[0] }}">{{ mod[2] }} - {{ mod[1] }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label">Jornada</label>
|
||||
<select class="form-select" name="tipo" required>
|
||||
<option value="Full Time" {% if form.get('tipo') == 'Full Time' %}selected{% endif %}>Full Time</option>
|
||||
<option value="Part Time" {% if form.get('tipo') == 'Part Time' %}selected{% endif %}>Part Time</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-3">Guardar Trabajador</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h2 class="mb-0">Gestión de Trabajadores</h2>
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addWorkerModal">
|
||||
<i class="bi bi-plus-lg"></i> Agregar Trabajador
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4 shadow-sm border-0">
|
||||
@@ -88,6 +55,10 @@
|
||||
<th>Teléfono</th>
|
||||
<th>Módulo</th>
|
||||
<th>Tipo</th>
|
||||
<th>Banco</th>
|
||||
<th>N° Cuenta</th>
|
||||
<th>RUT Cuenta</th>
|
||||
<th>Tipo Cuenta</th>
|
||||
<th class="text-end">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -103,6 +74,10 @@
|
||||
{{ worker[6] }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="align-middle">{{ worker[7] or '-' }}</td>
|
||||
<td class="align-middle">{{ worker[8] or '-' }}</td>
|
||||
<td class="align-middle">{{ worker[10] or '-' }}</td>
|
||||
<td class="align-middle">{{ worker[9] or '-' }}</td>
|
||||
<td class="text-end">
|
||||
<button type="button"
|
||||
class="btn btn-primary btn-sm btn-edit-sm"
|
||||
@@ -113,7 +88,11 @@
|
||||
data-name="{{ worker[2] }}"
|
||||
data-phone="{{ worker[3] }}"
|
||||
data-modulo="{{ worker[5] }}"
|
||||
data-tipo="{{ worker[6] }}">
|
||||
data-tipo="{{ worker[6] }}"
|
||||
data-nombre-banco="{{ worker[7] }}"
|
||||
data-numero-cuenta="{{ worker[8] }}"
|
||||
data-tipo-cuenta="{{ worker[9] }}"
|
||||
data-rut-banco="{{ worker[10] }}">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
|
||||
@@ -132,7 +111,7 @@
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6" class="text-center py-3 text-muted">No hay trabajadores registrados.</td>
|
||||
<td colspan="10" class="text-center py-3 text-muted">No hay trabajadores registrados.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user