Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (39 sloc) 1.72 KB
@model Object
@using MvcControlsToolkit.Core.Templates
@using MvcControlsToolkit.Core.TagHelpers
@using MvcControlsToolkit.Core.Views
@using Microsoft.Extensions.Localization
@using System.Globalization
@{
var options = ViewData["Options"] as DefaultServerPagerLayoutOptions;
var factory = ViewData["LocalizerFactory"] as IStringLocalizerFactory;
var localizer = options.GetLocalizerFunction(factory);
}
@if (options.HasPages)
{
<nav aria-label="@localizer("page navigation")">
<ul class="@(options.CssClass??"pagination")">
<li class="@(options.HasPagesBefore ? "" : "disabled")">
<a @options.Operation(options.CurrentPage-1) href="@options.PageUrl(options.CurrentPage-1)" aria-label="@localizer("previous")">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
@for(int i=options.PagesBeforeStart; i<options.CurrentPage; i++)
{
<li><a @options.Operation(i) href="@options.PageUrl(i)">@i</a></li>
}
<li class="active">
<a href="javascript:void(0)">@options.CurrentPage <span class="sr-only">@localizer("current")</span></a>
</li>
@for (int i = options.CurrentPage+1; i <= options.PagesAfterStop; i++)
{
<li><a @options.Operation(i) href="@options.PageUrl(i)">@i</a></li>
}
<li class="@(options.HasPagesAfter ? "" : "disabled")">
<a @options.Operation(options.CurrentPage+1) href="@options.PageUrl(options.CurrentPage+1)" aria-label="@localizer("next")">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</ul>
</nav>
}