67a0e674ca
Marine maintenance management: work orders with photos, ISM/SWP procedures, MSDS, inventory, RFQ/purchases, vessel history, bilingual PDF reports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
54 lines
2.3 KiB
HTML
54 lines
2.3 KiB
HTML
{% extends 'base.html' %}
|
|
{% block title %}Usuarios{% endblock %}
|
|
{% block page_title %}Usuarios del Sistema{% endblock %}
|
|
{% block topbar_actions %}
|
|
{% if current_user.role == 'superadmin' or current_user.role == 'admin' %}
|
|
<a href="{{ url_for('user_new') }}" class="btn btn-primary">+ Nuevo Usuario</a>
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% block content %}
|
|
<div class="card">
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr><th>Usuario</th><th>Nombre</th><th>Email</th><th>Compañía</th><th>Rol</th><th>Estado</th><th>Último Login</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for u in users %}
|
|
<tr>
|
|
<td><strong>{{ u.username }}</strong></td>
|
|
<td>{{ u.full_name or '—' }}</td>
|
|
<td class="text-gray">{{ u.email }}</td>
|
|
<td>{{ u.company_name or '<span class="text-cyan">Todas</span>'|safe }}</td>
|
|
<td>
|
|
{% if u.role == 'superadmin' %}
|
|
<span class="badge" style="background:rgba(0,180,216,0.2);color:var(--cyan)">Super Admin</span>
|
|
{% elif u.role == 'admin' %}
|
|
<span class="badge" style="background:rgba(46,196,182,0.2);color:var(--success)">Admin</span>
|
|
{% else %}
|
|
<span class="badge" style="background:rgba(255,255,255,0.1);color:var(--gray)">Técnico</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if u.is_active %}
|
|
<span class="badge badge-completed">Activo</span>
|
|
{% else %}
|
|
<span class="badge badge-cancelled">Inactivo</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="text-gray" style="font-size:12px">{{ u.last_login[:16] if u.last_login else '—' }}</td>
|
|
<td>
|
|
{% if current_user.role == 'superadmin' or (current_user.role == 'admin' and u.role == 'technician') %}
|
|
<a href="{{ url_for('user_edit', uid=u.id) }}" class="btn btn-sm btn-secondary">✏️</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="8" class="text-gray" style="text-align:center;padding:30px">Sin usuarios.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|