mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 11:44:41 +08:00
#17791: List Admin UI uses Content Type name instead of DisplayName in "Add New" button
--HG-- branch : 1.x
This commit is contained in:
@@ -92,6 +92,12 @@ namespace Lists.Controllers {
|
|||||||
var list = Shape.List();
|
var list = Shape.List();
|
||||||
list.AddRange(pageOfContentItems.Select(ci => _contentManager.BuildDisplay(ci, "SummaryAdmin")));
|
list.AddRange(pageOfContentItems.Select(ci => _contentManager.BuildDisplay(ci, "SummaryAdmin")));
|
||||||
|
|
||||||
|
var containerItemContentDisplayName = String.Empty;
|
||||||
|
if (hasRestriction)
|
||||||
|
containerItemContentDisplayName = _contentDefinitionManager.GetTypeDefinition(restrictedContentType).DisplayName;
|
||||||
|
else if (!string.IsNullOrEmpty(model.FilterByContentType))
|
||||||
|
containerItemContentDisplayName = _contentDefinitionManager.GetTypeDefinition(model.FilterByContentType).DisplayName;
|
||||||
|
|
||||||
dynamic viewModel = Shape.ViewModel()
|
dynamic viewModel = Shape.ViewModel()
|
||||||
.ContentItems(list)
|
.ContentItems(list)
|
||||||
.Pager(pagerShape)
|
.Pager(pagerShape)
|
||||||
@@ -100,6 +106,7 @@ namespace Lists.Controllers {
|
|||||||
.ContainerDisplayName(model.ContainerDisplayName)
|
.ContainerDisplayName(model.ContainerDisplayName)
|
||||||
.HasRestriction(hasRestriction)
|
.HasRestriction(hasRestriction)
|
||||||
.ContainerContentType(container.ContentType)
|
.ContainerContentType(container.ContentType)
|
||||||
|
.ContainerItemContentDisplayName(containerItemContentDisplayName)
|
||||||
.ContainerItemContentType(hasRestriction ? restrictedContentType : (model.FilterByContentType ?? ""))
|
.ContainerItemContentType(hasRestriction ? restrictedContentType : (model.FilterByContentType ?? ""))
|
||||||
.OtherLists(_contentManager.Query<ContainerPart>(VersionOptions.Latest).List()
|
.OtherLists(_contentManager.Query<ContainerPart>(VersionOptions.Latest).List()
|
||||||
.Select(part => part.ContentItem)
|
.Select(part => part.ContentItem)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
int containerId = ((int?)Model.ContainerId).GetValueOrDefault();
|
int containerId = ((int?)Model.ContainerId).GetValueOrDefault();
|
||||||
|
|
||||||
string createLinkText = string.IsNullOrEmpty(Model.ContainerItemContentType) ? T("Create New Content").ToString() : T("Create New {0}", Model.ContainerItemContentType).ToString();
|
string createLinkText = string.IsNullOrEmpty(Model.ContainerItemContentDisplayName) ? T("Create New Content").ToString() : T("Create New {0}", Model.ContainerItemContentDisplayName).ToString();
|
||||||
|
|
||||||
Layout.Title = T("Manage {0}", Model.ContainerDisplayName);
|
Layout.Title = T("Manage {0}", Model.ContainerDisplayName);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user