Files
alro65 67a0e674ca Initial commit — MarineMaintenance v1.0
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>
2026-05-05 01:54:20 -04:00

63 lines
3.1 KiB
HTML

{% extends 'base.html' %}
{% block title %}{% if user %}Editar{% else %}Nuevo{% endif %} Usuario{% endblock %}
{% block page_title %}{% if user %}Editar Usuario{% else %}Nuevo Usuario{% endif %}{% endblock %}
{% block topbar_actions %}<a href="{{ url_for('users') }}" class="btn btn-secondary">← Volver</a>{% endblock %}
{% block content %}
<div class="card" style="max-width:560px">
<form method="POST">
<div class="form-grid">
<div class="form-group">
<label>Usuario *</label>
<input type="text" name="username" value="{{ user.username if user else '' }}" required>
</div>
<div class="form-group">
<label>Nombre Completo</label>
<input type="text" name="full_name" value="{{ user.full_name if user else '' }}">
</div>
<div class="form-group full">
<label>Email *</label>
<input type="email" name="email" value="{{ user.email if user else '' }}" required>
</div>
<div class="form-group">
<label>Contraseña {% if user %}(dejar vacío = no cambiar){% endif %}</label>
<input type="password" name="password" {% if not user %}required{% endif %}>
</div>
<div class="form-group">
<label>Rol</label>
<select name="role">
{% if current_user.role == 'superadmin' %}
<option value="superadmin" {% if user and user.role=='superadmin' %}selected{% endif %}>Super Admin</option>
<option value="admin" {% if user and user.role=='admin' %}selected{% endif %}>Admin</option>
{% endif %}
<option value="technician" {% if user and user.role=='technician' %}selected{% endif %}>Técnico</option>
</select>
</div>
{% if current_user.role == 'superadmin' %}
<div class="form-group full">
<label>Compañía (vacío = acceso a todas)</label>
<select name="company_id">
<option value="">-- Todas las compañías --</option>
{% for c in companies %}
<option value="{{ c.id }}" {% if user and user.company_id==c.id %}selected{% endif %}>{{ c.name }}</option>
{% endfor %}
</select>
</div>
{% endif %}
{% if user %}
<div class="form-group">
<label>Estado</label>
<select name="is_active">
<option value="1" {% if user.is_active %}selected{% endif %}>Activo</option>
<option value="0" {% if not user.is_active %}selected{% endif %}>Inactivo</option>
</select>
</div>
{% endif %}
</div>
<div class="flex gap-3 mt-6">
<button type="submit" class="btn btn-primary">💾 Guardar</button>
<a href="{{ url_for('users') }}" class="btn btn-secondary">Cancelar</a>
</div>
</form>
</div>
{% endblock %}