Skip to content

Commit d9e2983

Browse files
Migrated Views
1 parent 6e99431 commit d9e2983

File tree

10 files changed

+233
-0
lines changed

10 files changed

+233
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@{
2+
ViewData["Title"] = "Home Page";
3+
}
4+
5+
<div class="text-center">
6+
<h1 class="display-4">Welcome</h1>
7+
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
8+
</div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@{
2+
ViewData["Title"] = "Privacy Policy";
3+
}
4+
<h1>@ViewData["Title"]</h1>
5+
6+
<p>Use this page to detail your site's privacy policy.</p>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@model jQueryDatatableServerSideNetCore.Models.ErrorViewModel
2+
@{
3+
ViewData["Title"] = "Error";
4+
}
5+
6+
<h1 class="text-danger">Error.</h1>
7+
<h2 class="text-danger">An error occurred while processing your request.</h2>
8+
9+
@if (Model.ShowRequestId)
10+
{
11+
<p>
12+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
13+
</p>
14+
}
15+
16+
<h3>Development Mode</h3>
17+
<p>
18+
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
19+
</p>
20+
<p>
21+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
22+
It can result in displaying sensitive information from exceptions to end users.
23+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
24+
and restarting the app.
25+
</p>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@using Microsoft.AspNetCore.Http.Features
2+
3+
@{
4+
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
5+
var showBanner = !consentFeature?.CanTrack ?? false;
6+
var cookieString = consentFeature?.CreateConsentCookie();
7+
}
8+
9+
@if (showBanner)
10+
{
11+
<div id="cookieConsent" class="alert alert-info alert-dismissible fade show" role="alert">
12+
Use this space to summarize your privacy and cookie use policy. <a asp-area="" asp-controller="Home" asp-action="Privacy">Learn More</a>.
13+
<button type="button" class="accept-policy close" data-dismiss="alert" aria-label="Close" data-cookie-string="@cookieString">
14+
<span aria-hidden="true">Accept</span>
15+
</button>
16+
</div>
17+
<script>
18+
(function () {
19+
var button = document.querySelector("#cookieConsent button[data-cookie-string]");
20+
button.addEventListener("click", function (event) {
21+
document.cookie = button.dataset.cookieString;
22+
}, false);
23+
})();
24+
</script>
25+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>@ViewData["Title"] - jQueryDatatableServerSideNetCore</title>
7+
8+
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
9+
10+
<link rel="stylesheet" href="~/css/site.css" />
11+
12+
@RenderSection("Styles", required: false)
13+
</head>
14+
<body>
15+
<header>
16+
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
17+
<div class="container">
18+
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">jQueryDatatableServerSideNetCore</a>
19+
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
20+
aria-expanded="false" aria-label="Toggle navigation">
21+
<span class="navbar-toggler-icon"></span>
22+
</button>
23+
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
24+
<partial name="_LoginPartial" />
25+
<ul class="navbar-nav flex-grow-1">
26+
<li class="nav-item">
27+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
28+
</li>
29+
<li class="nav-item">
30+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
31+
</li>
32+
<li class="nav-item">
33+
<a class="nav-link text-dark" asp-area="" asp-controller="TestRegisters" asp-action="Index">Test DataTable</a>
34+
</li>
35+
</ul>
36+
</div>
37+
</div>
38+
</nav>
39+
</header>
40+
<div class="container">
41+
<partial name="_CookieConsentPartial" />
42+
<main role="main" class="pb-3">
43+
@RenderBody()
44+
</main>
45+
</div>
46+
47+
<footer class="border-top footer text-muted">
48+
<div class="container">
49+
&copy; @DateTime.Now - jQueryDatatableServerSideNetCore - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
50+
</div>
51+
</footer>
52+
53+
<script src="~/lib/jquery/dist/jquery.js"></script>
54+
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
55+
56+
<script src="~/js/site.js" asp-append-version="true"></script>
57+
58+
@RenderSection("Scripts", required: false)
59+
</body>
60+
</html>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@using Microsoft.AspNetCore.Identity
2+
@inject SignInManager<IdentityUser> SignInManager
3+
@inject UserManager<IdentityUser> UserManager
4+
5+
<ul class="navbar-nav">
6+
@if (SignInManager.IsSignedIn(User))
7+
{
8+
<li class="nav-item">
9+
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
10+
</li>
11+
<li class="nav-item">
12+
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
13+
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
14+
</form>
15+
</li>
16+
}
17+
else
18+
{
19+
<li class="nav-item">
20+
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
21+
</li>
22+
<li class="nav-item">
23+
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
24+
</li>
25+
}
26+
</ul>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<environment include="Development">
2+
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
3+
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
4+
</environment>
5+
<environment exclude="Development">
6+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"
7+
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
8+
asp-fallback-test="window.jQuery && window.jQuery.validator"
9+
crossorigin="anonymous"
10+
integrity="sha256-F6h55Qw6sweK+t7SiOJX+2bpSAa3b/fnlrVCJvmEj1A=">
11+
</script>
12+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"
13+
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
14+
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
15+
crossorigin="anonymous"
16+
integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY=">
17+
</script>
18+
</environment>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
@model IEnumerable<jQueryDatatableServerSideNetCore.Models.DatabaseModels.TestRegister>
2+
3+
@{
4+
ViewData["Title"] = "Index";
5+
Layout = "~/Views/Shared/_Layout.cshtml";
6+
}
7+
8+
<div class="row">
9+
<div class="col-md-12">
10+
<table id="test-registers" class="table">
11+
<thead>
12+
<tr>
13+
<th>
14+
@Html.DisplayNameFor(model => model.Id)
15+
</th>
16+
<th>
17+
@Html.DisplayNameFor(model => model.Name)
18+
</th>
19+
<th>
20+
@Html.DisplayNameFor(model => model.FirstSurname)
21+
</th>
22+
<th>
23+
@Html.DisplayNameFor(model => model.SecondSurname)
24+
</th>
25+
<th>
26+
@Html.DisplayNameFor(model => model.Street)
27+
</th>
28+
<th>
29+
@Html.DisplayNameFor(model => model.Phone)
30+
</th>
31+
<th>
32+
@Html.DisplayNameFor(model => model.ZipCode)
33+
</th>
34+
<th>
35+
@Html.DisplayNameFor(model => model.Country)
36+
</th>
37+
<th>
38+
@Html.DisplayNameFor(model => model.Notes)
39+
</th>
40+
<th>
41+
@Html.DisplayNameFor(model => model.CreationDate)
42+
</th>
43+
<th></th>
44+
</tr>
45+
</thead>
46+
</table>
47+
</div>
48+
</div>
49+
50+
@section Styles{
51+
<link rel="stylesheet" href="~/lib/datatables/css/dataTables.bootstrap4.min.css" asp-append-version="true" />
52+
}
53+
54+
@section Scripts{
55+
<script src="~/lib/momentjs/moment.min.js" asp-append-version="true"></script>
56+
<script src="~/lib/datatables/js/jquery.dataTables.min.js" asp-append-version="true"></script>
57+
<script src="~/lib/datetime-moment/datetime-moment.js" asp-append-version="true"></script>
58+
<script src="~/lib/datatables/js/dataTables.bootstrap4.js" asp-append-version="true"></script>
59+
60+
<script src="~/js/app.js" asp-append-version="true"></script>
61+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@{
2+
Layout = "_Layout";
3+
}

0 commit comments

Comments
 (0)