From 53520f1d32f19587a4761ebc880eeeb20ee87db4 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Fri, 23 Jul 2010 14:32:55 -0700 Subject: [PATCH] Giving page titles to the Contents Create and Edit pages and cleaning up the Orchard.ContentTypes type list a little --HG-- branch : dev --- .../Core/Contents/Views/Admin/Create.ascx | 2 +- .../Core/Contents/Views/Admin/Edit.ascx | 2 +- .../Views/DisplayTemplates/EditTypeViewModel.ascx | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/Create.ascx b/src/Orchard.Web/Core/Contents/Views/Admin/Create.ascx index 2ee3ca39a..22f4dad40 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/Create.ascx +++ b/src/Orchard.Web/Core/Contents/Views/Admin/Create.ascx @@ -1,6 +1,6 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <%@ Import Namespace="Orchard.Core.Contents.ViewModels" %> -<% Html.AddTitleParts(T("Create Content").ToString()); %> +

<%:Html.TitleForPage((string.IsNullOrEmpty(Model.Content.Item.TypeDefinition.DisplayName) ? T("Create Content") : T("Create {0}", Model.Content.Item.TypeDefinition.DisplayName)).ToString()) %>

<% using (Html.BeginFormAntiForgeryPost()) { %> <%:Html.ValidationSummary() %> <%:Html.EditorForItem(m=>m.Content) %> diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/Edit.ascx b/src/Orchard.Web/Core/Contents/Views/Admin/Edit.ascx index 222780461..e4b402c19 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/Edit.ascx +++ b/src/Orchard.Web/Core/Contents/Views/Admin/Edit.ascx @@ -1,6 +1,6 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <%@ Import Namespace="Orchard.Core.Contents.ViewModels" %> -

<%:Html.TitleForPage(T("Edit Content").ToString())%>

+

<%:Html.TitleForPage((string.IsNullOrEmpty(Model.Content.Item.TypeDefinition.DisplayName) ? T("Edit Content") : T("Edit {0}", Model.Content.Item.TypeDefinition.DisplayName)).ToString()) %>

<% using (Html.BeginFormAntiForgeryPost()) { %> <%:Html.ValidationSummary() %> <%:Html.EditorForItem(m=>m.Content) %> diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/EditTypeViewModel.ascx b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/EditTypeViewModel.ascx index d0b8456bf..2fd2cb025 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/EditTypeViewModel.ascx +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/EditTypeViewModel.ascx @@ -1,11 +1,17 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +<%@ Import Namespace="Orchard.Core.Contents.Settings" %>
-

<%:Model.DisplayName%>

-

<%:Html.ActionLink(T("Create a new {0}", Model.DisplayName).Text, "Create", new {area = "Contents", id = Model.Name}) %>

+

<%:Model.DisplayName%>

<% + var creatable = Model.Settings.GetModel().Creatable; + if (creatable) { %> +

<%:Html.ActionLink(T("Create a new {0}", Model.DisplayName).Text, "Create", new {area = "Contents", id = Model.Name}) %>

<% + } %>
- \ No newline at end of file