mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +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();
|
||||
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()
|
||||
.ContentItems(list)
|
||||
.Pager(pagerShape)
|
||||
@@ -100,6 +106,7 @@ namespace Lists.Controllers {
|
||||
.ContainerDisplayName(model.ContainerDisplayName)
|
||||
.HasRestriction(hasRestriction)
|
||||
.ContainerContentType(container.ContentType)
|
||||
.ContainerItemContentDisplayName(containerItemContentDisplayName)
|
||||
.ContainerItemContentType(hasRestriction ? restrictedContentType : (model.FilterByContentType ?? ""))
|
||||
.OtherLists(_contentManager.Query<ContainerPart>(VersionOptions.Latest).List()
|
||||
.Select(part => part.ContentItem)
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
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);
|
||||
|
||||
|
Reference in New Issue
Block a user