LocalGovIMS_localgov-ims/src/Admin/Views/CheckDigitConfiguration/List.cshtml
@using PagedList.Mvc
@model Admin.Models.CheckDigitConfiguration.ListViewModel
@{
    ViewBag.Title = "Check digit configurations";
}

@section Header { Check digit configurations }

@section Subheader { Check digit configuration management }

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

<h3 class="visually-hidden">Search criteria</h3>

<div class="border border-1 rounded p-2">
    @Html.Partial("_Search", Model.SearchCriteria)
</div>

<h3 class="visually-hidden">Search results</h3>

@if (Model.Items != null && Model.Items.Any())
{
    <div class="table-responsive">
        <table class="table table-striped table-bordered table-hover mt-2">
            <thead>
                <tr>
                    <th scope="col">
                        Name
                    </th>
                    <th scope="col">
                        <span class="visually-hidden">Actions</span>
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.Items)
                {
                    <tr>
                        <td>
                            @Html.DisplayFor(m => item.Name)
                        </td>
                        <td class="text-end">
                            @Html.ActionLink("View", "Details", new { id = item.Id }, new { @class = "btn btn-secondary" })
                            @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "btn btn-secondary" })
                        </td>
                    </tr>
                }
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">
                        @if (Model.Pages > 1)
                        {
                            @Html.PagedListPager(Model.Items, page => Url.Action("Search", new
                            {
                                page = page,
                                name = Model.SearchCriteria.Name
                            }))
                        }
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
}
else
{
    Html.RenderPartial("_NoResultsMessage", "check digit configurations");
}

