From bee85bf92aab84087798ffa9f3f16336acef2fce Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Thu, 19 Mar 2026 18:56:34 +0100 Subject: Basic backoffice for alert management --- src/Enmarcha.Backend/Views/Alerts/Index.cshtml | 81 ++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/Enmarcha.Backend/Views/Alerts/Index.cshtml (limited to 'src/Enmarcha.Backend/Views/Alerts/Index.cshtml') diff --git a/src/Enmarcha.Backend/Views/Alerts/Index.cshtml b/src/Enmarcha.Backend/Views/Alerts/Index.cshtml new file mode 100644 index 0000000..d541ccc --- /dev/null +++ b/src/Enmarcha.Backend/Views/Alerts/Index.cshtml @@ -0,0 +1,81 @@ +@model List +@using Enmarcha.Backend.Data.Models +@using Enmarcha.Backend.Helpers +@{ + ViewData["Title"] = "Alertas de servicio"; +} + +
+

+ Alertas de servicio +

+ + Nueva alerta + +
+ +@if (!Model.Any()) +{ +
+ + No hay alertas registradas. +
+} +else +{ +
+
+ + + + + + + + + + + + + @foreach (var alert in Model) + { + var phase = alert.GetPhase(); + var (badgeClass, phaseLabel) = phase switch + { + AlertPhase.Draft => ("bg-secondary", "Borrador"), + AlertPhase.PreNotice => ("bg-info text-dark", "Pre-aviso"), + AlertPhase.Active => ("bg-success", "Activa"), + AlertPhase.Finished => ("bg-warning text-dark", "Finalizada"), + _ => ("bg-dark", "Archivada") + }; + + + + + + + + + } + +
TítuloFaseCausaEfectoEvento
+
@alert.Header.Get("es")
+
@alert.Id[..Math.Min(8, alert.Id.Length)]…
+
@phaseLabel@alert.Cause.GetDescription()@alert.Effect.GetDescription() + @alert.EventStartDate.ToString("dd/MM/yy HH:mm")
+ → @alert.EventEndDate.ToString("dd/MM/yy HH:mm") +
+ + + + + + +
+
+
+} -- cgit v1.3