mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
Shaping up the admin contents list a bit more and giving the UI shape template debug style a little something extra*
*still not meant as *the* long-term UI debugging solution but it does the trick for now --HG-- branch : theming
This commit is contained in:
@@ -107,7 +107,6 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
|
||||
contentItems = contentItems.Skip(skip).Take(pageSize).ToList();
|
||||
|
||||
//model.Entries = contentItems.Select(BuildEntry).ToList();
|
||||
model.Options.SelectedFilter = model.TypeName;
|
||||
model.Options.FilterOptions = GetCreatableTypes()
|
||||
.Select(ctd => new KeyValuePair<string, string>(ctd.Name, ctd.DisplayName))
|
||||
@@ -115,15 +114,10 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
|
||||
|
||||
var list = Shape.List();
|
||||
list.AddRange(contentItems);
|
||||
|
||||
var list2 = Shape.List();
|
||||
var items = contentItems.Select(ci=>_contentManager.BuildDisplayModel(ci, "SummaryAdmin"));
|
||||
list2.AddRange(items);
|
||||
list.AddRange(contentItems.Select(ci => _contentManager.BuildDisplayModel(ci, "SummaryAdmin")));
|
||||
|
||||
var viewModel = Shape.ViewModel()
|
||||
.ContentItems(list)
|
||||
.ContentItems2(list2)
|
||||
.Options(model.Options)
|
||||
.TypeDisplayName(model.TypeDisplayName ?? "");
|
||||
|
||||
@@ -203,25 +197,6 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
return RedirectToAction("List");
|
||||
}
|
||||
|
||||
private ListContentsViewModel.Entry BuildEntry(ContentItem contentItem) {
|
||||
var entry = new ListContentsViewModel.Entry {
|
||||
ContentItem = _contentManager.BuildDisplayModel(contentItem, "SummaryAdmin"),
|
||||
ContentItemMetadata = _contentManager.GetItemMetadata(contentItem),
|
||||
};
|
||||
if (string.IsNullOrEmpty(entry.ContentItemMetadata.DisplayText)) {
|
||||
entry.ContentItemMetadata.DisplayText = string.Format("[{0}#{1}]", contentItem.ContentType, contentItem.Id);
|
||||
}
|
||||
if (entry.ContentItemMetadata.EditorRouteValues == null) {
|
||||
entry.ContentItemMetadata.EditorRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Edit"},
|
||||
{"Id", contentItem.Id}
|
||||
};
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
ActionResult CreatableTypeList() {
|
||||
return View(Shape.Model(Types: GetCreatableTypes()));
|
||||
}
|
||||
|
||||
@@ -127,6 +127,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Views\HackStyle.cshtml" />
|
||||
<None Include="Views\ThinBorder.cshtml" />
|
||||
<None Include="Views\Home\FormShapes.cshtml" />
|
||||
<None Include="Views\Home\UsingShapes.cshtml" />
|
||||
|
||||
@@ -7,7 +7,10 @@ namespace Orchard.DevTools {
|
||||
}
|
||||
|
||||
public void Created(ShapeCreatedContext context) {
|
||||
context.Shape.Metadata.Wrappers.Add("ThinBorder");
|
||||
if (context.ShapeType != "Layout")
|
||||
context.Shape.Metadata.Wrappers.Add("ThinBorder");
|
||||
if (context.ShapeType == "Header")
|
||||
context.Shape.Metadata.Wrappers.Add("HackStyle");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<style>
|
||||
.thin-dotted-orange-border-with-a-little-padding {
|
||||
background:#FFF;
|
||||
border:1px dotted #CA7230;
|
||||
padding:5px;
|
||||
}
|
||||
.thin-dotted-orange-border-with-a-little-padding:hover {
|
||||
background:#E0E9EE;
|
||||
}
|
||||
</style>
|
||||
@Display(Model.Metadata.ChildContent)
|
||||
@@ -5,4 +5,4 @@
|
||||
var shapeTable = workContext.Resolve<IShapeTableManager>().GetShapeTable(workContext.CurrentTheme.ThemeName);
|
||||
var descriptor = shapeTable.Descriptors[Model.Metadata.Type];
|
||||
}
|
||||
<div class="thinborder" title="@Model.Metadata.Type @descriptor.BindingSource">@Display(Model.Metadata.ChildContent)</div>
|
||||
<div class="thin-dotted-orange-border-with-a-little-padding" title="@Model.Metadata.Type @descriptor.BindingSource">@Display(Model.Metadata.ChildContent)</div>
|
||||
Reference in New Issue
Block a user