oliverbooth.dev/OliverBooth/Pages/Shared/Partials/_PageTabs.cshtml
Oliver Booth 435a69b27a
perf: add pagination to blog post list
removes the need for API controller accessed via JS
2024-05-05 18:13:06 +01:00

21 lines
695 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
};
}
<nav>
<ul class="pagination justify-content-center">
@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>