From 49cf3305f84de246e270df69a0b0be0f72498c6e Mon Sep 17 00:00:00 2001 From: volkanceylan Date: Wed, 9 Oct 2024 22:28:28 +0300 Subject: [PATCH] Define a _NorthwindLayout so that Northwind.css is included in pages using GridPage extensions --- .../Areas/Serenity.Demo.Northwind/_NorthwindLayout.cshtml | 6 ++++++ src/Serenity.Demo.Northwind/Imports/MVC/MVC.cs | 1 + .../Modules/Category/CategoryPage.cs | 2 +- .../Modules/Customer/CustomerPage.cs | 2 +- src/Serenity.Demo.Northwind/Modules/Region/RegionPage.cs | 2 +- src/Serenity.Demo.Northwind/Modules/Shipper/ShipperPage.cs | 2 +- .../Modules/Supplier/SupplierPage.cs | 2 +- .../Modules/Territory/TerritoryPage.cs | 2 +- 8 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 src/Serenity.Demo.Northwind/Areas/Serenity.Demo.Northwind/_NorthwindLayout.cshtml diff --git a/src/Serenity.Demo.Northwind/Areas/Serenity.Demo.Northwind/_NorthwindLayout.cshtml b/src/Serenity.Demo.Northwind/Areas/Serenity.Demo.Northwind/_NorthwindLayout.cshtml new file mode 100644 index 0000000..0e471d1 --- /dev/null +++ b/src/Serenity.Demo.Northwind/Areas/Serenity.Demo.Northwind/_NorthwindLayout.cshtml @@ -0,0 +1,6 @@ +@{ + Layout = "_Layout"; +} + +@Html.Stylesheet("~/Serenity.Demo.Northwind/index.css") +@RenderBody() diff --git a/src/Serenity.Demo.Northwind/Imports/MVC/MVC.cs b/src/Serenity.Demo.Northwind/Imports/MVC/MVC.cs index 387d959..66bcf0f 100644 --- a/src/Serenity.Demo.Northwind/Imports/MVC/MVC.cs +++ b/src/Serenity.Demo.Northwind/Imports/MVC/MVC.cs @@ -3,6 +3,7 @@ namespace Serenity.Demo.Northwind.MVC; public static class Views { + public const string _NorthwindLayout = "~/Areas/Serenity.Demo.Northwind/_NorthwindLayout.cshtml"; public static class Order { public const string OrderDetailReport = "~/Areas/Serenity.Demo.Northwind/Order/OrderDetailReport.cshtml"; diff --git a/src/Serenity.Demo.Northwind/Modules/Category/CategoryPage.cs b/src/Serenity.Demo.Northwind/Modules/Category/CategoryPage.cs index ab8eb96..e62a7d7 100644 --- a/src/Serenity.Demo.Northwind/Modules/Category/CategoryPage.cs +++ b/src/Serenity.Demo.Northwind/Modules/Category/CategoryPage.cs @@ -8,6 +8,6 @@ public class CategoryPage : Controller [Route("Northwind/Category")] public ActionResult Index() { - return this.GridPage(ESM.CategoryPage); + return this.GridPage(ESM.CategoryPage, layout: MVC.Views._NorthwindLayout); } } diff --git a/src/Serenity.Demo.Northwind/Modules/Customer/CustomerPage.cs b/src/Serenity.Demo.Northwind/Modules/Customer/CustomerPage.cs index 8b3800a..f29d2cc 100644 --- a/src/Serenity.Demo.Northwind/Modules/Customer/CustomerPage.cs +++ b/src/Serenity.Demo.Northwind/Modules/Customer/CustomerPage.cs @@ -8,7 +8,7 @@ public class CustomerPage : Controller [Route("Northwind/Customer")] public ActionResult Index() { - return this.GridPage(ESM.CustomerPage); + return this.GridPage(ESM.CustomerPage, layout: MVC.Views._NorthwindLayout); } } diff --git a/src/Serenity.Demo.Northwind/Modules/Region/RegionPage.cs b/src/Serenity.Demo.Northwind/Modules/Region/RegionPage.cs index 35cebad..549b549 100644 --- a/src/Serenity.Demo.Northwind/Modules/Region/RegionPage.cs +++ b/src/Serenity.Demo.Northwind/Modules/Region/RegionPage.cs @@ -8,6 +8,6 @@ public class RegionPage : Controller [Route("Northwind/Region")] public ActionResult Index() { - return this.GridPage(ESM.RegionPage); + return this.GridPage(ESM.RegionPage, layout: MVC.Views._NorthwindLayout); } } diff --git a/src/Serenity.Demo.Northwind/Modules/Shipper/ShipperPage.cs b/src/Serenity.Demo.Northwind/Modules/Shipper/ShipperPage.cs index a79f33d..4f339a8 100644 --- a/src/Serenity.Demo.Northwind/Modules/Shipper/ShipperPage.cs +++ b/src/Serenity.Demo.Northwind/Modules/Shipper/ShipperPage.cs @@ -8,6 +8,6 @@ public class ShipperPage : Controller [Route("Northwind/Shipper")] public ActionResult Index() { - return this.GridPage(ESM.ShipperPage); + return this.GridPage(ESM.ShipperPage, layout: MVC.Views._NorthwindLayout); } } diff --git a/src/Serenity.Demo.Northwind/Modules/Supplier/SupplierPage.cs b/src/Serenity.Demo.Northwind/Modules/Supplier/SupplierPage.cs index 2408e66..7c1ed3a 100644 --- a/src/Serenity.Demo.Northwind/Modules/Supplier/SupplierPage.cs +++ b/src/Serenity.Demo.Northwind/Modules/Supplier/SupplierPage.cs @@ -8,6 +8,6 @@ public class SupplierPage : Controller [Route("Northwind/Supplier")] public ActionResult Index() { - return this.GridPage(ESM.SupplierPage); + return this.GridPage(ESM.SupplierPage, layout: MVC.Views._NorthwindLayout); } } diff --git a/src/Serenity.Demo.Northwind/Modules/Territory/TerritoryPage.cs b/src/Serenity.Demo.Northwind/Modules/Territory/TerritoryPage.cs index 0b5af5d..7af7a33 100644 --- a/src/Serenity.Demo.Northwind/Modules/Territory/TerritoryPage.cs +++ b/src/Serenity.Demo.Northwind/Modules/Territory/TerritoryPage.cs @@ -8,6 +8,6 @@ public class TerritoryPage : Controller [Route("Northwind/Territory")] public ActionResult Index() { - return this.GridPage(ESM.TerritoryPage); + return this.GridPage(ESM.TerritoryPage, layout: MVC.Views._NorthwindLayout); } }