#17791: List Admin UI uses Content Type name instead of DisplayName in "Add New" button

--HG--
branch : 1.x
This commit is contained in:
Suha Can
2011-05-09 13:32:25 -07:00
parent 72b34307be
commit a976b38388
2 changed files with 8 additions and 1 deletions

View File

@@ -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)

View File

@@ -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);