Skip to content

Commit ca451d7

Browse files
feat: Enhance error display logic for assignments and improve layout for map images
1 parent aca669b commit ca451d7

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/XtremeIdiots.Portal.Web/Views/MapRotations/AssignmentStatus.cshtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
}
8181
</dl>
8282

83-
@if (!string.IsNullOrEmpty(Model.Assignment.LastError))
83+
@if (!string.IsNullOrEmpty(Model.Assignment.LastError) && Model.Assignment.DeploymentState == DeploymentState.Failed)
8484
{
8585
<div class="alert alert-danger mt-3 mb-0">
8686
<i class="fa-solid fa-exclamation-triangle"></i> <strong>Last Error</strong>
@@ -329,18 +329,18 @@
329329
}
330330
else
331331
{
332-
<div class="row">
332+
<div class="row g-2">
333333
@{ var sortedMaps = Model.Rotation.MapRotationMaps?.OrderBy(m => m.SortOrder).ToList() ?? []; }
334334
@for (var i = 0; i < sortedMaps.Count; i++)
335335
{
336336
var rotationMap = sortedMaps[i];
337337
var mapDto = Model.Maps.FirstOrDefault(m => m.MapId == rotationMap.MapId);
338338
if (mapDto != null)
339339
{
340-
<div class="col-md-3 col-sm-4 col-6 mb-3 text-center">
341-
<img src="@(mapDto.MapImageUri ?? "/images/noimage.jpg")" class="map-image img-fluid" alt="Map image for @mapDto.MapName" loading="lazy" />
342-
<small class="text-muted">#@(i + 1)</small>
343-
<h6 class="mb-0">@mapDto.MapName</h6>
340+
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-4 col-6 mb-2 text-center">
341+
<img src="@(mapDto.MapImageUri ?? "/images/noimage.jpg")" class="map-image img-fluid rounded" alt="Map image for @mapDto.MapName" loading="lazy" style="max-height: 80px; object-fit: cover; width: 100%;" />
342+
<small class="text-muted d-block">#@(i + 1)</small>
343+
<small class="fw-bold">@mapDto.MapName</small>
344344
</div>
345345
}
346346
}

src/XtremeIdiots.Portal.Web/Views/MapRotations/Details.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
</td>
143143
<td>
144144
@await Html.PartialAsync("_AssignmentStatusBadge", ("Deployment", assignment.DeploymentState.ToString()))
145-
@if (!string.IsNullOrEmpty(assignment.LastError))
145+
@if (!string.IsNullOrEmpty(assignment.LastError) && assignment.DeploymentState == DeploymentState.Failed)
146146
{
147147
<div class="text-danger small mt-1" title="@assignment.LastError">
148148
<i class="fa-solid fa-exclamation-triangle"></i> @(assignment.LastError.Length > 80 ? assignment.LastError[..80] + "..." : assignment.LastError)

0 commit comments

Comments
 (0)