This commit is contained in:
Jon Galloway 2025-05-13 05:45:49 +00:00 committed by GitHub
commit 857a132f27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
188 changed files with 58308 additions and 40975 deletions

View file

@ -3,7 +3,7 @@
{
"name": "Intro to .NET webdev",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:8.0",
"image": "mcr.microsoft.com/devcontainers/dotnet:9.0",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {},

View file

@ -10,7 +10,7 @@ on:
branches: [ main ]
env:
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
DOTNET_VERSION: '9.0.x' # The .NET SDK version to use
jobs:
build:

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View file

@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.33808.371
VisualStudioVersion = 17.14.36105.17 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorPagesPizza", "RazorPagesPizza\RazorPagesPizza.csproj", "{ADA085D1-1380-4955-A58D-FD688EC5B4B9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorPagesPizza", "RazorPagesPizza\RazorPagesPizza.csproj", "{243A1A33-7C10-48AA-B690-7D574211C5A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,15 +11,15 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Release|Any CPU.Build.0 = Release|Any CPU
{243A1A33-7C10-48AA-B690-7D574211C5A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{243A1A33-7C10-48AA-B690-7D574211C5A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{243A1A33-7C10-48AA-B690-7D574211C5A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{243A1A33-7C10-48AA-B690-7D574211C5A8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7052E9F1-F97B-4A22-AEA8-66D01D921E93}
SolutionGuid = {768BD1A9-D918-42C0-A4FA-FC6B038F477E}
EndGlobalSection
EndGlobal

View file

@ -1,6 +1,6 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;
namespace RazorPagesPizza.Pages
{
@ -24,4 +24,5 @@ namespace RazorPagesPizza.Pages
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}

View file

@ -6,5 +6,5 @@
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>

View file

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace RazorPagesPizza.Pages

View file

@ -16,4 +16,5 @@ namespace RazorPagesPizza.Pages
{
}
}
}

View file

@ -4,6 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - RazorPagesPizza</title>
<script type="importmap"></script>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/RazorPagesPizza.styles.css" asp-append-version="true" />
@ -38,7 +39,7 @@
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2023 - RazorPagesPizza - <a asp-area="" asp-page="/Privacy">Privacy</a>
&copy; 2025 - RazorPagesPizza - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>

View file

@ -1,4 +1,4 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {

View file

@ -1,2 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.min.js"></script>

View file

@ -14,12 +14,13 @@ if (!app.Environment.IsDevelopment())
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapRazorPages();
app.MapStaticAssets();
app.MapRazorPages()
.WithStaticAssets();
app.Run();

View file

@ -1,18 +1,11 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:56089",
"sslPort": 44328
}
},
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5101",
"applicationUrl": "http://localhost:5295",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
@ -21,14 +14,7 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7001;http://localhost:5101",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"applicationUrl": "https://localhost:7096;http://localhost:5295",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

View file

@ -8,6 +8,10 @@ html {
}
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
html {
position: relative;
min-height: 100%;
@ -16,3 +20,12 @@ html {
body {
margin-bottom: 60px;
}
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
text-align: start;
}

View file

@ -1,4 +1,4 @@
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.

View file

@ -1,10 +1,185 @@
/*!
* Bootstrap Reboot v5.1.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Bootstrap Reboot v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
:root,
[data-bs-theme=light] {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-primary-text-emphasis: #052c65;
--bs-secondary-text-emphasis: #2b2f32;
--bs-success-text-emphasis: #0a3622;
--bs-info-text-emphasis: #055160;
--bs-warning-text-emphasis: #664d03;
--bs-danger-text-emphasis: #58151c;
--bs-light-text-emphasis: #495057;
--bs-dark-text-emphasis: #495057;
--bs-primary-bg-subtle: #cfe2ff;
--bs-secondary-bg-subtle: #e2e3e5;
--bs-success-bg-subtle: #d1e7dd;
--bs-info-bg-subtle: #cff4fc;
--bs-warning-bg-subtle: #fff3cd;
--bs-danger-bg-subtle: #f8d7da;
--bs-light-bg-subtle: #fcfcfd;
--bs-dark-bg-subtle: #ced4da;
--bs-primary-border-subtle: #9ec5fe;
--bs-secondary-border-subtle: #c4c8cb;
--bs-success-border-subtle: #a3cfbb;
--bs-info-border-subtle: #9eeaf9;
--bs-warning-border-subtle: #ffe69c;
--bs-danger-border-subtle: #f1aeb5;
--bs-light-border-subtle: #e9ecef;
--bs-dark-border-subtle: #adb5bd;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg: #fff;
--bs-body-bg-rgb: 255, 255, 255;
--bs-emphasis-color: #000;
--bs-emphasis-color-rgb: 0, 0, 0;
--bs-secondary-color: rgba(33, 37, 41, 0.75);
--bs-secondary-color-rgb: 33, 37, 41;
--bs-secondary-bg: #e9ecef;
--bs-secondary-bg-rgb: 233, 236, 239;
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
--bs-tertiary-color-rgb: 33, 37, 41;
--bs-tertiary-bg: #f8f9fa;
--bs-tertiary-bg-rgb: 248, 249, 250;
--bs-heading-color: inherit;
--bs-link-color: #0d6efd;
--bs-link-color-rgb: 13, 110, 253;
--bs-link-decoration: underline;
--bs-link-hover-color: #0a58ca;
--bs-link-hover-color-rgb: 10, 88, 202;
--bs-code-color: #d63384;
--bs-highlight-color: #212529;
--bs-highlight-bg: #fff3cd;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-xxl: 2rem;
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
--bs-border-radius-pill: 50rem;
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
--bs-focus-ring-width: 0.25rem;
--bs-focus-ring-opacity: 0.25;
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
--bs-form-valid-color: #198754;
--bs-form-valid-border-color: #198754;
--bs-form-invalid-color: #dc3545;
--bs-form-invalid-border-color: #dc3545;
}
[data-bs-theme=dark] {
color-scheme: dark;
--bs-body-color: #dee2e6;
--bs-body-color-rgb: 222, 226, 230;
--bs-body-bg: #212529;
--bs-body-bg-rgb: 33, 37, 41;
--bs-emphasis-color: #fff;
--bs-emphasis-color-rgb: 255, 255, 255;
--bs-secondary-color: rgba(222, 226, 230, 0.75);
--bs-secondary-color-rgb: 222, 226, 230;
--bs-secondary-bg: #343a40;
--bs-secondary-bg-rgb: 52, 58, 64;
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
--bs-tertiary-color-rgb: 222, 226, 230;
--bs-tertiary-bg: #2b3035;
--bs-tertiary-bg-rgb: 43, 48, 53;
--bs-primary-text-emphasis: #6ea8fe;
--bs-secondary-text-emphasis: #a7acb1;
--bs-success-text-emphasis: #75b798;
--bs-info-text-emphasis: #6edff6;
--bs-warning-text-emphasis: #ffda6a;
--bs-danger-text-emphasis: #ea868f;
--bs-light-text-emphasis: #f8f9fa;
--bs-dark-text-emphasis: #dee2e6;
--bs-primary-bg-subtle: #031633;
--bs-secondary-bg-subtle: #161719;
--bs-success-bg-subtle: #051b11;
--bs-info-bg-subtle: #032830;
--bs-warning-bg-subtle: #332701;
--bs-danger-bg-subtle: #2c0b0e;
--bs-light-bg-subtle: #343a40;
--bs-dark-bg-subtle: #1a1d20;
--bs-primary-border-subtle: #084298;
--bs-secondary-border-subtle: #41464b;
--bs-success-border-subtle: #0f5132;
--bs-info-border-subtle: #087990;
--bs-warning-border-subtle: #997404;
--bs-danger-border-subtle: #842029;
--bs-light-border-subtle: #495057;
--bs-dark-border-subtle: #343a40;
--bs-heading-color: inherit;
--bs-link-color: #6ea8fe;
--bs-link-hover-color: #8bb9fe;
--bs-link-color-rgb: 110, 168, 254;
--bs-link-hover-color-rgb: 139, 185, 254;
--bs-code-color: #e685b5;
--bs-highlight-color: #dee2e6;
--bs-highlight-bg: #664d03;
--bs-border-color: #495057;
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
--bs-form-valid-color: #75b798;
--bs-form-valid-border-color: #75b798;
--bs-form-invalid-color: #ea868f;
--bs-form-invalid-border-color: #ea868f;
}
*,
*::before,
*::after {
@ -33,20 +208,17 @@ body {
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
color: var(--bs-heading-color);
}
h1 {
@ -98,8 +270,7 @@ p {
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
@ -155,8 +326,9 @@ small {
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
padding: 0.1875em;
color: var(--bs-highlight-color);
background-color: var(--bs-highlight-bg);
}
sub,
@ -176,11 +348,11 @@ sup {
}
a {
color: #0d6efd;
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline;
}
a:hover {
color: #0a58ca;
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
@ -192,10 +364,8 @@ pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-family: var(--bs-font-monospace);
font-size: 1em;
direction: ltr /* rtl:ignore */;
unicode-bidi: bidi-override;
}
pre {
@ -213,7 +383,7 @@ pre code {
code {
font-size: 0.875em;
color: #d63384;
color: var(--bs-code-color);
word-wrap: break-word;
}
a > code {
@ -221,16 +391,15 @@ a > code {
}
kbd {
padding: 0.2rem 0.4rem;
padding: 0.1875rem 0.375rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
color: var(--bs-body-bg);
background-color: var(--bs-body-color);
border-radius: 0.25rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
@ -250,7 +419,7 @@ table {
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #6c757d;
color: var(--bs-secondary-color);
text-align: left;
}
@ -309,8 +478,8 @@ select:disabled {
opacity: 1;
}
[list]::-webkit-calendar-picker-indicator {
display: none;
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none !important;
}
button,
@ -374,8 +543,8 @@ legend + * {
}
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
outline-offset: -2px;
}
/* rtl:raw:
@ -394,11 +563,12 @@ legend + * {
padding: 0;
}
::file-selector-button {
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
::-webkit-file-upload-button {
::file-selector-button {
font: inherit;
-webkit-appearance: button;
}

View file

@ -1,10 +1,185 @@
/*!
* Bootstrap Reboot v5.1.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Bootstrap Reboot v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
:root,
[data-bs-theme=light] {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-primary-text-emphasis: #052c65;
--bs-secondary-text-emphasis: #2b2f32;
--bs-success-text-emphasis: #0a3622;
--bs-info-text-emphasis: #055160;
--bs-warning-text-emphasis: #664d03;
--bs-danger-text-emphasis: #58151c;
--bs-light-text-emphasis: #495057;
--bs-dark-text-emphasis: #495057;
--bs-primary-bg-subtle: #cfe2ff;
--bs-secondary-bg-subtle: #e2e3e5;
--bs-success-bg-subtle: #d1e7dd;
--bs-info-bg-subtle: #cff4fc;
--bs-warning-bg-subtle: #fff3cd;
--bs-danger-bg-subtle: #f8d7da;
--bs-light-bg-subtle: #fcfcfd;
--bs-dark-bg-subtle: #ced4da;
--bs-primary-border-subtle: #9ec5fe;
--bs-secondary-border-subtle: #c4c8cb;
--bs-success-border-subtle: #a3cfbb;
--bs-info-border-subtle: #9eeaf9;
--bs-warning-border-subtle: #ffe69c;
--bs-danger-border-subtle: #f1aeb5;
--bs-light-border-subtle: #e9ecef;
--bs-dark-border-subtle: #adb5bd;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg: #fff;
--bs-body-bg-rgb: 255, 255, 255;
--bs-emphasis-color: #000;
--bs-emphasis-color-rgb: 0, 0, 0;
--bs-secondary-color: rgba(33, 37, 41, 0.75);
--bs-secondary-color-rgb: 33, 37, 41;
--bs-secondary-bg: #e9ecef;
--bs-secondary-bg-rgb: 233, 236, 239;
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
--bs-tertiary-color-rgb: 33, 37, 41;
--bs-tertiary-bg: #f8f9fa;
--bs-tertiary-bg-rgb: 248, 249, 250;
--bs-heading-color: inherit;
--bs-link-color: #0d6efd;
--bs-link-color-rgb: 13, 110, 253;
--bs-link-decoration: underline;
--bs-link-hover-color: #0a58ca;
--bs-link-hover-color-rgb: 10, 88, 202;
--bs-code-color: #d63384;
--bs-highlight-color: #212529;
--bs-highlight-bg: #fff3cd;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-xxl: 2rem;
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
--bs-border-radius-pill: 50rem;
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
--bs-focus-ring-width: 0.25rem;
--bs-focus-ring-opacity: 0.25;
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
--bs-form-valid-color: #198754;
--bs-form-valid-border-color: #198754;
--bs-form-invalid-color: #dc3545;
--bs-form-invalid-border-color: #dc3545;
}
[data-bs-theme=dark] {
color-scheme: dark;
--bs-body-color: #dee2e6;
--bs-body-color-rgb: 222, 226, 230;
--bs-body-bg: #212529;
--bs-body-bg-rgb: 33, 37, 41;
--bs-emphasis-color: #fff;
--bs-emphasis-color-rgb: 255, 255, 255;
--bs-secondary-color: rgba(222, 226, 230, 0.75);
--bs-secondary-color-rgb: 222, 226, 230;
--bs-secondary-bg: #343a40;
--bs-secondary-bg-rgb: 52, 58, 64;
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
--bs-tertiary-color-rgb: 222, 226, 230;
--bs-tertiary-bg: #2b3035;
--bs-tertiary-bg-rgb: 43, 48, 53;
--bs-primary-text-emphasis: #6ea8fe;
--bs-secondary-text-emphasis: #a7acb1;
--bs-success-text-emphasis: #75b798;
--bs-info-text-emphasis: #6edff6;
--bs-warning-text-emphasis: #ffda6a;
--bs-danger-text-emphasis: #ea868f;
--bs-light-text-emphasis: #f8f9fa;
--bs-dark-text-emphasis: #dee2e6;
--bs-primary-bg-subtle: #031633;
--bs-secondary-bg-subtle: #161719;
--bs-success-bg-subtle: #051b11;
--bs-info-bg-subtle: #032830;
--bs-warning-bg-subtle: #332701;
--bs-danger-bg-subtle: #2c0b0e;
--bs-light-bg-subtle: #343a40;
--bs-dark-bg-subtle: #1a1d20;
--bs-primary-border-subtle: #084298;
--bs-secondary-border-subtle: #41464b;
--bs-success-border-subtle: #0f5132;
--bs-info-border-subtle: #087990;
--bs-warning-border-subtle: #997404;
--bs-danger-border-subtle: #842029;
--bs-light-border-subtle: #495057;
--bs-dark-border-subtle: #343a40;
--bs-heading-color: inherit;
--bs-link-color: #6ea8fe;
--bs-link-hover-color: #8bb9fe;
--bs-link-color-rgb: 110, 168, 254;
--bs-link-hover-color-rgb: 139, 185, 254;
--bs-code-color: #e685b5;
--bs-highlight-color: #dee2e6;
--bs-highlight-bg: #664d03;
--bs-border-color: #495057;
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
--bs-form-valid-color: #75b798;
--bs-form-valid-border-color: #75b798;
--bs-form-invalid-color: #ea868f;
--bs-form-invalid-border-color: #ea868f;
}
*,
*::before,
*::after {
@ -33,20 +208,17 @@ body {
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
color: var(--bs-heading-color);
}
h1 {
@ -98,8 +270,7 @@ p {
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
@ -155,8 +326,9 @@ small {
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
padding: 0.1875em;
color: var(--bs-highlight-color);
background-color: var(--bs-highlight-bg);
}
sub,
@ -176,11 +348,11 @@ sup {
}
a {
color: #0d6efd;
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline;
}
a:hover {
color: #0a58ca;
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
@ -192,10 +364,8 @@ pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-family: var(--bs-font-monospace);
font-size: 1em;
direction: ltr ;
unicode-bidi: bidi-override;
}
pre {
@ -213,7 +383,7 @@ pre code {
code {
font-size: 0.875em;
color: #d63384;
color: var(--bs-code-color);
word-wrap: break-word;
}
a > code {
@ -221,16 +391,15 @@ a > code {
}
kbd {
padding: 0.2rem 0.4rem;
padding: 0.1875rem 0.375rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
color: var(--bs-body-bg);
background-color: var(--bs-body-color);
border-radius: 0.25rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
@ -250,7 +419,7 @@ table {
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #6c757d;
color: var(--bs-secondary-color);
text-align: right;
}
@ -309,8 +478,8 @@ select:disabled {
opacity: 1;
}
[list]::-webkit-calendar-picker-indicator {
display: none;
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none !important;
}
button,
@ -374,8 +543,8 @@ legend + * {
}
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type="tel"],
@ -392,11 +561,12 @@ legend + * {
padding: 0;
}
::file-selector-button {
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
::-webkit-file-upload-button {
::file-selector-button {
font: inherit;
-webkit-appearance: button;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,12 +1,23 @@
Copyright (c) .NET Foundation. All rights reserved.
The MIT License (MIT)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License. You may obtain a copy of the
License at
Copyright (c) .NET Foundation and Contributors
http://www.apache.org/licenses/LICENSE-2.0
All rights reserved.
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,7 +1,10 @@
// Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// @version v3.2.11
/**
* @license
* Unobtrusive validation support library for jQuery and jQuery Validate
* Copyright (c) .NET Foundation. All rights reserved.
* Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
* @version v4.0.0
*/
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global document: false, jQuery: false */

View file

@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.17.0
* jQuery Validation Plugin v1.21.0
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2017 Jörn Zaefferer
* Copyright (c) 2024 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
@ -43,6 +43,38 @@
}() );
/**
* This is used in the United States to process payments, deposits,
* or transfers using the Automated Clearing House (ACH) or Fedwire
* systems. A very common use case would be to validate a form for
* an ACH bill payment.
*/
$.validator.addMethod( "abaRoutingNumber", function( value ) {
var checksum = 0;
var tokens = value.split( "" );
var length = tokens.length;
// Length Check
if ( length !== 9 ) {
return false;
}
// Calc the checksum
// https://en.wikipedia.org/wiki/ABA_routing_transit_number
for ( var i = 0; i < length; i += 3 ) {
checksum += parseInt( tokens[ i ], 10 ) * 3 +
parseInt( tokens[ i + 1 ], 10 ) * 7 +
parseInt( tokens[ i + 2 ], 10 );
}
// If not zero and divisible by 10 then valid
if ( checksum !== 0 && checksum % 10 === 0 ) {
return true;
}
return false;
}, "Please enter a valid routing number." );
// Accept a value from a file input based on a required mimetype
$.validator.addMethod( "accept", function( value, element, param ) {
@ -87,7 +119,7 @@ $.validator.addMethod( "accept", function( value, element, param ) {
$.validator.addMethod( "alphanumeric", function( value, element ) {
return this.optional( element ) || /^\w+$/i.test( value );
}, "Letters, numbers, and underscores only please" );
}, "Letters, numbers, and underscores only please." );
/*
* Dutch bank account numbers (not 'giro' numbers) have 9 digits
@ -114,13 +146,13 @@ $.validator.addMethod( "bankaccountNL", function( value, element ) {
sum = sum + factor * digit;
}
return sum % 11 === 0;
}, "Please specify a valid bank account number" );
}, "Please specify a valid bank account number." );
$.validator.addMethod( "bankorgiroaccountNL", function( value, element ) {
return this.optional( element ) ||
( $.validator.methods.bankaccountNL.call( this, value, element ) ) ||
( $.validator.methods.giroaccountNL.call( this, value, element ) );
}, "Please specify a valid bank or giro account number" );
}, "Please specify a valid bank or giro account number." );
/**
* BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity.
@ -139,7 +171,7 @@ $.validator.addMethod( "bankorgiroaccountNL", function( value, element ) {
*/
$.validator.addMethod( "bic", function( value, element ) {
return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value.toUpperCase() );
}, "Please specify a valid BIC code" );
}, "Please specify a valid BIC code." );
/*
* Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities
@ -256,11 +288,141 @@ $.validator.addMethod( "cifES", function( value, element ) {
}, "Please specify a valid CIF number." );
/*
* Brazillian CNH number (Carteira Nacional de Habilitacao) is the License Driver number.
* CNH numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation.
*/
$.validator.addMethod( "cnhBR", function( value ) {
// Removing special characters from value
value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" );
// Checking value to have 11 digits only
if ( value.length !== 11 ) {
return false;
}
var sum = 0, dsc = 0, firstChar,
firstCN, secondCN, i, j, v;
firstChar = value.charAt( 0 );
if ( new Array( 12 ).join( firstChar ) === value ) {
return false;
}
// Step 1 - using first Check Number:
for ( i = 0, j = 9, v = 0; i < 9; ++i, --j ) {
sum += +( value.charAt( i ) * j );
}
firstCN = sum % 11;
if ( firstCN >= 10 ) {
firstCN = 0;
dsc = 2;
}
sum = 0;
for ( i = 0, j = 1, v = 0; i < 9; ++i, ++j ) {
sum += +( value.charAt( i ) * j );
}
secondCN = sum % 11;
if ( secondCN >= 10 ) {
secondCN = 0;
} else {
secondCN = secondCN - dsc;
}
return ( String( firstCN ).concat( secondCN ) === value.substr( -2 ) );
}, "Please specify a valid CNH number." );
/*
* Brazillian value number (Cadastrado de Pessoas Juridica).
* value numbers have 14 digits in total: 12 numbers followed by 2 check numbers that are being used for validation.
*/
$.validator.addMethod( "cnpjBR", function( value, element ) {
"use strict";
if ( this.optional( element ) ) {
return true;
}
// Removing no number
value = value.replace( /[^\d]+/g, "" );
// Checking value to have 14 digits only
if ( value.length !== 14 ) {
return false;
}
// Elimina values invalidos conhecidos
if ( value === "00000000000000" ||
value === "11111111111111" ||
value === "22222222222222" ||
value === "33333333333333" ||
value === "44444444444444" ||
value === "55555555555555" ||
value === "66666666666666" ||
value === "77777777777777" ||
value === "88888888888888" ||
value === "99999999999999" ) {
return false;
}
// Valida DVs
var tamanho = ( value.length - 2 );
var numeros = value.substring( 0, tamanho );
var digitos = value.substring( tamanho );
var soma = 0;
var pos = tamanho - 7;
for ( var i = tamanho; i >= 1; i-- ) {
soma += numeros.charAt( tamanho - i ) * pos--;
if ( pos < 2 ) {
pos = 9;
}
}
var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
if ( resultado !== parseInt( digitos.charAt( 0 ), 10 ) ) {
return false;
}
tamanho = tamanho + 1;
numeros = value.substring( 0, tamanho );
soma = 0;
pos = tamanho - 7;
for ( var il = tamanho; il >= 1; il-- ) {
soma += numeros.charAt( tamanho - il ) * pos--;
if ( pos < 2 ) {
pos = 9;
}
}
resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
if ( resultado !== parseInt( digitos.charAt( 1 ), 10 ) ) {
return false;
}
return true;
}, "Please specify a CNPJ value number." );
/*
* Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number.
* CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation.
*/
$.validator.addMethod( "cpfBR", function( value ) {
$.validator.addMethod( "cpfBR", function( value, element ) {
"use strict";
if ( this.optional( element ) ) {
return true;
}
// Removing special characters from value
value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" );
@ -315,7 +477,7 @@ $.validator.addMethod( "cpfBR", function( value ) {
}
return false;
}, "Please specify a valid CPF number" );
}, "Please specify a valid CPF number." );
// https://jqueryvalidation.org/creditcard-method/
// based on https://en.wikipedia.org/wiki/Luhn_algorithm
@ -337,7 +499,7 @@ $.validator.addMethod( "creditcard", function( value, element ) {
value = value.replace( /\D/g, "" );
// Basing min and max length on
// https://developer.ean.com/general_info/Valid_Credit_Card_Types
// https://dev.ean.com/general-info/valid-card-types/
if ( value.length < 13 || value.length > 19 ) {
return false;
}
@ -359,7 +521,7 @@ $.validator.addMethod( "creditcard", function( value, element ) {
}, "Please enter a valid credit card number." );
/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
* Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
* Redistributed under the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
* Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
*/
$.validator.addMethod( "creditcardtypes", function( value, element, param ) {
@ -398,7 +560,7 @@ $.validator.addMethod( "creditcardtypes", function( value, element, param ) {
if ( param.all ) {
validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
}
if ( validTypes & 0x0001 && /^(5[12345])/.test( value ) ) { // Mastercard
if ( validTypes & 0x0001 && ( /^(5[12345])/.test( value ) || /^(2[234567])/.test( value ) ) ) { // Mastercard
return value.length === 16;
}
if ( validTypes & 0x0002 && /^(4)/.test( value ) ) { // Visa
@ -468,7 +630,7 @@ $.validator.addMethod( "currency", function( value, element, param ) {
regex = new RegExp( regex );
return this.optional( element ) || regex.test( value );
}, "Please specify a valid currency" );
}, "Please specify a valid currency." );
$.validator.addMethod( "dateFA", function( value, element ) {
return this.optional( element ) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test( value );
@ -529,7 +691,31 @@ $.validator.addMethod( "extension", function( value, element, param ) {
*/
$.validator.addMethod( "giroaccountNL", function( value, element ) {
return this.optional( element ) || /^[0-9]{1,7}$/.test( value );
}, "Please specify a valid giro account number" );
}, "Please specify a valid giro account number." );
$.validator.addMethod( "greaterThan", function( value, element, param ) {
var target = $( param );
if ( this.settings.onfocusout && target.not( ".validate-greaterThan-blur" ).length ) {
target.addClass( "validate-greaterThan-blur" ).on( "blur.validate-greaterThan", function() {
$( element ).valid();
} );
}
return value > target.val();
}, "Please enter a greater value." );
$.validator.addMethod( "greaterThanEqual", function( value, element, param ) {
var target = $( param );
if ( this.settings.onfocusout && target.not( ".validate-greaterThanEqual-blur" ).length ) {
target.addClass( "validate-greaterThanEqual-blur" ).on( "blur.validate-greaterThanEqual", function() {
$( element ).valid();
} );
}
return value >= target.val();
}, "Please enter a greater value." );
/**
* IBAN is the international bank account number.
@ -666,11 +852,11 @@ $.validator.addMethod( "iban", function( value, element ) {
cRest = cOperator % 97;
}
return cRest === 1;
}, "Please specify a valid IBAN" );
}, "Please specify a valid IBAN." );
$.validator.addMethod( "integer", function( value, element ) {
return this.optional( element ) || /^-?\d+$/.test( value );
}, "A positive or negative non-decimal number please" );
}, "A positive or negative non-decimal number please." );
$.validator.addMethod( "ipv4", function( value, element ) {
return this.optional( element ) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test( value );
@ -680,17 +866,103 @@ $.validator.addMethod( "ipv6", function( value, element ) {
return this.optional( element ) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test( value );
}, "Please enter a valid IP v6 address." );
$.validator.addMethod( "lessThan", function( value, element, param ) {
var target = $( param );
if ( this.settings.onfocusout && target.not( ".validate-lessThan-blur" ).length ) {
target.addClass( "validate-lessThan-blur" ).on( "blur.validate-lessThan", function() {
$( element ).valid();
} );
}
return value < target.val();
}, "Please enter a lesser value." );
$.validator.addMethod( "lessThanEqual", function( value, element, param ) {
var target = $( param );
if ( this.settings.onfocusout && target.not( ".validate-lessThanEqual-blur" ).length ) {
target.addClass( "validate-lessThanEqual-blur" ).on( "blur.validate-lessThanEqual", function() {
$( element ).valid();
} );
}
return value <= target.val();
}, "Please enter a lesser value." );
$.validator.addMethod( "lettersonly", function( value, element ) {
return this.optional( element ) || /^[a-z]+$/i.test( value );
}, "Letters only please" );
}, "Letters only please." );
$.validator.addMethod( "letterswithbasicpunc", function( value, element ) {
return this.optional( element ) || /^[a-z\-.,()'"\s]+$/i.test( value );
}, "Letters or punctuation only please" );
}, "Letters or punctuation only please." );
// Limit the number of files in a FileList.
$.validator.addMethod( "maxfiles", function( value, element, param ) {
if ( this.optional( element ) ) {
return true;
}
if ( $( element ).attr( "type" ) === "file" ) {
if ( element.files && element.files.length > param ) {
return false;
}
}
return true;
}, $.validator.format( "Please select no more than {0} files." ) );
// Limit the size of each individual file in a FileList.
$.validator.addMethod( "maxsize", function( value, element, param ) {
if ( this.optional( element ) ) {
return true;
}
if ( $( element ).attr( "type" ) === "file" ) {
if ( element.files && element.files.length ) {
for ( var i = 0; i < element.files.length; i++ ) {
if ( element.files[ i ].size > param ) {
return false;
}
}
}
}
return true;
}, $.validator.format( "File size must not exceed {0} bytes each." ) );
// Limit the size of all files in a FileList.
$.validator.addMethod( "maxsizetotal", function( value, element, param ) {
if ( this.optional( element ) ) {
return true;
}
if ( $( element ).attr( "type" ) === "file" ) {
if ( element.files && element.files.length ) {
var totalSize = 0;
for ( var i = 0; i < element.files.length; i++ ) {
totalSize += element.files[ i ].size;
if ( totalSize > param ) {
return false;
}
}
}
}
return true;
}, $.validator.format( "Total size of all files must not exceed {0} bytes." ) );
$.validator.addMethod( "mobileNL", function( value, element ) {
return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test( value );
}, "Please specify a valid mobile number" );
}, "Please specify a valid mobile number." );
$.validator.addMethod( "mobileRU", function( phone_number, element ) {
var ruPhone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
return this.optional( element ) || ruPhone_number.length > 9 && /^((\+7|7|8)+([0-9]){10})$/.test( ruPhone_number );
}, "Please specify a valid mobile number." );
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
@ -704,7 +976,7 @@ $.validator.addMethod( "mobileUK", function( phone_number, element ) {
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
return this.optional( element ) || phone_number.length > 9 &&
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/ );
}, "Please specify a valid mobile number" );
}, "Please specify a valid mobile number." );
$.validator.addMethod( "netmask", function( value, element ) {
return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value );
@ -804,13 +1076,71 @@ $.validator.addMethod( "nipPL", function( value ) {
return ( intControlNr === parseInt( value[ 9 ], 10 ) );
}, "Please specify a valid NIP number." );
/**
* Created for project jquery-validation.
* @Description Brazillian PIS or NIS number (Número de Identificação Social Pis ou Pasep) is the equivalent of a
* Brazilian tax registration number NIS of PIS numbers have 11 digits in total: 10 numbers followed by 1 check numbers
* that are being used for validation.
* @copyright (c) 21/08/2018 13:14, Cleiton da Silva Mendonça
* @author Cleiton da Silva Mendonça <cleiton.mendonca@gmail.com>
* @link http://gitlab.com/csmendonca Gitlab of Cleiton da Silva Mendonça
* @link http://github.com/csmendonca Github of Cleiton da Silva Mendonça
*/
$.validator.addMethod( "nisBR", function( value ) {
var number;
var cn;
var sum = 0;
var dv;
var count;
var multiplier;
// Removing special characters from value
value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" );
// Checking value to have 11 digits only
if ( value.length !== 11 ) {
return false;
}
//Get check number of value
cn = parseInt( value.substring( 10, 11 ), 10 );
//Get number with 10 digits of the value
number = parseInt( value.substring( 0, 10 ), 10 );
for ( count = 2; count < 12; count++ ) {
multiplier = count;
if ( count === 10 ) {
multiplier = 2;
}
if ( count === 11 ) {
multiplier = 3;
}
sum += ( ( number % 10 ) * multiplier );
number = parseInt( number / 10, 10 );
}
dv = ( sum % 11 );
if ( dv > 1 ) {
dv = ( 11 - dv );
} else {
dv = 0;
}
if ( cn === dv ) {
return true;
} else {
return false;
}
}, "Please specify a valid NIS/PIS number." );
$.validator.addMethod( "notEqualTo", function( value, element, param ) {
return this.optional( element ) || !$.validator.methods.equalTo.call( this, value, element, param );
}, "Please enter a different value, values must not be the same." );
$.validator.addMethod( "nowhitespace", function( value, element ) {
return this.optional( element ) || /^\S+$/i.test( value );
}, "No white space please" );
}, "No white space please." );
/**
* Return true if the field value matches the given format RegExp
@ -842,6 +1172,30 @@ $.validator.addMethod( "phoneNL", function( value, element ) {
return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test( value );
}, "Please specify a valid phone number." );
/**
* Polish telephone numbers have 9 digits.
*
* Mobile phone numbers starts with following digits:
* 45, 50, 51, 53, 57, 60, 66, 69, 72, 73, 78, 79, 88.
*
* Fixed-line numbers starts with area codes:
* 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 29, 32, 33,
* 34, 41, 42, 43, 44, 46, 48, 52, 54, 55, 56, 58, 59, 61,
* 62, 63, 65, 67, 68, 71, 74, 75, 76, 77, 81, 82, 83, 84,
* 85, 86, 87, 89, 91, 94, 95.
*
* Ministry of National Defence numbers and VoIP numbers starts with 26 and 39.
*
* Excludes intelligent networks (premium rate, shared cost, free phone numbers).
*
* Poland National Numbering Plan http://www.itu.int/oth/T02020000A8/en
*/
$.validator.addMethod( "phonePL", function( phone_number, element ) {
phone_number = phone_number.replace( /\s+/g, "" );
var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;
return this.optional( element ) || regexp.test( phone_number );
}, "Please specify a valid phone number." );
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
* ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
@ -856,7 +1210,7 @@ $.validator.addMethod( "phonesUK", function( phone_number, element ) {
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
return this.optional( element ) || phone_number.length > 9 &&
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ );
}, "Please specify a valid uk phone number" );
}, "Please specify a valid uk phone number." );
/* For UK phone functions, do the following server side processing:
* Compare original input with this RegEx pattern:
@ -870,7 +1224,7 @@ $.validator.addMethod( "phoneUK", function( phone_number, element ) {
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
return this.optional( element ) || phone_number.length > 9 &&
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/ );
}, "Please specify a valid phone number" );
}, "Please specify a valid phone number." );
/**
* Matches US phone number format
@ -891,8 +1245,8 @@ $.validator.addMethod( "phoneUK", function( phone_number, element ) {
$.validator.addMethod( "phoneUS", function( phone_number, element ) {
phone_number = phone_number.replace( /\s+/g, "" );
return this.optional( element ) || phone_number.length > 9 &&
phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/ );
}, "Please specify a valid phone number" );
phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/ );
}, "Please specify a valid phone number." );
/*
* Valida CEPs do brasileiros:
@ -921,21 +1275,21 @@ $.validator.addMethod( "postalcodeBR", function( cep_value, element ) {
*/
$.validator.addMethod( "postalCodeCA", function( value, element ) {
return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test( value );
}, "Please specify a valid postal code" );
}, "Please specify a valid postal code." );
/* Matches Italian postcode (CAP) */
$.validator.addMethod( "postalcodeIT", function( value, element ) {
return this.optional( element ) || /^\d{5}$/.test( value );
}, "Please specify a valid postal code" );
}, "Please specify a valid postal code." );
$.validator.addMethod( "postalcodeNL", function( value, element ) {
return this.optional( element ) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test( value );
}, "Please specify a valid postal code" );
}, "Please specify a valid postal code." );
// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
$.validator.addMethod( "postcodeUK", function( value, element ) {
return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value );
}, "Please specify a valid UK postcode" );
}, "Please specify a valid UK postcode." );
/*
* Lets you say "at least X inputs that match selector Y must be filled."
@ -1072,24 +1426,24 @@ $.validator.addMethod( "stateUS", function( value, element, options ) {
regex = caseSensitive ? new RegExp( regex ) : new RegExp( regex, "i" );
return this.optional( element ) || regex.test( value );
}, "Please specify a valid state" );
}, "Please specify a valid state." );
// TODO check if value starts with <, otherwise don't try stripping anything
$.validator.addMethod( "strippedminlength", function( value, element, param ) {
return $( value ).text().length >= param;
}, $.validator.format( "Please enter at least {0} characters" ) );
}, $.validator.format( "Please enter at least {0} characters." ) );
$.validator.addMethod( "time", function( value, element ) {
return this.optional( element ) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test( value );
}, "Please enter a valid time, between 00:00 and 23:59" );
}, "Please enter a valid time, between 00:00 and 23:59." );
$.validator.addMethod( "time12h", function( value, element ) {
return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value );
}, "Please enter a valid time in 12-hour am/pm format" );
}, "Please enter a valid time in 12-hour am/pm format." );
// Same as url, but TLD is optional
$.validator.addMethod( "url2", function( value, element ) {
return this.optional( element ) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( value );
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?)|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff])|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62}\.)))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
}, $.validator.messages.url );
/**
@ -1118,29 +1472,22 @@ $.validator.addMethod( "vinUS", function( v ) {
for ( i = 0; i < 17; i++ ) {
f = FL[ i ];
d = v.slice( i, i + 1 );
if ( i === 8 ) {
cdv = d;
}
if ( !isNaN( d ) ) {
d *= f;
if ( isNaN( d ) ) {
d = d.toUpperCase();
n = VL[ LL.indexOf( d ) ];
} else {
for ( n = 0; n < LL.length; n++ ) {
if ( d.toUpperCase() === LL[ n ] ) {
d = VL[ n ];
d *= f;
if ( isNaN( cdv ) && n === 8 ) {
cdv = LL[ n ];
n = parseInt( d, 10 );
}
break;
if ( i === 8 )
{
cdv = n;
if ( d === "X" ) {
cdv = 10;
}
}
}
rs += d;
rs += n * f;
}
cd = rs % 11;
if ( cd === 10 ) {
cd = "X";
}
if ( cd === cdv ) {
return true;
}
@ -1149,10 +1496,10 @@ $.validator.addMethod( "vinUS", function( v ) {
$.validator.addMethod( "zipcodeUS", function( value, element ) {
return this.optional( element ) || /^\d{5}(-\d{4})?$/.test( value );
}, "The specified US ZIP Code is invalid" );
}, "The specified US ZIP Code is invalid." );
$.validator.addMethod( "ziprange", function( value, element ) {
return this.optional( element ) || /^90[2-5]\d\{2\}-\d{4}$/.test( value );
}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx" );
}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx." );
return $;
}));

View file

@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.17.0
* jQuery Validation Plugin v1.21.0
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2017 Jörn Zaefferer
* Copyright (c) 2024 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
@ -67,6 +67,7 @@ $.extend( $.fn, {
// Prevent form submit to be able to see console output
event.preventDefault();
}
function handle() {
var hidden, result;
@ -82,7 +83,7 @@ $.extend( $.fn, {
.appendTo( validator.currentForm );
}
if ( validator.settings.submitHandler ) {
if ( validator.settings.submitHandler && !validator.settings.debug ) {
result = validator.settings.submitHandler.call( validator, validator.currentForm, event );
if ( hidden ) {
@ -142,6 +143,7 @@ $.extend( $.fn, {
// https://jqueryvalidation.org/rules/
rules: function( command, argument ) {
var element = this[ 0 ],
isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false",
settings, staticRules, existingRules, data, param, filtered;
// If nothing is selected, return empty object; can't chain anyway
@ -149,7 +151,7 @@ $.extend( $.fn, {
return;
}
if ( !element.form && element.hasAttribute( "contenteditable" ) ) {
if ( !element.form && isContentEditable ) {
element.form = this.closest( "form" )[ 0 ];
element.name = this.attr( "name" );
}
@ -214,18 +216,25 @@ $.extend( $.fn, {
}
} );
// JQuery trim is deprecated, provide a trim method based on String.prototype.trim
var trim = function( str ) {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Polyfill
return str.replace( /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "" );
};
// Custom selectors
$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support
// https://jqueryvalidation.org/blank-selector/
blank: function( a ) {
return !$.trim( "" + $( a ).val() );
return !trim( "" + $( a ).val() );
},
// https://jqueryvalidation.org/filled-selector/
filled: function( a ) {
var val = $( a ).val();
return val !== null && !!$.trim( "" + val );
return val !== null && !!trim( "" + val );
},
// https://jqueryvalidation.org/unchecked-selector/
@ -284,6 +293,7 @@ $.extend( $.validator, {
onsubmit: true,
ignore: ":hidden",
ignoreTitle: false,
customElements: [],
onfocusin: function( element ) {
this.lastActive = element;
@ -393,7 +403,8 @@ $.extend( $.validator, {
this.invalid = {};
this.reset();
var groups = ( this.groups = {} ),
var currentForm = this.currentForm,
groups = ( this.groups = {} ),
rules;
$.each( this.settings.groups, function( key, value ) {
if ( typeof value === "string" ) {
@ -409,13 +420,20 @@ $.extend( $.validator, {
} );
function delegate( event ) {
var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false";
// Set form expando on contenteditable
if ( !this.form && this.hasAttribute( "contenteditable" ) ) {
if ( !this.form && isContentEditable ) {
this.form = $( this ).closest( "form" )[ 0 ];
this.name = $( this ).attr( "name" );
}
// Ignore the element if it belongs to another form. This will happen mainly
// when setting the `form` attribute of an input to the id of another form.
if ( currentForm !== this.form ) {
return;
}
var validator = $.data( this.form, "validator" ),
eventType = "on" + event.type.replace( /^validate/, "" ),
settings = validator.settings;
@ -423,17 +441,17 @@ $.extend( $.validator, {
settings[ eventType ].call( validator, this, event );
}
}
var focusListeners = [ ":text", "[type='password']", "[type='file']", "select", "textarea", "[type='number']", "[type='search']",
"[type='tel']", "[type='url']", "[type='email']", "[type='datetime']", "[type='date']", "[type='month']",
"[type='week']", "[type='time']", "[type='datetime-local']", "[type='range']", "[type='color']",
"[type='radio']", "[type='checkbox']", "[contenteditable]", "[type='button']" ];
var clickListeners = [ "select", "option", "[type='radio']", "[type='checkbox']" ];
$( this.currentForm )
.on( "focusin.validate focusout.validate keyup.validate",
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate )
.on( "focusin.validate focusout.validate keyup.validate", focusListeners.concat( this.settings.customElements ).join( ", " ), delegate )
// Support: Chrome, oldIE
// "select" is provided as event.target when clicking a option
.on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate );
.on( "click.validate", clickListeners.concat( this.settings.customElements ).join( ", " ), delegate );
if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
@ -610,7 +628,7 @@ $.extend( $.validator, {
try {
$( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] )
.filter( ":visible" )
.focus()
.trigger( "focus" )
// Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
.trigger( "focusin" );
@ -630,25 +648,33 @@ $.extend( $.validator, {
elements: function() {
var validator = this,
rulesCache = {};
rulesCache = {},
selectors = [ "input", "select", "textarea", "[contenteditable]" ];
// Select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm )
.find( "input, select, textarea, [contenteditable]" )
.find( selectors.concat( this.settings.customElements ).join( ", " ) )
.not( ":submit, :reset, :image, :disabled" )
.not( this.settings.ignore )
.filter( function() {
var name = this.name || $( this ).attr( "name" ); // For contenteditable
var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false";
if ( !name && validator.settings.debug && window.console ) {
console.error( "%o has no name assigned", this );
}
// Set form expando on contenteditable
if ( this.hasAttribute( "contenteditable" ) ) {
if ( isContentEditable ) {
this.form = $( this ).closest( "form" )[ 0 ];
this.name = name;
}
// Ignore elements that belong to other/nested forms
if ( this.form !== validator.currentForm ) {
return false;
}
// Select only the first element for each name, and only those with rules specified
if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {
return false;
@ -694,6 +720,7 @@ $.extend( $.validator, {
elementValue: function( element ) {
var $element = $( element ),
type = element.type,
isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false",
val, idx;
if ( type === "radio" || type === "checkbox" ) {
@ -702,7 +729,7 @@ $.extend( $.validator, {
return element.validity.badInput ? "NaN" : $element.val();
}
if ( element.hasAttribute( "contenteditable" ) ) {
if ( isContentEditable ) {
val = $element.text();
} else {
val = $element.val();
@ -749,6 +776,9 @@ $.extend( $.validator, {
val = this.elementValue( element ),
result, method, rule, normalizer;
// Abort any pending Ajax request from a previous call to this method.
this.abortRequest( element );
// Prioritize the local normalizer defined for this element over the global one
// if the former exists, otherwise user the global one in case it exists.
if ( typeof rules.normalizer === "function" ) {
@ -763,10 +793,6 @@ $.extend( $.validator, {
if ( normalizer ) {
val = normalizer.call( element, val );
if ( typeof val !== "string" ) {
throw new TypeError( "The normalizer should return a string value." );
}
// Delete the normalizer from rules to avoid treating it as a pre-defined method.
delete rules.normalizer;
}
@ -939,14 +965,23 @@ $.extend( $.validator, {
error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
// Replace message on existing label
error.html( message );
if ( this.settings && this.settings.escapeHtml ) {
error.text( message || "" );
} else {
error.html( message || "" );
}
} else {
// Create error element
error = $( "<" + this.settings.errorElement + ">" )
.attr( "id", elementID + "-error" )
.addClass( this.settings.errorClass )
.html( message || "" );
.addClass( this.settings.errorClass );
if ( this.settings && this.settings.escapeHtml ) {
error.text( message || "" );
} else {
error.html( message || "" );
}
// Maintain reference to the element to be placed into the DOM
place = error;
@ -1029,6 +1064,10 @@ $.extend( $.validator, {
// meta-characters that should be escaped in order to be used with JQuery
// as a literal part of a name/id or any selector.
escapeCssMeta: function( string ) {
if ( string === undefined ) {
return "";
}
return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" );
},
@ -1088,6 +1127,10 @@ $.extend( $.validator, {
return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch";
},
elementAjaxPort: function( element ) {
return "validate" + element.name;
},
startRequest: function( element ) {
if ( !this.pending[ element.name ] ) {
this.pendingRequest++;
@ -1105,8 +1148,8 @@ $.extend( $.validator, {
}
delete this.pending[ element.name ];
$( element ).removeClass( this.settings.pendingClass );
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
$( this.currentForm ).submit();
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() && this.pendingRequest === 0 ) {
$( this.currentForm ).trigger( "submit" );
// Remove the hidden input that was used as a replacement for the
// missing submit button. The hidden input is added by `handle()`
@ -1123,6 +1166,25 @@ $.extend( $.validator, {
}
},
abortRequest: function( element ) {
var port;
if ( this.pending[ element.name ] ) {
port = this.elementAjaxPort( element );
$.ajaxAbort( port );
this.pendingRequest--;
// Sometimes synchronization fails, make sure pendingRequest is never < 0
if ( this.pendingRequest < 0 ) {
this.pendingRequest = 0;
}
delete this.pending[ element.name ];
$( element ).removeClass( this.settings.pendingClass );
}
},
previousValue: function( element, method ) {
method = typeof method === "string" && method || "remote";
@ -1142,7 +1204,19 @@ $.extend( $.validator, {
.removeData( "validator" )
.find( ".validate-equalTo-blur" )
.off( ".validate-equalTo" )
.removeClass( "validate-equalTo-blur" );
.removeClass( "validate-equalTo-blur" )
.find( ".validate-lessThan-blur" )
.off( ".validate-lessThan" )
.removeClass( "validate-lessThan-blur" )
.find( ".validate-lessThanEqual-blur" )
.off( ".validate-lessThanEqual" )
.removeClass( "validate-lessThanEqual-blur" )
.find( ".validate-greaterThanEqual-blur" )
.off( ".validate-greaterThanEqual" )
.removeClass( "validate-greaterThanEqual-blur" )
.find( ".validate-greaterThan-blur" )
.off( ".validate-greaterThan" )
.removeClass( "validate-greaterThan-blur" );
}
},
@ -1199,7 +1273,7 @@ $.extend( $.validator, {
// Exception: the jquery validate 'range' method
// does not test for the html5 'range' type
rules[ method ] = true;
rules[ type === "date" ? "dateISO" : method ] = true;
}
},
@ -1246,6 +1320,12 @@ $.extend( $.validator, {
for ( method in $.validator.methods ) {
value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
// Cast empty attributes like `data-rule-required` to `true`
if ( value === "" ) {
value = true;
}
this.normalizeAttributeRule( rules, type, method, value );
}
return rules;
@ -1292,7 +1372,7 @@ $.extend( $.validator, {
// Evaluate parameters
$.each( rules, function( rule, parameter ) {
rules[ rule ] = $.isFunction( parameter ) && rule !== "normalizer" ? parameter( element ) : parameter;
rules[ rule ] = typeof parameter === "function" && rule !== "normalizer" ? parameter( element ) : parameter;
} );
// Clean number parameters
@ -1304,7 +1384,7 @@ $.extend( $.validator, {
$.each( [ "rangelength", "range" ], function() {
var parts;
if ( rules[ this ] ) {
if ( $.isArray( rules[ this ] ) ) {
if ( Array.isArray( rules[ this ] ) ) {
rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ];
} else if ( typeof rules[ this ] === "string" ) {
parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ );
@ -1371,7 +1451,7 @@ $.extend( $.validator, {
if ( this.checkable( element ) ) {
return this.getLength( value, element ) > 0;
}
return value.length > 0;
return value !== undefined && value !== null && value.length > 0;
},
// https://jqueryvalidation.org/email-method/
@ -1391,13 +1471,30 @@ $.extend( $.validator, {
// https://gist.github.com/dperini/729294
// see also https://mathiasbynens.be/demo/url-regex
// modified to allow protocol-relative URLs
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
},
// https://jqueryvalidation.org/date-method/
date: function( value, element ) {
date: ( function() {
var called = false;
return function( value, element ) {
if ( !called ) {
called = true;
if ( this.settings.debug && window.console ) {
console.warn(
"The `date` method is deprecated and will be removed in version '2.0.0'.\n" +
"Please don't use it, since it relies on the Date constructor, which\n" +
"behaves very differently across browsers and locales. Use `dateISO`\n" +
"instead or one of the locale specific methods in `localizations/`\n" +
"and `additional-methods.js`."
);
}
}
return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
},
};
}() ),
// https://jqueryvalidation.org/dateISO-method/
dateISO: function( value, element ) {
@ -1406,7 +1503,7 @@ $.extend( $.validator, {
// https://jqueryvalidation.org/number-method/
number: function( value, element ) {
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/.test( value );
},
// https://jqueryvalidation.org/digits-method/
@ -1416,19 +1513,19 @@ $.extend( $.validator, {
// https://jqueryvalidation.org/minlength-method/
minlength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
var length = Array.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || length >= param;
},
// https://jqueryvalidation.org/maxlength-method/
maxlength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
var length = Array.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || length <= param;
},
// https://jqueryvalidation.org/rangelength-method/
rangelength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
var length = Array.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
},
@ -1517,18 +1614,19 @@ $.extend( $.validator, {
param = typeof param === "string" && { url: param } || param;
optionDataString = $.param( $.extend( { data: value }, param.data ) );
if ( previous.old === optionDataString ) {
if ( previous.valid !== null && previous.old === optionDataString ) {
return previous.valid;
}
previous.old = optionDataString;
previous.valid = null;
validator = this;
this.startRequest( element );
data = {};
data[ element.name ] = value;
$.ajax( $.extend( true, {
mode: "abort",
port: "validate" + element.name,
port: this.elementAjaxPort( element ),
dataType: "json",
data: data,
context: validator.currentForm,
@ -1539,7 +1637,6 @@ $.extend( $.validator, {
validator.settings.messages[ element.name ][ method ] = previous.originalMessage;
if ( valid ) {
submitted = validator.formSubmitted;
validator.resetInternals();
validator.toHide = validator.errorsFor( element );
validator.formSubmitted = submitted;
validator.successList.push( element );
@ -1564,6 +1661,7 @@ $.extend( $.validator, {
// Ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
// $.ajaxAbort( port );
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
var pendingRequests = {},
@ -1574,9 +1672,7 @@ if ( $.ajaxPrefilter ) {
$.ajaxPrefilter( function( settings, _, xhr ) {
var port = settings.port;
if ( settings.mode === "abort" ) {
if ( pendingRequests[ port ] ) {
pendingRequests[ port ].abort();
}
$.ajaxAbort( port );
pendingRequests[ port ] = xhr;
}
} );
@ -1588,14 +1684,20 @@ if ( $.ajaxPrefilter ) {
var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
port = ( "port" in settings ? settings : $.ajaxSettings ).port;
if ( mode === "abort" ) {
if ( pendingRequests[ port ] ) {
pendingRequests[ port ].abort();
}
$.ajaxAbort( port );
pendingRequests[ port ] = ajax.apply( this, arguments );
return pendingRequests[ port ];
}
return ajax.apply( this, arguments );
};
}
// Abort the previous request without sending a new one
$.ajaxAbort = function( port ) {
if ( pendingRequests[ port ] ) {
pendingRequests[ port ].abort();
delete pendingRequests[ port ];
}
};
return $;
}));

View file

@ -1,13 +1,5 @@
Copyright JS Foundation and other contributors, https://js.foundation/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery
The following license applies to all parts of this software except as
documented below:
====
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@ -27,10 +19,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.33808.371
VisualStudioVersion = 17.14.36105.17 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorPagesPizza", "RazorPagesPizza\RazorPagesPizza.csproj", "{ADA085D1-1380-4955-A58D-FD688EC5B4B9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorPagesPizza", "RazorPagesPizza\RazorPagesPizza.csproj", "{243A1A33-7C10-48AA-B690-7D574211C5A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,15 +11,15 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Release|Any CPU.Build.0 = Release|Any CPU
{243A1A33-7C10-48AA-B690-7D574211C5A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{243A1A33-7C10-48AA-B690-7D574211C5A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{243A1A33-7C10-48AA-B690-7D574211C5A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{243A1A33-7C10-48AA-B690-7D574211C5A8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7052E9F1-F97B-4A22-AEA8-66D01D921E93}
SolutionGuid = {768BD1A9-D918-42C0-A4FA-FC6B038F477E}
EndGlobalSection
EndGlobal

View file

@ -1,7 +1,6 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RazorPagesPizza.Data;
@ -11,35 +10,30 @@ using RazorPagesPizza.Data;
namespace RazorPagesPizza.Migrations
{
[DbContext(typeof(RazorPagesPizzaContext))]
[Migration("20230630173639_InitialCreate")]
[Migration("20250513040251_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.18")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.HasAnnotation("ProductVersion", "9.0.0");
modelBuilder.Entity("RazorPagesPizza.Models.Pizza", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
.HasColumnType("INTEGER");
b.Property<bool>("IsGlutenFree")
.HasColumnType("bit");
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasColumnType("TEXT");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
.HasColumnType("TEXT");
b.HasKey("Id");

View file

@ -4,19 +4,21 @@
namespace RazorPagesPizza.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Pizza",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
IsGlutenFree = table.Column<bool>(type: "bit", nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
IsGlutenFree = table.Column<bool>(type: "INTEGER", nullable: false),
Price = table.Column<decimal>(type: "TEXT", nullable: false)
},
constraints: table =>
{
@ -24,6 +26,7 @@ namespace RazorPagesPizza.Migrations
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(

View file

@ -1,7 +1,6 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RazorPagesPizza.Data;
@ -15,29 +14,23 @@ namespace RazorPagesPizza.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.18")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.HasAnnotation("ProductVersion", "9.0.0");
modelBuilder.Entity("RazorPagesPizza.Models.Pizza", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
.HasColumnType("INTEGER");
b.Property<bool>("IsGlutenFree")
.HasColumnType("bit");
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasColumnType("TEXT");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
.HasColumnType("TEXT");
b.HasKey("Id");

View file

@ -14,6 +14,7 @@
<form method="post">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<span class="text-danger">*</span>
<label asp-for="Pizza.Name" class="control-label"></label>
<input asp-for="Pizza.Name" class="form-control" />
<span asp-validation-for="Pizza.Name" class="text-danger"></span>

View file

@ -27,11 +27,10 @@ namespace RazorPagesPizza.Pages
[BindProperty]
public Pizza Pizza { get; set; } = default!;
// To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD
// For more information, see https://aka.ms/RazorPagesCRUD.
public async Task<IActionResult> OnPostAsync()
{
if (!ModelState.IsValid || _context.Pizza == null || Pizza == null)
if (!ModelState.IsValid)
{
return Page();
}

View file

@ -24,32 +24,31 @@ namespace RazorPagesPizza.Pages
public async Task<IActionResult> OnGetAsync(int? id)
{
if (id == null || _context.Pizza == null)
if (id == null)
{
return NotFound();
}
var pizza = await _context.Pizza.FirstOrDefaultAsync(m => m.Id == id);
if (pizza == null)
{
return NotFound();
}
else
if (pizza is not null)
{
Pizza = pizza;
}
return Page();
}
return NotFound();
}
public async Task<IActionResult> OnPostAsync(int? id)
{
if (id == null || _context.Pizza == null)
if (id == null)
{
return NotFound();
}
var pizza = await _context.Pizza.FindAsync(id);
var pizza = await _context.Pizza.FindAsync(id);
if (pizza != null)
{
Pizza = pizza;

View file

@ -32,6 +32,6 @@
</dl>
</div>
<div>
<a asp-page="./Edit" asp-route-id="@Model.Pizza?.Id">Edit</a> |
<a asp-page="./Edit" asp-route-id="@Model.Pizza.Id">Edit</a> |
<a asp-page="./Index">Back to List</a>
</div>

View file

@ -23,21 +23,21 @@ namespace RazorPagesPizza.Pages
public async Task<IActionResult> OnGetAsync(int? id)
{
if (id == null || _context.Pizza == null)
if (id == null)
{
return NotFound();
}
var pizza = await _context.Pizza.FirstOrDefaultAsync(m => m.Id == id);
if (pizza == null)
{
return NotFound();
}
else
if (pizza is not null)
{
Pizza = pizza;
}
return Page();
}
return NotFound();
}
}
}

View file

@ -15,16 +15,19 @@
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Pizza.Id" />
<div class="form-group">
<span class="text-danger">*</span>
<label asp-for="Pizza.Name" class="control-label"></label>
<input asp-for="Pizza.Name" class="form-control" />
<span asp-validation-for="Pizza.Name" class="text-danger"></span>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="Pizza.IsGlutenFree" /> @Html.DisplayNameFor(model => model.Pizza.IsGlutenFree)
</label>
</div>
<div class="form-group">
<label asp-for="Pizza.Price" class="control-label"></label>
<input asp-for="Pizza.Price" class="form-control" />
<span asp-validation-for="Pizza.Price" class="text-danger"></span>

View file

@ -25,7 +25,7 @@ namespace RazorPagesPizza.Pages
public async Task<IActionResult> OnGetAsync(int? id)
{
if (id == null || _context.Pizza == null)
if (id == null)
{
return NotFound();
}
@ -40,7 +40,7 @@ namespace RazorPagesPizza.Pages
}
// To protect from overposting attacks, enable the specific properties you want to bind to.
// For more details, see https://aka.ms/RazorPagesCRUD.
// For more information, see https://aka.ms/RazorPagesCRUD.
public async Task<IActionResult> OnPostAsync()
{
if (!ModelState.IsValid)
@ -71,7 +71,7 @@ namespace RazorPagesPizza.Pages
private bool PizzaExists(int id)
{
return (_context.Pizza?.Any(e => e.Id == id)).GetValueOrDefault();
return _context.Pizza.Any(e => e.Id == id);
}
}
}

View file

@ -1,6 +1,6 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;
namespace RazorPagesPizza.Pages
{
@ -24,4 +24,5 @@ namespace RazorPagesPizza.Pages
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}

View file

@ -22,11 +22,8 @@ namespace RazorPagesPizza.Pages
public IList<Pizza> Pizza { get;set; } = default!;
public async Task OnGetAsync()
{
if (_context.Pizza != null)
{
Pizza = await _context.Pizza.ToListAsync();
}
}
}
}

View file

@ -16,4 +16,5 @@ namespace RazorPagesPizza.Pages
{
}
}
}

Some files were not shown because too many files have changed in this diff Show more