LocalGovIMS_localgov-ims/src/Admin/Views/SystemMessage/List.cshtml
@model IList<Admin.Models.SystemMessage.DetailsViewModel>
@{
    ViewBag.Title = "System messages";
}

@section Header { System messages }

@section Subheader { System messages and alerts }

@section Actions {
    @Html.ActionLink("Create message", "Create", new { }, new { @class = "btn btn-secondary" })
}

@if (Model != null)
{
    <div class="table-responsive">
        <table class="table table-striped table-bordered table-hover mt-2">
            <thead>
                <tr>
                    <th scope="col">
                        @Html.LabelFor(m => Model.FirstOrDefault().StartDate)
                    </th>
                    <th scope="col">
                        @Html.LabelFor(m => Model.FirstOrDefault().EndDate)
                    </th>
                    <th scope="col">
                        @Html.LabelFor(m => Model.FirstOrDefault().Severity)
                    </th>
                    <th scope="col">
                        @Html.LabelFor(m => Model.FirstOrDefault().Message)
                    </th>
                    <th scope="col">
                        <span class="visually-hidden">Actions</span>
                    </th>
                </tr>
            </thead>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(m => item.StartDate)
                    </td>
                    <td>
                        @Html.DisplayFor(m => item.EndDate)
                    </td>
                    <td>
                        @Html.DisplayFor(m => item.SeverityDisplayName)
                    </td>
                    <td>
                        @Html.DisplayFor(m => item.Message)
                    </td>
                    <td class="text-end">
                        @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "btn btn-secondary" })
                    </td>
                </tr>
            }
        </table>
    </div>
}
else
{
    Html.RenderPartial("_NothingSpecified", "messages");
}

