forked from dncuug/X.PagedList
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dncuug#134 from CrestApps/master
Fix an issue dncuug#127 and adds example for Bootstrap 4.1+ support
- Loading branch information
Showing
434 changed files
with
81,512 additions
and
3 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
examples/X.PagedList.Mvc.Example.Core/Controllers/Bootstrap41Controller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace X.PagedList.Mvc.Example.Core.Controllers | ||
{ | ||
public class Bootstrap41Controller : HomeController | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
examples/X.PagedList.Mvc.Example.Core/Views/Bootstrap41/AjaxIndex.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@{ | ||
ViewBag.Title = "Product Listing"; | ||
} | ||
|
||
@using X.PagedList; @*import this so we can cast our list to IPagedList (only necessary because ViewBag is dynamic)*@ | ||
|
||
<!-- loop through each of your products and display it however you want. we're just printing the name here --> | ||
<h2>List of Products</h2> | ||
<div id="nameListContainer"> | ||
@Html.Partial("_NameListPartial", (IPagedList<string>)ViewBag.Names) | ||
</div> |
27 changes: 27 additions & 0 deletions
27
examples/X.PagedList.Mvc.Example.Core/Views/Bootstrap41/Index.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@{ | ||
Layout = "~/Views/Shared/_Layout-41.cshtml"; | ||
ViewBag.Title = "Product Listing"; | ||
} | ||
|
||
@using X.PagedList.Mvc.Core; @*import this so we get our HTML Helper*@ | ||
@using X.PagedList; @*import this so we can cast our list to IPagedList (only necessary because ViewBag is dynamic)*@ | ||
|
||
<!-- import the included stylesheet for some (very basic) default styling --> | ||
<link href="/Content/PagedList.css" rel="stylesheet" type="text/css" /> | ||
|
||
<!-- loop through each of your products and display it however you want. we're just printing the name here --> | ||
<section class="mt-4"> | ||
<h2>List of Products</h2> | ||
<ul> | ||
@foreach (var name in ViewBag.Names) | ||
{ | ||
<li>@name</li> | ||
} | ||
</ul> | ||
</section> | ||
|
||
<!-- output a paging control that lets the user navigation to the previous page, next page, etc --> | ||
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), new X.PagedList.Mvc.Common.PagedListRenderOptionsBase | ||
{ | ||
DisplayItemSliceAndTotal = true, | ||
}) |
18 changes: 18 additions & 0 deletions
18
examples/X.PagedList.Mvc.Example.Core/Views/Bootstrap41/_NameListPartial.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@*use this for the fake AjaxOptions since ajax helpers were dropped in .net core*@ | ||
@model IPagedList<string> | ||
|
||
@*import this so we get our HTML Helper*@ | ||
@using X.PagedList.Mvc.Core; | ||
|
||
@*import this so we can cast our list to IPagedList (only necessary because ViewBag is dynamic)*@ | ||
@using X.PagedList; | ||
@using X.PagedList.Mvc.Common | ||
|
||
<ul> | ||
@foreach (var name in Model) | ||
{ | ||
<li>@name</li> | ||
} | ||
</ul> | ||
|
||
@Html.PagedListPager((IPagedList<string>)ViewBag.Names, page => Url.Action("GetOnePageOfNames", new { page }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new PagedListRenderOptions { MaximumPageNumbersToDisplay = 5, DisplayPageCountAndCurrentLocation = true, UlElementClasses = new[] { "pagination" }, ContainerDivClasses = new[] { "pagination-container" } }, new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "nameListContainer" })) |
73 changes: 73 additions & 0 deletions
73
examples/X.PagedList.Mvc.Example.Core/Views/Shared/_Layout-41.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>@ViewData["Title"] - X.PagedList.Mvc.Example.Core</title> | ||
|
||
<environment names="Development"> | ||
<link rel="stylesheet" href="~/lib/bootstrap-modern/dist/css/bootstrap.css" /> | ||
<link rel="stylesheet" href="~/css/site.css" /> | ||
<link rel="stylesheet" href="~/css/PagedList.css" /> | ||
</environment> | ||
<environment names="Staging,Production"> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" | ||
asp-fallback-href="~/lib/bootstrap-modern/dist/css/bootstrap.css" | ||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" /> | ||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" /> | ||
</environment> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"> | ||
<div class="container"> | ||
<a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">X.PagedList.Mvc.Example.Core</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
|
||
<div class="collapse navbar-collapse" id="navbarHeader"> | ||
<ul class="navbar-nav mr-auto"> | ||
<li class="nav-item"><a class="nav-link" asp-area="" asp-controller="Home" asp-action="Index">Traditional Paging</a></li> | ||
<li class="nav-item"><a class="nav-link" asp-area="" asp-controller="Home" asp-action="AjaxIndex">AJAX Paging</a></li> | ||
<li class="nav-item"><a class="nav-link" asp-area="" asp-controller="Bootstrap41" asp-action="Index">Traditional Paging (Bootstrap 4.1+)</a></li> | ||
<li class="nav-item"><a class="nav-link" asp-area="" asp-controller="Bootstrap41" asp-action="AjaxIndex">AJAX Paging (Bootstrap 4.1+)</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<div class="container body-content"> | ||
@RenderBody() | ||
<hr /> | ||
<footer> | ||
<p>© 2017 - X.PagedList.Mvc.Example.Core</p> | ||
</footer> | ||
</div> | ||
|
||
<environment names="Development"> | ||
<script src="~/lib/jquery/dist/jquery.js"></script> | ||
<script src="~/lib/bootstrap-modern/dist/js/bootstrap.js"></script> | ||
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.js"></script> | ||
<script src="~/js/site.js" asp-append-version="true"></script> | ||
</environment> | ||
<environment names="Staging,Production"> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js" | ||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js" | ||
asp-fallback-test="window.jQuery" | ||
crossorigin="anonymous" | ||
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk"> | ||
</script> | ||
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" | ||
asp-fallback-src="~/lib/bootstrap-modern/dist/js/bootstrap.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal" | ||
crossorigin="anonymous" | ||
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"> | ||
</script> | ||
<script src="~/js/site.min.js" asp-append-version="true"></script> | ||
</environment> | ||
|
||
@RenderSection("Scripts", required: false) | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
examples/X.PagedList.Mvc.Example.Core/wwwroot/lib/bootstrap-modern/.babelrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/env', | ||
{ | ||
loose: true, | ||
modules: false, | ||
exclude: ['transform-typeof-symbol'] | ||
} | ||
] | ||
], | ||
plugins: [ | ||
'@babel/proposal-object-rest-spread' | ||
], | ||
env: { | ||
test: { | ||
plugins: [ 'istanbul' ] | ||
} | ||
} | ||
}; |
14 changes: 14 additions & 0 deletions
14
examples/X.PagedList.Mvc.Example.Core/wwwroot/lib/bootstrap-modern/.bower.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "bootstrap", | ||
"homepage": "https://github.com/twbs/bootstrap", | ||
"version": "4.1.3", | ||
"_release": "4.1.3", | ||
"_resolution": { | ||
"type": "version", | ||
"tag": "v4.1.3", | ||
"commit": "3b558734382ce58b51e5fc676453bfd53bba9201" | ||
}, | ||
"_source": "https://github.com/twbs/bootstrap.git", | ||
"_target": "4.1.3", | ||
"_originalSource": "bootstrap" | ||
} |
13 changes: 13 additions & 0 deletions
13
examples/X.PagedList.Mvc.Example.Core/wwwroot/lib/bootstrap-modern/.browserslistrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# https://github.com/browserslist/browserslist#readme | ||
|
||
>= 1% | ||
last 1 major version | ||
not dead | ||
Chrome >= 45 | ||
Firefox >= 38 | ||
Edge >= 12 | ||
Explorer >= 10 | ||
iOS >= 9 | ||
Safari >= 9 | ||
Android >= 4.4 | ||
Opera >= 30 |
14 changes: 14 additions & 0 deletions
14
examples/X.PagedList.Mvc.Example.Core/wwwroot/lib/bootstrap-modern/.editorconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
5 changes: 5 additions & 0 deletions
5
examples/X.PagedList.Mvc.Example.Core/wwwroot/lib/bootstrap-modern/.eslintignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
**/*.min.js | ||
**/dist/ | ||
**/vendor/ | ||
/_gh_pages/ | ||
/package.js |
Oops, something went wrong.