From 9447b4d3e7c8f14d560d9a6645e679eff76b7e84 Mon Sep 17 00:00:00 2001
From: Nathan Heskew
Date: Mon, 18 Oct 2010 10:11:14 -0700
Subject: [PATCH 1/5] Updating the ContentFieldDriver to work with shapes
--HG--
branch : dev
---
.../Drivers/ContentFieldDriver.cs | 46 +++++++++++++++----
1 file changed, 36 insertions(+), 10 deletions(-)
diff --git a/src/Orchard/ContentManagement/Drivers/ContentFieldDriver.cs b/src/Orchard/ContentManagement/Drivers/ContentFieldDriver.cs
index 9ec26a243..17cbcded1 100644
--- a/src/Orchard/ContentManagement/Drivers/ContentFieldDriver.cs
+++ b/src/Orchard/ContentManagement/Drivers/ContentFieldDriver.cs
@@ -3,22 +3,23 @@ using System.Collections.Generic;
using System.Linq;
using Orchard.ContentManagement.Handlers;
using Orchard.ContentManagement.MetaData;
+using Orchard.DisplayManagement;
namespace Orchard.ContentManagement.Drivers {
public abstract class ContentFieldDriver : IContentFieldDriver where TField : ContentField, new() {
protected virtual string Prefix { get { return ""; } }
- protected virtual string Zone { get { return "body"; } }
+ protected virtual string Zone { get { return "Content"; } }
DriverResult IContentFieldDriver.BuildDisplayShape(BuildDisplayContext context) {
- return Process(context.ContentItem, (part, field) => Display(part, field, context.DisplayType));
+ return Process(context.ContentItem, (part, field) => Display(part, field, context.DisplayType, context.New));
}
DriverResult IContentFieldDriver.BuildEditorShape(BuildEditorContext context) {
- return Process(context.ContentItem, Editor);
+ return Process(context.ContentItem, (part, field) => Editor(part, field, context.New));
}
DriverResult IContentFieldDriver.UpdateEditorShape(UpdateEditorContext context) {
- return Process(context.ContentItem, (part, field) => Editor(part, field, context.Updater));
+ return Process(context.ContentItem, (part, field) => Editor(part, field, context.Updater, context.New));
}
DriverResult Process(ContentItem item, Func effort) {
@@ -43,19 +44,44 @@ namespace Orchard.ContentManagement.Drivers {
}
- protected virtual DriverResult Display(ContentPart part, TField field, string displayType) { return null; }
- protected virtual DriverResult Editor(ContentPart part, TField field) { return null; }
- protected virtual DriverResult Editor(ContentPart part, TField field, IUpdateModel updater) { return null; }
+ protected virtual DriverResult Display(ContentPart part, TField field, string displayType, dynamic shapeHelper) { return null; }
+ protected virtual DriverResult Editor(ContentPart part, TField field, dynamic shapeHelper) { return null; }
+ protected virtual DriverResult Editor(ContentPart part, TField field, IUpdateModel updater, dynamic shapeHelper) { return null; }
+ public ContentShapeResult ContentShape(string shapeType, Func factory) {
+ return ContentShapeImplementation(shapeType, null, ctx => factory());
+ }
+ public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func factory) {
+ return ContentShapeImplementation(shapeType, defaultLocation, ctx => factory());
+ }
+
+ public ContentShapeResult ContentShape(string shapeType, Func factory) {
+ return ContentShapeImplementation(shapeType, null, ctx=>factory(CreateShape(ctx, shapeType)));
+ }
+
+ public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func factory) {
+ return ContentShapeImplementation(shapeType, defaultLocation, factory);
+ }
+
+ private ContentShapeResult ContentShapeImplementation(string shapeType, string defaultLocation, Func shapeBuilder) {
+ return new ContentShapeResult(shapeType, Prefix, shapeBuilder).Location(defaultLocation);
+ }
+
+ private object CreateShape(BuildShapeContext context, string shapeType) {
+ IShapeFactory shapeFactory = context.New;
+ return shapeFactory.Create(shapeType);
+ }
+
+ [Obsolete]
public ContentTemplateResult ContentFieldTemplate(object model) {
return new ContentTemplateResult(model, null, Prefix).Location(Zone);
}
-
+ [Obsolete]
public ContentTemplateResult ContentFieldTemplate(object model, string template) {
return new ContentTemplateResult(model, template, Prefix).Location(Zone);
}
-
+ [Obsolete]
public ContentTemplateResult ContentFieldTemplate(object model, string template, string prefix) {
return new ContentTemplateResult(model, template, prefix).Location(Zone);
}
@@ -64,4 +90,4 @@ namespace Orchard.ContentManagement.Drivers {
return new CombinedResult(results);
}
}
-}
\ No newline at end of file
+}
\ No newline at end of file
From 97a3ff0bd7e1bae6460ff8d3f0b68e49e3de506f Mon Sep 17 00:00:00 2001
From: Nathan Heskew
Date: Mon, 18 Oct 2010 10:11:43 -0700
Subject: [PATCH 2/5] Changing the default content part zone to "Content"
--HG--
branch : dev
---
src/Orchard/ContentManagement/Drivers/ContentPartDriver.cs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/Orchard/ContentManagement/Drivers/ContentPartDriver.cs b/src/Orchard/ContentManagement/Drivers/ContentPartDriver.cs
index c362864d9..146fce428 100644
--- a/src/Orchard/ContentManagement/Drivers/ContentPartDriver.cs
+++ b/src/Orchard/ContentManagement/Drivers/ContentPartDriver.cs
@@ -7,7 +7,7 @@ using Orchard.DisplayManagement;
namespace Orchard.ContentManagement.Drivers {
public abstract class ContentPartDriver : IContentPartDriver where TContent : ContentPart, new() {
protected virtual string Prefix { get { return ""; } }
- protected virtual string Zone { get { return "Primary"; } }
+ protected virtual string Zone { get { return "Content"; } }
DriverResult IContentPartDriver.BuildDisplay(BuildDisplayContext context) {
var part = context.ContentItem.As();
@@ -45,7 +45,6 @@ namespace Orchard.ContentManagement.Drivers {
return ContentShapeImplementation(shapeType, null, ctx=>factory(CreateShape(ctx, shapeType)));
}
-
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func factory) {
return ContentShapeImplementation(shapeType, defaultLocation, factory);
}
From 1f4145ddd25f69c9d3bc5d9c60e31d816c9b1b17 Mon Sep 17 00:00:00 2001
From: Nathan Heskew
Date: Mon, 18 Oct 2010 10:12:53 -0700
Subject: [PATCH 3/5] Changing edit part shape names to end in "_Edit"
--HG--
branch : dev
---
.../Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs | 2 +-
.../Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs | 4 ++--
.../Modules/Orchard.Tags/Drivers/TagsPartDriver.cs | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs
index 319ccde9e..082bf4019 100644
--- a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs
+++ b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs
@@ -47,7 +47,7 @@ namespace Orchard.Blogs.Drivers {
}
protected override DriverResult Editor(RecentBlogPostsPart part, dynamic shapeHelper) {
- return ContentShape("Parts_Blogs_RecentBlogPosts_Editor",
+ return ContentShape("Parts_Blogs_RecentBlogPosts_Edit",
() => shapeHelper.EditorTemplate(TemplateName: "Parts/Blogs.RecentBlogPosts", Model: part, Prefix: Prefix));
}
diff --git a/src/Orchard.Web/Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs
index e8847e280..7706e6d2b 100644
--- a/src/Orchard.Web/Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs
+++ b/src/Orchard.Web/Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs
@@ -20,13 +20,13 @@ namespace Orchard.Email.Drivers {
protected override string Prefix { get { return "SmtpSettings"; } }
protected override DriverResult Editor(SmtpSettingsPart part, dynamic shapeHelper) {
- return ContentShape("Parts_SmtpSettings_Editor",
+ return ContentShape("Parts_SmtpSettings_Edit",
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: part, Prefix: Prefix));
}
protected override DriverResult Editor(SmtpSettingsPart part, IUpdateModel updater, dynamic shapeHelper) {
updater.TryUpdateModel(part, Prefix, null, null);
- return ContentShape("Parts_SmtpSettings_Editor",
+ return ContentShape("Parts_SmtpSettings_Edit",
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: part, Prefix: Prefix));
}
}
diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs
index 2989a258a..b517e940e 100644
--- a/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs
+++ b/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs
@@ -36,7 +36,7 @@ namespace Orchard.Tags.Drivers {
if (!_authorizationService.TryCheckAccess(Permissions.ApplyTag, CurrentUser, part))
return null;
- return ContentShape("Parts_Tags_Editor",
+ return ContentShape("Parts_Tags_Edit",
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: BuildEditorViewModel(part), Prefix: Prefix));
}
@@ -52,7 +52,7 @@ namespace Orchard.Tags.Drivers {
_tagService.UpdateTagsForContentItem(part.ContentItem.Id, tagNames);
}
- return ContentShape("Parts_Tags_Editor",
+ return ContentShape("Parts_Tags_Edit",
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix));
}
From fedf68e4a4f97484145ecdb8d51db71e689a79a9 Mon Sep 17 00:00:00 2001
From: Nathan Heskew
Date: Mon, 18 Oct 2010 10:13:57 -0700
Subject: [PATCH 4/5] Updating the Orchard.Core Common module to use the new
shape API
--HG--
branch : dev
---
.../Core/Common/Drivers/CommonPartDriver.cs | 19 ++++++-------
.../Core/Common/Drivers/TextFieldDriver.cs | 27 +++++++------------
src/Orchard.Web/Core/Common/Placement.info | 10 ++++++-
.../Common/ViewModels/BodyDisplayViewModel.cs | 9 -------
.../ViewModels/CommonMetadataViewModel.cs | 23 ----------------
.../Fields/Common.TextField.cshtml | 3 ---
.../Common.Body.Manage.SummaryAdmin.cshtml | 1 -
.../Parts/Common.Body.Manage.cshtml | 5 ----
...Body.ManageWrapperPost.SummaryAdmin.cshtml | 1 -
.../Common.Body.ManageWrapperPost.cshtml | 7 -----
....Body.ManageWrapperPre.SummaryAdmin.cshtml | 1 -
.../Parts/Common.Body.ManageWrapperPre.cshtml | 3 ---
...xtField.cshtml => Common.Text.Edit.cshtml} | 0
.../Common/Views/Fields/Common.Text.cshtml | 8 ++++++
src/Orchard.Web/Core/Orchard.Core.csproj | 12 ++-------
15 files changed, 39 insertions(+), 90 deletions(-)
delete mode 100644 src/Orchard.Web/Core/Common/ViewModels/BodyDisplayViewModel.cs
delete mode 100644 src/Orchard.Web/Core/Common/ViewModels/CommonMetadataViewModel.cs
delete mode 100644 src/Orchard.Web/Core/Common/Views/DisplayTemplates/Fields/Common.TextField.cshtml
delete mode 100644 src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.Manage.SummaryAdmin.cshtml
delete mode 100644 src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.Manage.cshtml
delete mode 100644 src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPost.SummaryAdmin.cshtml
delete mode 100644 src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPost.cshtml
delete mode 100644 src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPre.SummaryAdmin.cshtml
delete mode 100644 src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPre.cshtml
rename src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields/{Common.TextField.cshtml => Common.Text.Edit.cshtml} (100%)
create mode 100644 src/Orchard.Web/Core/Common/Views/Fields/Common.Text.cshtml
diff --git a/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs
index ceb9377e9..cf735b2bd 100644
--- a/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs
+++ b/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs
@@ -2,7 +2,6 @@
using Orchard.ContentManagement.Drivers;
using Orchard.Core.Common.Models;
using Orchard.Core.Common.ViewModels;
-using Orchard.Core.ContentsLocation.Models;
using Orchard.Localization;
using Orchard.Security;
using Orchard.Services;
@@ -48,8 +47,8 @@ namespace Orchard.Core.Common.Drivers {
protected override DriverResult Editor(CommonPart part, dynamic shapeHelper) {
return Combined(
- OwnerEditor(part, null),
- ContainerEditor(part, null));
+ OwnerEditor(part, null, shapeHelper),
+ ContainerEditor(part, null, shapeHelper));
}
protected override DriverResult Editor(CommonPart instance, IUpdateModel updater, dynamic shapeHelper) {
@@ -58,11 +57,11 @@ namespace Orchard.Core.Common.Drivers {
instance.VersionModifiedUtc = _clock.UtcNow;
return Combined(
- OwnerEditor(instance, updater),
- ContainerEditor(instance, updater));
+ OwnerEditor(instance, updater, shapeHelper),
+ ContainerEditor(instance, updater, shapeHelper));
}
- DriverResult OwnerEditor(CommonPart part, IUpdateModel updater) {
+ DriverResult OwnerEditor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) {
var currentUser = _authenticationService.GetAuthenticatedUser();
if (!_authorizationService.TryCheckAccess(Permissions.ChangeOwner, currentUser, part)) {
return null;
@@ -87,10 +86,11 @@ namespace Orchard.Core.Common.Drivers {
}
}
- return ContentPartTemplate(model, "Parts/Common.Owner", TemplatePrefix).Location(part.GetLocation("Editor"));
+ return ContentShape("Parts_Common_Owner_Edit",
+ () => shapeHelper.EditorTemplate(TemplateName: "Parts/Common.Owner", Model: model, Prefix: Prefix));
}
- DriverResult ContainerEditor(CommonPart part, IUpdateModel updater) {
+ DriverResult ContainerEditor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) {
var currentUser = _authenticationService.GetAuthenticatedUser();
if (!_authorizationService.TryCheckAccess(Permissions.ChangeOwner, currentUser, part)) {
return null;
@@ -115,7 +115,8 @@ namespace Orchard.Core.Common.Drivers {
}
}
- return ContentPartTemplate(model, "Parts/Common.Container", TemplatePrefix).Location(part.GetLocation("Editor"));
+ return ContentShape("Parts_Common_Container_Edit",
+ () => shapeHelper.EditorTemplate(TemplateName: "Parts/Common.Container", Model: model, Prefix: Prefix));
}
}
}
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs b/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs
index 128379d55..d697728f5 100644
--- a/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs
+++ b/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs
@@ -2,39 +2,32 @@
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.Core.Common.Fields;
-using Orchard.Core.ContentsLocation.Models;
namespace Orchard.Core.Common.Drivers {
[UsedImplicitly]
public class TextFieldDriver : ContentFieldDriver {
- public IOrchardServices Services { get; set; }
- private const string TemplateName = "Fields/Common.TextField";
-
public TextFieldDriver(IOrchardServices services) {
Services = services;
}
+ public IOrchardServices Services { get; set; }
+
private static string GetPrefix(TextField field, ContentPart part) {
return part.PartDefinition.Name + "." + field.Name;
}
- protected override DriverResult Display(ContentPart part, TextField field, string displayType) {
- var location = field.GetLocation(displayType, "Primary", "1");
-
- return ContentFieldTemplate(field, TemplateName, GetPrefix(field, part))
- .Location(location);
+ protected override DriverResult Display(ContentPart part, TextField field, string displayType, dynamic shapeHelper) {
+ return ContentShape("Fields_Common_Text", () => shapeHelper.Fields_Common_Text(ContentField: field, Name: field.Name, Value: field.Value));
}
- protected override DriverResult Editor(ContentPart part, TextField field) {
- var location = field.GetLocation("Editor", "Primary", "1");
-
- return ContentFieldTemplate(field, TemplateName, GetPrefix(field, part))
- .Location(location);
+ protected override DriverResult Editor(ContentPart part, TextField field, dynamic shapeHelper) {
+ return ContentShape("Fields_Common_Text_Edit",
+ () => shapeHelper.EditorTemplate(TemplateName: "Fields/Common.Text.Edit", Model: field, Prefix: GetPrefix(field, part)));
}
- protected override DriverResult Editor(ContentPart part, TextField field, IUpdateModel updater) {
+ protected override DriverResult Editor(ContentPart part, TextField field, IUpdateModel updater, dynamic shapeHelper) {
updater.TryUpdateModel(field, GetPrefix(field, part), null, null);
- return Editor(part, field);
+ return Editor(part, field, shapeHelper);
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Placement.info b/src/Orchard.Web/Core/Common/Placement.info
index fa102159f..c9796ff46 100644
--- a/src/Orchard.Web/Core/Common/Placement.info
+++ b/src/Orchard.Web/Core/Common/Placement.info
@@ -1,16 +1,24 @@
-
+
+
+
+
+
+
@Model.Name.CamelFriendly(): @Model.Value
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.Manage.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.Manage.SummaryAdmin.cshtml
deleted file mode 100644
index 55250529b..000000000
--- a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.Manage.SummaryAdmin.cshtml
+++ /dev/null
@@ -1 +0,0 @@
-@model Orchard.Core.Common.ViewModels.BodyDisplayViewModel
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.Manage.cshtml b/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.Manage.cshtml
deleted file mode 100644
index 7340291dc..000000000
--- a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.Manage.cshtml
+++ /dev/null
@@ -1,5 +0,0 @@
-@model BodyDisplayViewModel
-@using Orchard.Core.Common.ViewModels;
-
- @Html.ItemEditLinkWithReturnUrl(T("Edit").ToString(), Model.BodyPart.ContentItem)
-
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPost.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPost.SummaryAdmin.cshtml
deleted file mode 100644
index 55250529b..000000000
--- a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPost.SummaryAdmin.cshtml
+++ /dev/null
@@ -1 +0,0 @@
-@model Orchard.Core.Common.ViewModels.BodyDisplayViewModel
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPost.cshtml b/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPost.cshtml
deleted file mode 100644
index a24a87b20..000000000
--- a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPost.cshtml
+++ /dev/null
@@ -1,7 +0,0 @@
-@model BodyDisplayViewModel
-@using Orchard.Core.Common.ViewModels;
-@* begin: knowingly broken HTML (hence the ManageWrapperPre and ManageWrapperPost templates)
-we need "wrapper templates" (among other functionality) in the future of UI composition
-please do not delete or the front end will be broken when the user is authenticated. *@
-
-@* begin: knowingly broken HTML *@
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPre.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPre.SummaryAdmin.cshtml
deleted file mode 100644
index 55250529b..000000000
--- a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPre.SummaryAdmin.cshtml
+++ /dev/null
@@ -1 +0,0 @@
-@model Orchard.Core.Common.ViewModels.BodyDisplayViewModel
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPre.cshtml b/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPre.cshtml
deleted file mode 100644
index 930523ad4..000000000
--- a/src/Orchard.Web/Core/Common/Views/DisplayTemplates/Parts/Common.Body.ManageWrapperPre.cshtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@model BodyDisplayViewModel
-@using Orchard.Core.Common.ViewModels;
-
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields/Common.TextField.cshtml b/src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields/Common.Text.Edit.cshtml
similarity index 100%
rename from src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields/Common.TextField.cshtml
rename to src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields/Common.Text.Edit.cshtml
diff --git a/src/Orchard.Web/Core/Common/Views/Fields/Common.Text.cshtml b/src/Orchard.Web/Core/Common/Views/Fields/Common.Text.cshtml
new file mode 100644
index 000000000..4cf10f9d6
--- /dev/null
+++ b/src/Orchard.Web/Core/Common/Views/Fields/Common.Text.cshtml
@@ -0,0 +1,8 @@
+@using Orchard.Utility.Extensions;
+@{
+ string name = Model.Name;
+ string value = Model.Value;
+}
+@if (HasText(name) && HasText(value)) {
+
@name.CamelFriendly(): @value
+}
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj
index 401f49ce3..c3693cfad 100644
--- a/src/Orchard.Web/Core/Orchard.Core.csproj
+++ b/src/Orchard.Web/Core/Orchard.Core.csproj
@@ -82,7 +82,6 @@
-
@@ -148,7 +147,6 @@
-
@@ -255,11 +253,8 @@
-
+
-
-
-
@@ -281,7 +276,7 @@
-
+
@@ -359,9 +354,6 @@
-
-
-
From 8e8e8724933657f92f76bc1773df3e136fc83624 Mon Sep 17 00:00:00 2001
From: Nathan Heskew
Date: Mon, 18 Oct 2010 10:15:20 -0700
Subject: [PATCH 5/5] A little cleanup of the BodyPartDriver
--HG--
branch : dev
---
src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs
index 4f52efb0a..fd0726094 100644
--- a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs
+++ b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using System.Web;
using JetBrains.Annotations;
@@ -9,7 +8,6 @@ using Orchard.ContentManagement.Drivers;
using Orchard.Core.Common.Models;
using Orchard.Core.Common.Settings;
using Orchard.Core.Common.ViewModels;
-using Orchard.Core.ContentsLocation.Models;
using Orchard.Core.Routable.Models;
using Orchard.Services;
@@ -49,10 +47,6 @@ namespace Orchard.Core.Common.Drivers {
);
}
- private string IfThen(bool predicate, string value) {
- return predicate ? value : null;
- }
-
protected override DriverResult Editor(BodyPart part, dynamic shapeHelper) {
var model = BuildEditorViewModel(part);
return ContentShape("Parts_Common_Body_Edit",