From 230b1af9f7675fa526559b1b79832c03ecee23c5 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Thu, 14 Nov 2013 14:13:23 +1100 Subject: [PATCH] Bug Fix: MVC Layouts to Static --- .../Areas/Config/Views/_ViewStart.cshtml | 2 +- .../Config/Views/_ViewStart.generated.cs | 4 +-- .../Areas/Public/Views/_ViewStart.cshtml | 2 +- .../Public/Views/_ViewStart.generated.cs | 2 +- Disco.Web/Disco.Web.csproj | 5 ++- Disco.Web/T4MVC.cs | 36 ++++++------------- .../Views/InitialConfig/_ViewStart.cshtml | 2 +- .../InitialConfig/_ViewStart.generated.cs | 4 +-- Disco.Web/Views/Job/Create.cshtml | 2 +- Disco.Web/Views/Job/Create.generated.cs | 12 +++---- Disco.Web/Views/Update/Index.cshtml | 2 +- Disco.Web/Views/Update/Index.generated.cs | 4 +-- Disco.Web/Views/_ViewStart.cshtml | 2 +- Disco.Web/Views/_ViewStart.generated.cs | 4 +-- 14 files changed, 34 insertions(+), 49 deletions(-) diff --git a/Disco.Web/Areas/Config/Views/_ViewStart.cshtml b/Disco.Web/Areas/Config/Views/_ViewStart.cshtml index 87835eaa..eb41564f 100644 --- a/Disco.Web/Areas/Config/Views/_ViewStart.cshtml +++ b/Disco.Web/Areas/Config/Views/_ViewStart.cshtml @@ -1,4 +1,4 @@ @{ - Layout = "~/Views/Shared/_Layout.cshtml"; + Layout = MVC.Shared.Views._Layout; Html.BundleDeferred("~/Style/Config"); } \ No newline at end of file diff --git a/Disco.Web/Areas/Config/Views/_ViewStart.generated.cs b/Disco.Web/Areas/Config/Views/_ViewStart.generated.cs index 59747e27..1d2edad1 100644 --- a/Disco.Web/Areas/Config/Views/_ViewStart.generated.cs +++ b/Disco.Web/Areas/Config/Views/_ViewStart.generated.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18051 +// Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -45,7 +45,7 @@ namespace Disco.Web.Areas.Config.Views #line 1 "..\..\Areas\Config\Views\_ViewStart.cshtml" - Layout = "~/Views/Shared/_Layout.cshtml"; + Layout = MVC.Shared.Views._Layout; Html.BundleDeferred("~/Style/Config"); diff --git a/Disco.Web/Areas/Public/Views/_ViewStart.cshtml b/Disco.Web/Areas/Public/Views/_ViewStart.cshtml index 454012e0..b06ec613 100644 --- a/Disco.Web/Areas/Public/Views/_ViewStart.cshtml +++ b/Disco.Web/Areas/Public/Views/_ViewStart.cshtml @@ -1,3 +1,3 @@ @{ - Layout = "~/Views/Shared/_PublicLayout.cshtml"; + Layout = MVC.Shared.Views._PublicLayout; } \ No newline at end of file diff --git a/Disco.Web/Areas/Public/Views/_ViewStart.generated.cs b/Disco.Web/Areas/Public/Views/_ViewStart.generated.cs index ce061200..c0510c80 100644 --- a/Disco.Web/Areas/Public/Views/_ViewStart.generated.cs +++ b/Disco.Web/Areas/Public/Views/_ViewStart.generated.cs @@ -45,7 +45,7 @@ namespace Disco.Web.Areas.Public.Views #line 1 "..\..\Areas\Public\Views\_ViewStart.cshtml" - Layout = "~/Views/Shared/_PublicLayout.cshtml"; + Layout = MVC.Shared.Views._PublicLayout; #line default diff --git a/Disco.Web/Disco.Web.csproj b/Disco.Web/Disco.Web.csproj index 3148f9e7..5511a8a7 100644 --- a/Disco.Web/Disco.Web.csproj +++ b/Disco.Web/Disco.Web.csproj @@ -1788,10 +1788,10 @@ RazorGenerator Licence.generated.cs - + RazorGenerator AccessDeniedException.generated.cs - + RazorGenerator Exception.generated.cs @@ -1933,7 +1933,6 @@ - diff --git a/Disco.Web/T4MVC.cs b/Disco.Web/T4MVC.cs index c8235cec..e4c1d806 100644 --- a/Disco.Web/T4MVC.cs +++ b/Disco.Web/T4MVC.cs @@ -90,7 +90,6 @@ namespace T4MVC public Disco.Web.Areas.Public.Controllers.HeldDevicesController HeldDevices = new Disco.Web.Areas.Public.Controllers.T4MVC_HeldDevicesController(); public Disco.Web.Areas.Public.Controllers.PublicController Public = new Disco.Web.Areas.Public.Controllers.T4MVC_PublicController(); public Disco.Web.Areas.Public.Controllers.UserHeldDevicesController UserHeldDevices = new Disco.Web.Areas.Public.Controllers.T4MVC_UserHeldDevicesController(); - public T4MVC.Public.SharedController Shared = new T4MVC.Public.SharedController(); } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public class ServicesClass @@ -373,7 +372,7 @@ namespace Links } public static readonly string Timeline_js_bundle = Url("Timeline.js.bundle"); - public static readonly string timeline_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/timeline.min.js") ? Url("timeline.min.js") : Url("timeline.js"); + public static readonly string Timeline_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/Timeline.min.js") ? Url("Timeline.min.js") : Url("Timeline.js"); public static readonly string Timeline_min_js = Url("Timeline.min.js"); public static readonly string Timeline_min_js_map = Url("Timeline.min.js.map"); [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] @@ -2163,6 +2162,7 @@ namespace T4MVC public readonly string _JobTable = "_JobTable"; public readonly string _JobTableRender = "_JobTableRender"; public readonly string _Layout = "_Layout"; + public readonly string _PublicLayout = "_PublicLayout"; public readonly string _SearchDialog = "_SearchDialog"; public readonly string Error = "Error"; } @@ -2171,8 +2171,17 @@ namespace T4MVC public readonly string _JobTable = "~/Views/Shared/_JobTable.cshtml"; public readonly string _JobTableRender = "~/Views/Shared/_JobTableRender.cshtml"; public readonly string _Layout = "~/Views/Shared/_Layout.cshtml"; + public readonly string _PublicLayout = "~/Views/Shared/_PublicLayout.cshtml"; public readonly string _SearchDialog = "~/Views/Shared/_SearchDialog.cshtml"; public readonly string Error = "~/Views/Shared/Error.cshtml"; + static readonly _DisplayTemplatesClass s_DisplayTemplates = new _DisplayTemplatesClass(); + public _DisplayTemplatesClass DisplayTemplates { get { return s_DisplayTemplates; } } + [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] + public partial class _DisplayTemplatesClass + { + public readonly string AccessDeniedException = "AccessDeniedException"; + public readonly string Exception = "Exception"; + } } } @@ -10567,29 +10576,6 @@ namespace Disco.Web.Areas.Public.Controllers } } -namespace T4MVC.Public -{ - public class SharedController - { - - static readonly ViewsClass s_views = new ViewsClass(); - [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] - public ViewsClass Views { get { return s_views; } } - [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] - public class ViewsClass - { - static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass(); - public _ViewNamesClass ViewNames { get { return s_ViewNames; } } - public class _ViewNamesClass - { - public readonly string _Layout = "_Layout"; - } - public readonly string _Layout = "~/Areas/Public/Views/Shared/_Layout.cshtml"; - } - } - -} - namespace Disco.Web.Areas.Services.Controllers { public partial class ClientController diff --git a/Disco.Web/Views/InitialConfig/_ViewStart.cshtml b/Disco.Web/Views/InitialConfig/_ViewStart.cshtml index 56b0cd8d..5d6aaff6 100644 --- a/Disco.Web/Views/InitialConfig/_ViewStart.cshtml +++ b/Disco.Web/Views/InitialConfig/_ViewStart.cshtml @@ -1,4 +1,4 @@ @{ - Layout = "~/Views/InitialConfig/_Layout.cshtml"; + Layout = MVC.InitialConfig.Views._Layout; Html.BundleDeferred("~/Style/InitialConfig"); } \ No newline at end of file diff --git a/Disco.Web/Views/InitialConfig/_ViewStart.generated.cs b/Disco.Web/Views/InitialConfig/_ViewStart.generated.cs index 43cb0b07..c6f42e1c 100644 --- a/Disco.Web/Views/InitialConfig/_ViewStart.generated.cs +++ b/Disco.Web/Views/InitialConfig/_ViewStart.generated.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18051 +// Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -45,7 +45,7 @@ namespace Disco.Web.Views.InitialConfig #line 1 "..\..\Views\InitialConfig\_ViewStart.cshtml" - Layout = "~/Views/InitialConfig/_Layout.cshtml"; + Layout = MVC.InitialConfig.Views._Layout; Html.BundleDeferred("~/Style/InitialConfig"); diff --git a/Disco.Web/Views/Job/Create.cshtml b/Disco.Web/Views/Job/Create.cshtml index 0e5a1bf6..4278c328 100644 --- a/Disco.Web/Views/Job/Create.cshtml +++ b/Disco.Web/Views/Job/Create.cshtml @@ -2,7 +2,7 @@ @{ Authorization.Require(Claims.Job.Actions.Create); - Layout = "~/Views/Shared/_DialogLayout.cshtml"; + Layout = MVC.Shared.Views._DialogLayout; ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create"); }
diff --git a/Disco.Web/Views/Job/Create.generated.cs b/Disco.Web/Views/Job/Create.generated.cs index 363c79cc..31f1f64f 100644 --- a/Disco.Web/Views/Job/Create.generated.cs +++ b/Disco.Web/Views/Job/Create.generated.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18051 +// Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -47,7 +47,7 @@ namespace Disco.Web.Views.Job Authorization.Require(Claims.Job.Actions.Create); - Layout = "~/Views/Shared/_DialogLayout.cshtml"; + Layout = MVC.Shared.Views._DialogLayout; ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create"); @@ -208,15 +208,15 @@ WriteLiteral(">\r\n"); #line hidden WriteLiteral(" (jt.Id +, Tuple.Create(Tuple.Create("", 1114), Tuple.Create(jt.Id #line default #line hidden -, 1121), false) +, 1114), false) ); WriteLiteral(" class=\"createJob_SubType\""); diff --git a/Disco.Web/Views/Update/Index.cshtml b/Disco.Web/Views/Update/Index.cshtml index e1fc1fce..29a7a28c 100644 --- a/Disco.Web/Views/Update/Index.cshtml +++ b/Disco.Web/Views/Update/Index.cshtml @@ -1,7 +1,7 @@ @model Disco.Web.Models.Update.IndexModel @{ ViewBag.Title = "Disco Post-Update Configuration"; - Layout = "~/Areas/Public/Views/Shared/_Layout.cshtml"; + Layout = MVC.Shared.Views._PublicLayout; Html.BundleDeferred("~/ClientScripts/Modules/Knockout"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR"); diff --git a/Disco.Web/Views/Update/Index.generated.cs b/Disco.Web/Views/Update/Index.generated.cs index 312575a8..9b25e0ff 100644 --- a/Disco.Web/Views/Update/Index.generated.cs +++ b/Disco.Web/Views/Update/Index.generated.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18051 +// Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -46,7 +46,7 @@ namespace Disco.Web.Views.Update #line 2 "..\..\Views\Update\Index.cshtml" ViewBag.Title = "Disco Post-Update Configuration"; - Layout = "~/Areas/Public/Views/Shared/_Layout.cshtml"; + Layout = MVC.Shared.Views._PublicLayout; Html.BundleDeferred("~/ClientScripts/Modules/Knockout"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR"); diff --git a/Disco.Web/Views/_ViewStart.cshtml b/Disco.Web/Views/_ViewStart.cshtml index efda124b..15dc16f5 100644 --- a/Disco.Web/Views/_ViewStart.cshtml +++ b/Disco.Web/Views/_ViewStart.cshtml @@ -1,3 +1,3 @@ @{ - Layout = "~/Views/Shared/_Layout.cshtml"; + Layout = MVC.Shared.Views._Layout; } \ No newline at end of file diff --git a/Disco.Web/Views/_ViewStart.generated.cs b/Disco.Web/Views/_ViewStart.generated.cs index 3098fcf0..28d350df 100644 --- a/Disco.Web/Views/_ViewStart.generated.cs +++ b/Disco.Web/Views/_ViewStart.generated.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18051 +// Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -45,7 +45,7 @@ namespace Disco.Web.Views #line 1 "..\..\Views\_ViewStart.cshtml" - Layout = "~/Views/Shared/_Layout.cshtml"; + Layout = MVC.Shared.Views._Layout; #line default