oliverbooth.dev/OliverBooth/Pages/Shared/Partials/_PageTabs.cshtml
2024-07-15 19:38:56 +01:00

29 lines
905 B
Plaintext

@{
var urlRoot = ViewData["UrlRoot"]?.ToString() ?? string.Empty;
var page = (int)(ViewData["Page"] ?? 1);
var pageCount = (int)(ViewData["PageCount"] ?? 1);
var utility = new PageTabsUtility
{
CurrentPage = page,
PageCount = pageCount,
UrlRoot = urlRoot,
Tags = ViewData["Tags"] as string[]
};
}
<nav>
<ul class="pagination justify-content-center">
@if (pageCount == 1)
{
@Html.Raw(utility.ShowTab(1)) @* always visible *@
}
else
{
@Html.Raw(utility.ShowBounds(PageTabsUtility.BoundsType.Lower))
@Html.Raw(utility.ShowTab(1)) @* always visible *@
@Html.Raw(utility.ShowTabWindow())
@Html.Raw(utility.ShowTab(pageCount)) @* always visible *@
@Html.Raw(utility.ShowBounds(PageTabsUtility.BoundsType.Upper))
}
</ul>
</nav>