mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user