From 276058f3d56b98d6317ec69d56d8e451bd970569 Mon Sep 17 00:00:00 2001 From: wayne Date: Sat, 19 Oct 2024 21:07:30 +0800 Subject: [PATCH] Simplify layout --- .../Views/Account/Forgotten.cshtml | 3 ++- src/ZKEACMS.WebHost/Views/Account/Login.cshtml | 3 ++- src/ZKEACMS.WebHost/Views/Account/Reset.cshtml | 3 ++- src/ZKEACMS.WebHost/Views/Account/Sended.cshtml | 3 ++- src/ZKEACMS.WebHost/Views/Account/SignIn.cshtml | 3 ++- src/ZKEACMS.WebHost/Views/Account/SignUp.cshtml | 3 ++- .../Views/Account/SignUpSuccess.cshtml | 3 ++- .../Views/Error/Forbidden.cshtml | 2 +- src/ZKEACMS.WebHost/Views/Error/Index.cshtml | 2 +- src/ZKEACMS.WebHost/Views/Error/NotFound.cshtml | 2 +- .../Views/Shared/NotFound.cshtml | 2 +- .../Views/Shared/_EmptyLayout.cshtml | 4 ++-- .../Views/Shared/_LayoutGeneric.cshtml | 15 --------------- .../Views/Shared/_LayoutNormal.cshtml | 17 ----------------- src/ZKEACMS/Constant.cs | 8 -------- 15 files changed, 20 insertions(+), 53 deletions(-) delete mode 100644 src/ZKEACMS.WebHost/Views/Shared/_LayoutGeneric.cshtml delete mode 100644 src/ZKEACMS.WebHost/Views/Shared/_LayoutNormal.cshtml diff --git a/src/ZKEACMS.WebHost/Views/Account/Forgotten.cshtml b/src/ZKEACMS.WebHost/Views/Account/Forgotten.cshtml index dcbd41e1d..6587f1c3c 100644 --- a/src/ZKEACMS.WebHost/Views/Account/Forgotten.cshtml +++ b/src/ZKEACMS.WebHost/Views/Account/Forgotten.cshtml @@ -1,7 +1,8 @@ @model ZKEACMS.Account.ForgottenViewModel @{ this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank; - Layout = Layouts.NormalDefault; + Layout = Layouts.EmptyLayout; + Style.Reqiured("bootStrap").AtHead(); Style.Reqiured("Customer").AtHead(); Script.Reqiured("validate").AtFoot(); } diff --git a/src/ZKEACMS.WebHost/Views/Account/Login.cshtml b/src/ZKEACMS.WebHost/Views/Account/Login.cshtml index 36c6f8458..a6847cd1d 100644 --- a/src/ZKEACMS.WebHost/Views/Account/Login.cshtml +++ b/src/ZKEACMS.WebHost/Views/Account/Login.cshtml @@ -1,7 +1,8 @@ @model ZKEACMS.Common.ViewModels.AdminSignViewModel @{ this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank; - Layout = Layouts.NormalDefault; + Layout = Layouts.EmptyLayout; + Style.Reqiured("bootStrap").AtHead(); Style.Reqiured("Login").AtHead(); Script.Reqiured("validate").AtFoot(); } diff --git a/src/ZKEACMS.WebHost/Views/Account/Reset.cshtml b/src/ZKEACMS.WebHost/Views/Account/Reset.cshtml index f2356bb08..27e5e2795 100644 --- a/src/ZKEACMS.WebHost/Views/Account/Reset.cshtml +++ b/src/ZKEACMS.WebHost/Views/Account/Reset.cshtml @@ -1,7 +1,8 @@ @model ZKEACMS.Account.ResetViewModel @{ this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank; - Layout = Layouts.NormalDefault; + Layout = Layouts.EmptyLayout; + Style.Reqiured("bootStrap").AtHead(); Style.Reqiured("Customer").AtHead(); Script.Reqiured("validate").AtFoot(); } diff --git a/src/ZKEACMS.WebHost/Views/Account/Sended.cshtml b/src/ZKEACMS.WebHost/Views/Account/Sended.cshtml index 231490fa0..a31fc27b0 100644 --- a/src/ZKEACMS.WebHost/Views/Account/Sended.cshtml +++ b/src/ZKEACMS.WebHost/Views/Account/Sended.cshtml @@ -1,6 +1,7 @@ @{ this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank; - Layout = Layouts.NormalDefault; + Layout = Layouts.EmptyLayout; + Style.Reqiured("bootStrap").AtHead(); Style.Reqiured("Customer").AtHead(); Script.Reqiured("validate").AtFoot(); string link = "~/"; diff --git a/src/ZKEACMS.WebHost/Views/Account/SignIn.cshtml b/src/ZKEACMS.WebHost/Views/Account/SignIn.cshtml index 859dc2fcd..6a73139ef 100644 --- a/src/ZKEACMS.WebHost/Views/Account/SignIn.cshtml +++ b/src/ZKEACMS.WebHost/Views/Account/SignIn.cshtml @@ -1,7 +1,8 @@ @model ZKEACMS.Common.ViewModels.CustomerSignInViewModel @{ this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank; - Layout = Layouts.NormalDefault; + Layout = Layouts.EmptyLayout; + Style.Reqiured("bootStrap").AtHead(); Style.Reqiured("Customer").AtHead(); Script.Reqiured("validate").AtFoot(); var returnUrl = ViewBag.ReturnUrl ?? ViewContext.HttpContext.Request.Query["ReturnUrl"]; diff --git a/src/ZKEACMS.WebHost/Views/Account/SignUp.cshtml b/src/ZKEACMS.WebHost/Views/Account/SignUp.cshtml index dee34f30d..6ffc610c5 100644 --- a/src/ZKEACMS.WebHost/Views/Account/SignUp.cshtml +++ b/src/ZKEACMS.WebHost/Views/Account/SignUp.cshtml @@ -1,7 +1,8 @@ @model Easy.Modules.User.Models.UserEntity @{ this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank; - Layout = Layouts.NormalDefault; + Layout = Layouts.EmptyLayout; + Style.Reqiured("bootStrap").AtHead(); Style.Reqiured("Customer").AtHead(); Script.Reqiured("validate").AtFoot(); var returnUrl = ViewBag.ReturnUrl ?? ViewContext.HttpContext.Request.Query["ReturnUrl"]; diff --git a/src/ZKEACMS.WebHost/Views/Account/SignUpSuccess.cshtml b/src/ZKEACMS.WebHost/Views/Account/SignUpSuccess.cshtml index 5d3905005..088c20606 100644 --- a/src/ZKEACMS.WebHost/Views/Account/SignUpSuccess.cshtml +++ b/src/ZKEACMS.WebHost/Views/Account/SignUpSuccess.cshtml @@ -1,6 +1,7 @@ @{ this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank; - Layout = Layouts.NormalDefault; + Layout = Layouts.EmptyLayout; + Style.Reqiured("bootStrap").AtHead(); Style.Reqiured("Customer").AtHead(); Script.Reqiured("validate").AtFoot(); } diff --git a/src/ZKEACMS.WebHost/Views/Error/Forbidden.cshtml b/src/ZKEACMS.WebHost/Views/Error/Forbidden.cshtml index be86f5056..75d80660d 100644 --- a/src/ZKEACMS.WebHost/Views/Error/Forbidden.cshtml +++ b/src/ZKEACMS.WebHost/Views/Error/Forbidden.cshtml @@ -1,6 +1,6 @@ @{ this.WorkContext().CurrentPage.Title = System.Net.HttpStatusCode.Forbidden.ToString(); - Layout = Layouts.Generic; + Layout = Layouts.EmptyLayout; }
diff --git a/src/ZKEACMS.WebHost/Views/Error/Index.cshtml b/src/ZKEACMS.WebHost/Views/Error/Index.cshtml index 107b92074..7643d7879 100644 --- a/src/ZKEACMS.WebHost/Views/Error/Index.cshtml +++ b/src/ZKEACMS.WebHost/Views/Error/Index.cshtml @@ -1,6 +1,6 @@ @{ this.WorkContext().CurrentPage.Title = ViewContext.HttpContext.Response.StatusCode.ToString(); - Layout = Layouts.Generic; + Layout = Layouts.EmptyLayout; }
diff --git a/src/ZKEACMS.WebHost/Views/Error/NotFound.cshtml b/src/ZKEACMS.WebHost/Views/Error/NotFound.cshtml index 1a5dc1717..9397a45a2 100644 --- a/src/ZKEACMS.WebHost/Views/Error/NotFound.cshtml +++ b/src/ZKEACMS.WebHost/Views/Error/NotFound.cshtml @@ -1,6 +1,6 @@ @{ this.WorkContext().CurrentPage.Title = System.Net.HttpStatusCode.NotFound.ToString(); - Layout = Layouts.Generic; + Layout = Layouts.EmptyLayout; }
diff --git a/src/ZKEACMS.WebHost/Views/Shared/NotFound.cshtml b/src/ZKEACMS.WebHost/Views/Shared/NotFound.cshtml index 1a5dc1717..9397a45a2 100644 --- a/src/ZKEACMS.WebHost/Views/Shared/NotFound.cshtml +++ b/src/ZKEACMS.WebHost/Views/Shared/NotFound.cshtml @@ -1,6 +1,6 @@ @{ this.WorkContext().CurrentPage.Title = System.Net.HttpStatusCode.NotFound.ToString(); - Layout = Layouts.Generic; + Layout = Layouts.EmptyLayout; }
diff --git a/src/ZKEACMS.WebHost/Views/Shared/_EmptyLayout.cshtml b/src/ZKEACMS.WebHost/Views/Shared/_EmptyLayout.cshtml index eccac4ade..3a5ffb503 100644 --- a/src/ZKEACMS.WebHost/Views/Shared/_EmptyLayout.cshtml +++ b/src/ZKEACMS.WebHost/Views/Shared/_EmptyLayout.cshtml @@ -6,9 +6,9 @@ @await Html.PartialAsync("Partial.PageHeader") -
+
@RenderBody() -
+ @await Html.PartialAsync("Partial.PageFooter") diff --git a/src/ZKEACMS.WebHost/Views/Shared/_LayoutGeneric.cshtml b/src/ZKEACMS.WebHost/Views/Shared/_LayoutGeneric.cshtml deleted file mode 100644 index 91254cf7d..000000000 --- a/src/ZKEACMS.WebHost/Views/Shared/_LayoutGeneric.cshtml +++ /dev/null @@ -1,15 +0,0 @@ -@using Microsoft.AspNetCore.Hosting -@using Microsoft.Extensions.Hosting -@using Microsoft.Extensions.Options -@using Easy.Options -@inject IOptions cultureOption - - - - @await Html.PartialAsync("Partial.PageHeader") - - - @RenderBody() - @await Html.PartialAsync("Partial.PageFooter") - - \ No newline at end of file diff --git a/src/ZKEACMS.WebHost/Views/Shared/_LayoutNormal.cshtml b/src/ZKEACMS.WebHost/Views/Shared/_LayoutNormal.cshtml deleted file mode 100644 index 0b05f0191..000000000 --- a/src/ZKEACMS.WebHost/Views/Shared/_LayoutNormal.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@using Microsoft.AspNetCore.Hosting -@using Microsoft.Extensions.Hosting -@using Microsoft.Extensions.Options -@using Easy.Options -@inject IOptions cultureOption - - - - @await Html.PartialAsync("Partial.PageHeader") - - -
- @RenderBody() -
- @await Html.PartialAsync("Partial.PageFooter") - - \ No newline at end of file diff --git a/src/ZKEACMS/Constant.cs b/src/ZKEACMS/Constant.cs index c1fc68fbf..d2c610763 100644 --- a/src/ZKEACMS/Constant.cs +++ b/src/ZKEACMS/Constant.cs @@ -33,14 +33,6 @@ public class Layouts /// public const string Default = "_Layout"; /// - /// Layout with current theme and body with container. - /// - public const string NormalDefault = "_LayoutNormal"; - /// - /// Layout with current theme - /// - public const string Generic = "_LayoutGeneric"; - /// /// Layout for admin pop up modal /// public const string PopUp = "_PopUpLayout";