From 168abddacfd7cfcb243490650b54f32a6bf25129 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 15 Jan 2014 20:57:27 +0100 Subject: [PATCH 1/2] U4-2737 Snippets that are available when creating new MacroScripts should also be available for Partial Views --- src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Empty.cshtml | 2 +- src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx | 2 +- src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Empty.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Empty.cshtml index dda3a17f51..2363dcc14c 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Empty.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViews/Templates/Empty.cshtml @@ -1 +1 @@ -@inherits Umbraco.Web.Macros.PartialViewMacroPage \ No newline at end of file +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx index b0cc4e634d..b34560a19e 100644 --- a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx +++ b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx @@ -8,7 +8,7 @@ * - + Clean diff --git a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx index 7a4372d7c9..9dc16377eb 100644 --- a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx +++ b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx @@ -9,7 +9,7 @@ * - + From f56cb2c3ace04601aaa126cdf6f9c72c294d02d6 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 15 Jan 2014 21:11:35 +0100 Subject: [PATCH 2/2] Hardcoded empty snippets need to be updated as well.. --- src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs | 10 +++++----- .../umbraco/create/PartialViewMacro.ascx.cs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs index 5fcd310656..05c9944177 100644 --- a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs +++ b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs @@ -24,16 +24,16 @@ namespace Umbraco.Web.UI.Umbraco.Create var path = IOHelper.MapPath(SystemDirectories.Umbraco + "/PartialViews/Templates/"); list.Items.Clear(); - // always add the options of empty templates - list.Items.Add(new ListItem("Empty Template", "EmptyTemplate.cshtml")); - list.Items.Add(new ListItem("Empty Template (For Use With Custom Views)", "EmptyTemplate (ForUseWithCustomViews).cshtml")); + // always add the options of empty snippets + list.Items.Add(new ListItem("Empty", "Empty.cshtml")); + list.Items.Add(new ListItem("Empty (For Use With Custom Views)", "Empty (ForUseWithCustomViews).cshtml")); if (System.IO.Directory.Exists(path)) { const string extension = ".cshtml"; - //Already adding Empty Template as the first item, so don't add it again - foreach (var fileInfo in new System.IO.DirectoryInfo(path).GetFiles("*" + extension).Where(f => f.Name.StartsWith("EmptyTemplate") == false)) + //Already adding Empty as the first item, so don't add it again + foreach (var fileInfo in new System.IO.DirectoryInfo(path).GetFiles("*" + extension).Where(f => f.Name.StartsWith("Empty") == false)) { var filename = System.IO.Path.GetFileName(fileInfo.FullName); diff --git a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs index 8ed79da349..6e07894b9f 100644 --- a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs @@ -24,16 +24,16 @@ namespace Umbraco.Web.UI.Umbraco.Create var path = IOHelper.MapPath(SystemDirectories.Umbraco + "/PartialViewMacros/Templates/"); list.Items.Clear(); - // always add the options of empty templates - list.Items.Add(new ListItem("Empty Template", "EmptyTemplate.cshtml")); - list.Items.Add(new ListItem("Empty Template (For Use With Custom Views)", "EmptyTemplate (ForUseWithCustomViews).cshtml")); + // always add the options of empty snippets + list.Items.Add(new ListItem("Empty", "Empty.cshtml")); + list.Items.Add(new ListItem("Empty (For Use With Custom Views)", "Empty (ForUseWithCustomViews).cshtml")); if (System.IO.Directory.Exists(path)) { const string extension = ".cshtml"; - //Already adding Empty Template as the first item, so don't add it again - foreach (var fileInfo in new System.IO.DirectoryInfo(path).GetFiles("*" + extension).Where(f => f.Name.StartsWith("EmptyTemplate") == false)) + //Already adding Empty as the first item, so don't add it again + foreach (var fileInfo in new System.IO.DirectoryInfo(path).GetFiles("*" + extension).Where(f => f.Name.StartsWith("Empty") == false)) { var filename = System.IO.Path.GetFileName(fileInfo.FullName);