mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Cleaning page class names
--HG-- branch : 1.x
This commit is contained in:
@@ -33,7 +33,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
dynamic model = _contentManager.BuildDisplay(contentItem);
|
||||
return new ShapeResult(this, model);
|
||||
return View((object)model);
|
||||
}
|
||||
|
||||
// /Contents/Item/Preview/72
|
||||
@@ -57,7 +57,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
dynamic model = _contentManager.BuildDisplay(contentItem);
|
||||
return new ShapeResult(this, model);
|
||||
return View((object)model);
|
||||
}
|
||||
}
|
||||
}
|
||||
6
src/Orchard.Web/Core/Contents/Views/Item/Display.cshtml
Normal file
6
src/Orchard.Web/Core/Contents/Views/Item/Display.cshtml
Normal file
@@ -0,0 +1,6 @@
|
||||
@using Orchard.ContentManagement
|
||||
@using Orchard.Utility.Extensions
|
||||
@{
|
||||
ContentItem contentItem = Model.ContentItem;
|
||||
Html.AddPageClassNames("detail-" + contentItem.ContentType.HtmlClassify());
|
||||
}@Display(Model)
|
||||
6
src/Orchard.Web/Core/Contents/Views/Item/Preview.cshtml
Normal file
6
src/Orchard.Web/Core/Contents/Views/Item/Preview.cshtml
Normal file
@@ -0,0 +1,6 @@
|
||||
@using Orchard.ContentManagement
|
||||
@using Orchard.Utility.Extensions
|
||||
@{
|
||||
ContentItem contentItem = Model.ContentItem;
|
||||
Html.AddPageClassNames("preview", "detail-" + contentItem.ContentType.HtmlClassify());
|
||||
}@Display(Model)
|
||||
@@ -550,6 +550,12 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Contents\Views\Parts.Contents.Clone.SummaryAdmin.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Contents\Views\Item\Display.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Contents\Views\Item\Preview.cshtml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
||||
@@ -114,9 +114,6 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Item\Create.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Item\Edit.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts.CustomForm.Edit.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
@using Orchard.ContentManagement
|
||||
@using Orchard.Utility.Extensions
|
||||
@{
|
||||
ContentItem customForm = Model.ContentItem;
|
||||
string returnUrl = Model.ReturnUrl;
|
||||
|
||||
|
||||
Html.AddPageClassNames("edit-" + customForm.ContentType.HtmlClassify());
|
||||
|
||||
// remove default Save/Publish buttons
|
||||
Model.Zones["Sidebar"].Items.Clear();
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
@Html.ValidationSummary()
|
||||
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
|
||||
@Display(Model)
|
||||
}
|
||||
@@ -7,13 +7,10 @@ using Orchard.DisplayManagement;
|
||||
using Orchard.DisplayManagement.Descriptors;
|
||||
using Orchard.FileSystems.VirtualPath;
|
||||
using Orchard.Logging;
|
||||
using Orchard.UI.PageClass;
|
||||
using Orchard.UI.Zones;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.ContentManagement {
|
||||
public class DefaultContentDisplay : IContentDisplay {
|
||||
private readonly IPageClassBuilder _pageClassBuilder;
|
||||
private readonly Lazy<IEnumerable<IContentHandler>> _handlers;
|
||||
private readonly IShapeFactory _shapeFactory;
|
||||
private readonly Lazy<IShapeTableLocator> _shapeTableLocator;
|
||||
@@ -23,14 +20,12 @@ namespace Orchard.ContentManagement {
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
|
||||
public DefaultContentDisplay(
|
||||
IPageClassBuilder pageClassBuilder,
|
||||
Lazy<IEnumerable<IContentHandler>> handlers,
|
||||
IShapeFactory shapeFactory,
|
||||
Lazy<IShapeTableLocator> shapeTableLocator,
|
||||
RequestContext requestContext,
|
||||
IVirtualPathProvider virtualPathProvider,
|
||||
IWorkContextAccessor workContextAccessor) {
|
||||
_pageClassBuilder = pageClassBuilder;
|
||||
_handlers = handlers;
|
||||
_shapeFactory = shapeFactory;
|
||||
_shapeTableLocator = shapeTableLocator;
|
||||
@@ -52,10 +47,6 @@ namespace Orchard.ContentManagement {
|
||||
var actualShapeType = stereotype;
|
||||
var actualDisplayType = string.IsNullOrWhiteSpace(displayType) ? "Detail" : displayType;
|
||||
|
||||
if (actualDisplayType == "Detail") {
|
||||
_pageClassBuilder.AddClassNames("detail-" + content.ContentItem.ContentType.HtmlClassify());
|
||||
}
|
||||
|
||||
dynamic itemShape = CreateItemShape(actualShapeType);
|
||||
itemShape.ContentItem = content.ContentItem;
|
||||
itemShape.Metadata.DisplayType = actualDisplayType;
|
||||
@@ -77,7 +68,6 @@ namespace Orchard.ContentManagement {
|
||||
stereotype = "Content";
|
||||
|
||||
var actualShapeType = stereotype + "_Edit";
|
||||
_pageClassBuilder.AddClassNames("edit-" + content.ContentItem.ContentType.HtmlClassify());
|
||||
|
||||
dynamic itemShape = CreateItemShape(actualShapeType);
|
||||
itemShape.ContentItem = content.ContentItem;
|
||||
@@ -101,7 +91,6 @@ namespace Orchard.ContentManagement {
|
||||
stereotype = "Content";
|
||||
|
||||
var actualShapeType = stereotype + "_Edit";
|
||||
_pageClassBuilder.AddClassNames("edit-" + content.ContentItem.ContentType.HtmlClassify());
|
||||
|
||||
dynamic itemShape = CreateItemShape(actualShapeType);
|
||||
itemShape.ContentItem = content.ContentItem;
|
||||
|
||||
Reference in New Issue
Block a user