Files
MarineMaintenance/templates/equipment_form.html
T
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

90 lines
4.7 KiB
HTML

{% extends 'base.html' %}
{% block title %}{% if equip %}Editar{% else %}Nuevo{% endif %} Equipo — {{ vessel.name }}{% endblock %}
{% block page_title %}{% if equip %}Editar Equipo{% else %}Nuevo Equipo{% endif %}{% endblock %}
{% block topbar_actions %}
<a href="{{ url_for('vessel_history', vid=vessel.id) }}" class="btn btn-secondary">← Volver</a>
{% endblock %}
{% block content %}
<div class="card" style="max-width:720px">
<div style="margin-bottom:18px;font-size:13px;color:var(--gray)">
Embarcación: <span class="text-cyan">{{ vessel.name }}</span>
</div>
<form method="POST">
<div class="form-grid cols-3">
<div class="form-group full">
<label>Nombre del Equipo *</label>
<input type="text" name="name" value="{{ equip.name if equip else '' }}" required
placeholder="Ej: Motor Principal Estribor">
</div>
<div class="form-group">
<label>Tipo de Equipo</label>
<select name="equipment_type">
<option value="">-- Seleccionar --</option>
{% for t in [('engine','Motor'),('generator','Generador'),('pump','Bomba'),
('hydraulic','Hidráulico'),('electrical','Eléctrico/Electrónico'),
('hvac','HVAC / A/C'),('navigation','Navegación'),
('safety','Seguridad'),('thruster','Thruster'),
('watermaker','Water Maker'),('other','Otro')] %}
<option value="{{ t[0] }}" {% if equip and equip.equipment_type==t[0] %}selected{% endif %}>{{ t[1] }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label>Posición a Bordo</label>
<select name="position">
<option value="">-- Seleccionar --</option>
{% for p in [('starboard','Estribor'),('port','Babor'),('center','Centro'),
('forward','Proa'),('aft','Popa'),('engine_room','Sala de Máquinas')] %}
<option value="{{ p[0] }}" {% if equip and equip.position==p[0] %}selected{% endif %}>{{ p[1] }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label>Marca</label>
<input type="text" name="make" value="{{ equip.make if equip else '' }}"
placeholder="Ej: MTU, Caterpillar, Volvo">
</div>
<div class="form-group">
<label>Modelo</label>
<input type="text" name="model" value="{{ equip.model if equip else '' }}"
placeholder="Ej: 12V2000 M94">
</div>
<div class="form-group">
<label>Año</label>
<input type="number" name="year" value="{{ equip.year if equip else '' }}" min="1950" max="2030">
</div>
<div class="form-group full" style="background:rgba(0,180,216,0.06);border:1px solid rgba(0,180,216,0.25);border-radius:8px;padding:14px">
<label style="color:var(--cyan)">⚠ Número de Serie (crítico)</label>
<input type="text" name="serial_number"
value="{{ equip.serial_number if equip else '' }}"
placeholder="Ej: MTU-2024-12V-00432-S"
style="border-color:rgba(0,180,216,0.4);margin-top:4px">
</div>
<div class="form-group">
<label>Horas Actuales</label>
<input type="number" step="0.1" name="engine_hours"
value="{{ equip.engine_hours if equip else '0' }}">
</div>
<div class="form-group">
<label>Último Servicio (fecha)</label>
<input type="date" name="last_service_date"
value="{{ equip.last_service_date if equip else '' }}">
</div>
<div class="form-group">
<label>Último Servicio (horas)</label>
<input type="number" step="0.1" name="last_service_hours"
value="{{ equip.last_service_hours if equip else '' }}">
</div>
<div class="form-group full">
<label>Notas</label>
<textarea name="notes">{{ equip.notes if equip else '' }}</textarea>
</div>
</div>
<div class="flex gap-3 mt-6">
<button type="submit" class="btn btn-primary">💾 Guardar</button>
<a href="{{ url_for('vessel_history', vid=vessel.id) }}" class="btn btn-secondary">Cancelar</a>
</div>
</form>
</div>
{% endblock %}