Skip to content

Commit

Permalink
Style Pager in TheTheme (#17268)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Dec 20, 2024
1 parent 50a051f commit 6322061
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/OrchardCore.Themes/TheTheme/Views/Pager.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@{
Model.Metadata.Alternates.Clear();
Model.Metadata.Type = "Pager_Links";
}

<nav aria-label="@T["Listing pages"]">
@await DisplayAsync(Model)
</nav>
13 changes: 13 additions & 0 deletions src/OrchardCore.Themes/TheTheme/Views/Pager_CurrentPage.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@{
Model.Metadata.Alternates.Clear();
Model.Metadata.Type = "Pager_Link";
var parentTag = Model.Tag as TagBuilder;

if (parentTag != null)
{
parentTag.AddCssClass("active");
parentTag.MergeAttribute("aria-current", "page");
}
}

@await DisplayAsync(Model)
18 changes: 18 additions & 0 deletions src/OrchardCore.Themes/TheTheme/Views/Pager_First.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@using Microsoft.AspNetCore.Html

@{
Model.Metadata.Alternates.Clear();
Model.Metadata.Type = "Pager_Link";
var value = new HtmlContentBuilder();
value.AppendHtml("<i class=\"fa-solid fa-angles-left\"></i>");
Model.Value = value;

var parentTag = Model.Tag as TagBuilder;

if (parentTag != null)
{
parentTag.MergeAttribute("title", T["Go to first page."].Value);
}
}

@await DisplayAsync(Model)
11 changes: 11 additions & 0 deletions src/OrchardCore.Themes/TheTheme/Views/Pager_Gap.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@using Microsoft.AspNetCore.Html

@{
Model.Metadata.Alternates.Clear();
Model.Metadata.Type = "Pager_Link";
var value = new HtmlContentBuilder();
value.AppendHtml("<i class=\"fa-solid fa-ellipsis\"></i>");
Model.Value = value;
}

@await DisplayAsync(Model)
18 changes: 18 additions & 0 deletions src/OrchardCore.Themes/TheTheme/Views/Pager_Last.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@using Microsoft.AspNetCore.Html

@{
Model.Metadata.Alternates.Clear();
Model.Metadata.Type = "Pager_Link";
var value = new HtmlContentBuilder();
value.AppendHtml("<i class=\"fa-solid fa-angles-right\"></i>");
Model.Value = value;

var parentTag = Model.Tag as TagBuilder;

if (parentTag != null)
{
parentTag.MergeAttribute("title", T["Go to last page."].Value);
}
}

@await DisplayAsync(Model)
13 changes: 13 additions & 0 deletions src/OrchardCore.Themes/TheTheme/Views/Pager_Link.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@{
Model.Metadata.Alternates.Clear();
Model.Metadata.Type = "ActionLink";
Model.Classes.Add("page-link");
var parentTag = Model.Tag as TagBuilder;

if (parentTag != null)
{
parentTag.AddCssClass("page-item");
}
}

@await DisplayAsync(Model)
18 changes: 18 additions & 0 deletions src/OrchardCore.Themes/TheTheme/Views/Pager_Next.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@using Microsoft.AspNetCore.Html

@{
Model.Metadata.Alternates.Clear();
Model.Metadata.Type = "Pager_Link";
var value = new HtmlContentBuilder();
value.AppendHtml("<i class=\"fa-solid fa-angle-right\"></i>");
Model.Value = value;

var parentTag = Model.Tag as TagBuilder;

if (parentTag != null)
{
parentTag.MergeAttribute("title", T["Go to next page."].Value);
}
}

@await DisplayAsync(Model)
18 changes: 18 additions & 0 deletions src/OrchardCore.Themes/TheTheme/Views/Pager_Previous.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@using Microsoft.AspNetCore.Html

@{
Model.Metadata.Alternates.Clear();
Model.Metadata.Type = "Pager_Link";
var value = new HtmlContentBuilder();
value.AppendHtml("<i class=\"fa-solid fa-angle-left\"></i>");
Model.Value = value;

var parentTag = Model.Tag as TagBuilder;

if (parentTag != null)
{
parentTag.MergeAttribute("title", T["Go to previous page."].Value);
}
}

@await DisplayAsync(Model)

0 comments on commit 6322061

Please sign in to comment.