proyectos.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {% extends "base.html" %}
  2. {% block content %}
  3. <div class="row">
  4. <div class="col-12">
  5. <div class="d-flex justify-content-between align-items-center mb-4">
  6. <h2>Simulaciones Guardadas</h2>
  7. <a href="{{ url_for('main.index') }}" class="btn btn-secondary">Volver al Inicio</a>
  8. </div>
  9. {% if proyectos %}
  10. <div class="table-responsive">
  11. <table class="table table-striped table-hover">
  12. <thead>
  13. <tr>
  14. <th>Fecha</th>
  15. <th>Cliente</th>
  16. <th>Ciudad</th>
  17. <th>Casa</th>
  18. <th>Panel</th>
  19. <th>Cantidad</th>
  20. <th>Energía (kWh/mes)</th>
  21. <th>Ahorro ($/mes)</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. {% for proyecto in proyectos %}
  26. <tr>
  27. <td>{{ proyecto.fecha_simulacion.strftime('%Y-%m-%d %H:%M') }}</td>
  28. <td>{{ proyecto.nombre_cliente }}</td>
  29. <td>{{ proyecto.ciudad.nombre_ciudad }}</td>
  30. <td>{{ proyecto.casa.nombre if proyecto.casa else 'N/A' }}</td>
  31. <td>{{ proyecto.panel.marca }} {{ proyecto.panel.modelo }}</td>
  32. <td>{{ proyecto.cantidad_paneles }}</td>
  33. <td>{{ "%.2f"|format(proyecto.energia_estimada_mensual) }}</td>
  34. <td>{{ "%.2f"|format(proyecto.ahorro_estimado) if proyecto.ahorro_estimado else '-' }}</td>
  35. </tr>
  36. {% endfor %}
  37. </tbody>
  38. </table>
  39. </div>
  40. {% else %}
  41. <div class="alert alert-info">
  42. No hay simulaciones guardadas todavía.
  43. </div>
  44. {% endif %}
  45. </div>
  46. </div>
  47. {% endblock %}