Files
2026-03-11 11:05:06 -04:00

58 lines
2.0 KiB
Plaintext

@page
@model maintenance.Pages.Admin.Templates.IndexModel
@{
ViewData["Title"] = "Templates";
}
<h1>Manage Pages</h1>
<p>Create and schedule maintenance/error pages while keeping the visual template fixed.</p>
<p><a asp-page="./Create" class="btn btn-primary">Create page from template</a></p>
@if (!string.IsNullOrWhiteSpace(Model.StatusMessage))
{
<div class="alert alert-info" role="alert">@Model.StatusMessage</div>
}
<table class="table table-striped">
<thead>
<tr>
<th>Key</th>
<th>Stub</th>
<th>Kind</th>
<th>Default</th>
<th>Enabled</th>
<th>Window</th>
<th>Updated</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Templates)
{
<tr>
<td>@item.Key</td>
<td>@(string.IsNullOrWhiteSpace(item.Stub) ? "-" : item.Stub)</td>
<td>@item.PageKind</td>
<td>@item.IsDefaultFallback</td>
<td>@item.IsEnabled</td>
<td>@(item.StartUtc?.ToString("u") ?? "-") to @(item.EndUtc?.ToString("u") ?? "-")</td>
<td>@item.LastUpdatedAtUtc.ToString("u")</td>
<td>
<a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
<a href="@Model.GetPreviewUrl(item)" target="_blank" rel="noopener">Preview</a>
@if (!item.IsDefaultFallback)
{
<text> | </text>
<form method="post" asp-page-handler="Delete" asp-route-id="@item.Id" style="display:inline">
<button type="submit"
class="btn btn-link p-0 align-baseline"
onclick="return confirm('Delete page @item.Key?');">
Delete
</button>
</form>
}
</td>
</tr>
}
</tbody>
</table>