diff --git a/src/Umbraco.Web/GridTemplateExtensions.cs b/src/Umbraco.Web/GridTemplateExtensions.cs index 27b4a45d6b..799eb1a097 100644 --- a/src/Umbraco.Web/GridTemplateExtensions.cs +++ b/src/Umbraco.Web/GridTemplateExtensions.cs @@ -17,7 +17,7 @@ namespace Umbraco.Web public static MvcHtmlString GetGridHtml(this IPublishedProperty property, string framework = "bootstrap3") { var view = "Grid/" + framework; - return new MvcHtmlString(renderPartialViewToString(view, property.Value)); + return new MvcHtmlString(RenderPartialViewToString(view, property.Value)); } public static MvcHtmlString GetGridHtml(this IPublishedContent contentItem) @@ -33,20 +33,22 @@ namespace Umbraco.Web public static MvcHtmlString GetGridHtml(this IPublishedContent contentItem, string propertyAlias, string framework) { var view = "Grid/" + framework; - var model = contentItem.GetProperty(propertyAlias).Value; + var model = contentItem.GetProperty(propertyAlias).Value; - return new MvcHtmlString(renderPartialViewToString(view, model)); + return new MvcHtmlString(RenderPartialViewToString(view, model)); } - private static string renderPartialViewToString(string viewName, object model) + private static string RenderPartialViewToString(string viewName, object model) { using (var sw = new StringWriter()) { - var cc = new ControllerContext(); - cc.RequestContext = new RequestContext(UmbracoContext.Current.HttpContext, new RouteData() - { - Route = RouteTable.Routes["Umbraco_default"] - }); + var cc = new ControllerContext + { + RequestContext = + new RequestContext( + UmbracoContext.Current.HttpContext, + new RouteData() { Route = RouteTable.Routes["Umbraco_default"] }) + }; var routeHandler = new RenderRouteHandler(ControllerBuilder.Current.GetControllerFactory(), UmbracoContext.Current); var routeDef = routeHandler.GetUmbracoRouteDefinition(cc.RequestContext, UmbracoContext.Current.PublishedContentRequest); @@ -66,6 +68,5 @@ namespace Umbraco.Web return sw.GetStringBuilder().ToString(); } } - } } diff --git a/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs index b1a052ba88..8603b6887a 100644 --- a/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs @@ -23,12 +23,11 @@ namespace Umbraco.Web.PropertyEditors protected override PreValueEditor CreatePreValueEditor() { - return new gridPreValueEditor(); + return new GridPreValueEditor(); } - } - internal class gridPreValueEditor : PreValueEditor + internal class GridPreValueEditor : PreValueEditor { [PreValueField("items", "Grid", "views/propertyeditors/grid/grid.prevalues.html", Description = "Grid configuration")] public string Items { get; set; }