Skip to content

Commit

Permalink
Remove ViewBag.Title
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriaWei committed Oct 13, 2024
1 parent 22b774d commit fa97c4c
Show file tree
Hide file tree
Showing 31 changed files with 26 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/ZKEACMS.Article/Views/ArticleType/Select.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using Easy.ViewPort.jsTree
@using ZKEACMS.Article.Models
@{
ViewBag.Title = L("Article Category");
this.WorkContext().CurrentPage.Title = L("Article Category");
Layout = Layouts.PopUp;
Style.Reqiured("jsTree").AtHead();
Script.Reqiured("jsTree").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.Product/Views/ProductCategory/Select.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using Easy.ViewPort.jsTree
@using ZKEACMS.Article.Models
@{
ViewBag.Title = L("Product Category");
this.WorkContext().CurrentPage.Title = L("Product Category");
Layout = Layouts.PopUp;
Style.Reqiured("jsTree").AtHead();
Script.Reqiured("jsTree").AtFoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
return;
}
ViewBag.Title = video.VideoTitle;
this.WorkContext().CurrentPage.Title = video.VideoTitle;
Style.Reqiured("Section").AtFoot();
}

Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.Shop/Views/CustomOrder/Detail.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@model OrderDetailViewModel
@{
Layout = Layouts.CustomerCenter;
ViewBag.Title = L("Order Detail").Text;
this.WorkContext().CurrentPage.Title = L("Order Detail").Text;
if (Model.Order == null)
{
return;
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.Shop/Views/CustomOrder/Failed.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
Layout = Layouts.CustomerCenter;
ViewBag.Title = L("Order failed to pay");
this.WorkContext().CurrentPage.Title = L("Order failed to pay");
}
<div class="text-center">
<div class="page-header">
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.Shop/Views/CustomOrder/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@model OrderListViewModel
@{
Layout = Layouts.CustomerCenter;
ViewBag.Title = L("My Order").Text;
this.WorkContext().CurrentPage.Title = L("My Order").Text;
}
<div class="panel panel-default">
<div class="panel-heading">
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/Edit.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model Easy.Modules.User.Models.UserEntity
@{
ViewBag.Title = L("Account Center");
this.WorkContext().CurrentPage.Title = L("Account Center");
Layout = Layouts.CustomerCenter;
Script.Reqiured("validate").AtFoot();
}
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/Forgotten.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model ZKEACMS.Account.ForgottenViewModel
@{
ViewBag.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
Layout = Layouts.NormalDefault;
Style.Reqiured("Customer").AtHead();
Script.Reqiured("validate").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = L("Account Center");
this.WorkContext().CurrentPage.Title = L("Account Center");
Layout = Layouts.CustomerCenter;
}
<div class="panel panel-default user-info">
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/Login.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model ZKEACMS.Common.ViewModels.AdminSignViewModel
@{
ViewBag.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
Layout = Layouts.NormalDefault;
Style.Reqiured("Login").AtHead();
Script.Reqiured("validate").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/PassWord.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = L("Account Center");
this.WorkContext().CurrentPage.Title = L("Account Center");
Layout = Layouts.CustomerCenter;
Script.Reqiured("validate").AtFoot();
}
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/Reset.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model ZKEACMS.Account.ResetViewModel
@{
ViewBag.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
Layout = Layouts.NormalDefault;
Style.Reqiured("Customer").AtHead();
Script.Reqiured("validate").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/Sended.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
Layout = Layouts.NormalDefault;
Style.Reqiured("Customer").AtHead();
Script.Reqiured("validate").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/SignIn.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model ZKEACMS.Common.ViewModels.CustomerSignInViewModel
@{
ViewBag.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
Layout = Layouts.NormalDefault;
Style.Reqiured("Customer").AtHead();
Script.Reqiured("validate").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/SignUp.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model Easy.Modules.User.Models.UserEntity
@{
ViewBag.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
Layout = Layouts.NormalDefault;
Style.Reqiured("Customer").AtHead();
Script.Reqiured("validate").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Account/SignUpSuccess.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
this.WorkContext().CurrentPage.Title = ZKEACMS.Version.CurrentVersion + " " + ZKEACMS.Version.Rank;
Layout = Layouts.NormalDefault;
Style.Reqiured("Customer").AtHead();
Script.Reqiured("validate").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Error/Forbidden.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = ViewContext.HttpContext.Response.StatusCode;
this.WorkContext().CurrentPage.Title = System.Net.HttpStatusCode.Forbidden.ToString();
Layout = Layouts.Generic;
}
<div style="text-align: center; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;">
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Error/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = ViewContext.HttpContext.Response.StatusCode;
this.WorkContext().CurrentPage.Title = ViewContext.HttpContext.Response.StatusCode.ToString();
Layout = Layouts.Generic;
}
<div style="text-align: center; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;">
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Error/NotFound.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = ViewContext.HttpContext.Response.StatusCode;
this.WorkContext().CurrentPage.Title = System.Net.HttpStatusCode.NotFound.ToString();
Layout = Layouts.Generic;
}
<div style="text-align: center; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;">
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Media/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using ZKEACMS.Common.ViewModels
@model MediaViewModel
@{
ViewBag.Title = L("Media");
this.WorkContext().CurrentPage.Title = L("Media");
var action = Html.ViewContext.RouteData.Values["action"].ToString();

Script.Reqiured("image-viewer").AtFoot();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Navigation/Select.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@using Easy.ViewPort.jsTree

@{
ViewBag.Title = L("Navigation");
this.WorkContext().CurrentPage.Title = L("Navigation");
Layout = Layouts.PopUp;
Script.Reqiured("jsTree").AtFoot();
Style.Reqiured("jsTree").AtHead();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Page/Select.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using Easy.ViewPort.jsTree;
@{
ViewBag.Title = L("Page");
this.WorkContext().CurrentPage.Title = L("Page");
Script.Reqiured("jsTree").AtFoot();
Style.Reqiured("jsTree").AtHead();
Layout = Layouts.PopUp;
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Shared/NotFound.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = ViewContext.HttpContext.Response.StatusCode;
this.WorkContext().CurrentPage.Title = System.Net.HttpStatusCode.NotFound.ToString();
Layout = Layouts.Generic;
}
<div style="text-align: center; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;">
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/Shared/Partial.PageHeader.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
var favicon = applicationSettingService.Get(SettingKeys.Favicon, "~/favicon.ico");
}
<title>@currentPage.Title</title>
<title>@(currentPage.Title)</title>
@if (currentPage.MetaKeyWords.IsNotNullAndWhiteSpace())
{
<meta name="keywords" content="@currentPage.MetaKeyWords" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
Style.Reqiured("bootStrap").AtHead();
Style.Reqiured("Customer").AtHead();
Style.Reqiured("Easy").AtHead();
IEnumerable<AdminMenu> menu = userCenterLinkService.GetLinks();
if (ViewBag.Title != null)
{
this.WorkContext().CurrentPage.Title = ViewBag.Title;
}
IEnumerable<AdminMenu> menu = userCenterLinkService.GetLinks();
}
@inject IUserCenterLinkService userCenterLinkService
@inject IOptions<CultureOption> cultureOption
Expand Down
6 changes: 0 additions & 6 deletions src/ZKEACMS.WebHost/Views/Shared/_EmptyLayout.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
@using Microsoft.AspNetCore.Hosting
@using Microsoft.Extensions.Hosting
@{
if (ViewBag.Title != null)
{
this.WorkContext().CurrentPage.Title = ViewBag.Title;
}
}
<!DOCTYPE html>
<html>
<head>
Expand Down
6 changes: 0 additions & 6 deletions src/ZKEACMS.WebHost/Views/Shared/_LayoutGeneric.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
@using Microsoft.Extensions.Hosting
@using Microsoft.Extensions.Options
@using Easy.Options
@{
if (ViewBag.Title != null)
{
this.WorkContext().CurrentPage.Title = ViewBag.Title;
}
}
@inject IOptions<CultureOption> cultureOption
<!DOCTYPE html>
<html lang="@cultureOption.Value.Code">
Expand Down
6 changes: 0 additions & 6 deletions src/ZKEACMS.WebHost/Views/Shared/_LayoutNormal.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
@using Microsoft.Extensions.Hosting
@using Microsoft.Extensions.Options
@using Easy.Options
@{
if (ViewBag.Title != null)
{
this.WorkContext().CurrentPage.Title = ViewBag.Title;
}
}
@inject IOptions<CultureOption> cultureOption
<!DOCTYPE html>
<html lang="@cultureOption.Value.Code">
Expand Down
6 changes: 0 additions & 6 deletions src/ZKEACMS.WebHost/Views/Shared/_PopUpClientLayout.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
@using Microsoft.AspNetCore.Hosting
@using Microsoft.Extensions.Hosting
@{
if (ViewBag.Title != null)
{
this.WorkContext().CurrentPage.Title = ViewBag.Title;
}
}
<!DOCTYPE html>
<html style="height:100%">
<head>
Expand Down
5 changes: 0 additions & 5 deletions src/ZKEACMS.WebHost/Views/Shared/_PopUpLayout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
Script.Reqiured("admin").AtHead();
Style.Reqiured("bootStrap").AtHead();
Style.Reqiured("admin").AtHead();
if (ViewBag.Title != null)
{
this.WorkContext().CurrentPage.Title = ViewBag.Title;
}
}

<!DOCTYPE html>
<html>
<head>
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Views/User/PassWord.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ViewBag.Title = L("Change Password");
this.WorkContext().CurrentPage.Title = L("Change Password");
Script.Reqiured("validate").AtFoot();
}
@using (Html.BeginForm())
Expand Down

0 comments on commit fa97c4c

Please sign in to comment.