diff --git a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs index 4f64ce71c..43eeaa005 100644 --- a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs @@ -198,7 +198,13 @@ namespace Orchard.Core.Contents.Controllers { } ActionResult CreatableTypeList() { - return View(Shape.Model(Types: GetCreatableTypes())); + var list = Shape.List(); + list.AddRange(GetCreatableTypes()); + + var viewModel = Shape.ViewModel() + .ContentTypes(list); + + return View("CreatableTypeList", viewModel); } public ActionResult Create(string id) { diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.ascx b/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.ascx deleted file mode 100644 index ba257fa50..000000000 --- a/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.ascx +++ /dev/null @@ -1,7 +0,0 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> -<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %> -

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

-<%:Html.UnorderedList( - Model.Types, - (ctd, i) => MvcHtmlString.Create(string.Format("

{0}

", Html.ActionLink(ctd.DisplayName, "Create", new { Area = "Contents", Id = ctd.Name }))), - "contentTypes")%> \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.cshtml new file mode 100644 index 000000000..55d6b76e3 --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.cshtml @@ -0,0 +1,4 @@ +

@Html.TitleForPage(T("Create New Content").ToString())

+@foreach (var type in Model.ContentTypes) { +

@Html.ActionLink((string)type.DisplayName, "Create", new { Area = "Contents", Id = (string)type.Name })

+} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml index 7bc3cc4e0..8eecd5e1c 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml @@ -1,4 +1,9 @@ +@{ + var typeDisplayName = Model.ContentItem.TypeDefinition.DisplayName; + var pageTitle = T("Create {0}", typeDisplayName); +} +

@Html.TitleForPage((string)pageTitle.Text)

@using (Html.BeginFormAntiForgeryPost()) { @Html.ValidationSummary() @Display(Model) -} +} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml index 35029fb4f..8f298bbb4 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml @@ -5,9 +5,8 @@ pageTitle = T("Edit {0}", typeDisplayName); } } -

@Html.TitleForPage(pageTitle)

@using (Html.BeginFormAntiForgeryPost()) { @Html.ValidationSummary() @Display(Model) -} +} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml index e98023929..48443cf55 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml @@ -1,8 +1,16 @@ @using Orchard.Core.Contents.ViewModels -

@//Html.TitleForPage((string.IsNullOrEmpty(Model.TypeDisplayName) ? T("Manage Content") : T("Manage {0} Content", Model.TypeDisplayName)).ToString()) -

+@{ + var typeDisplayName = Model.TypeDisplayName; + var pageTitle = T("Manage Content"); + var createLinkText = T("Create New Content"); + if (!string.IsNullOrWhiteSpace(typeDisplayName)) { + pageTitle = T("Manage {0} Content", typeDisplayName); + createLinkText = T("Create New {0}", typeDisplayName); + } +} +

@Html.TitleForPage(pageTitle)

- @Html.ActionLink((string)(!string.IsNullOrEmpty((string)Model.TypeDisplayName) ? T("Create New {0}", Model.TypeDisplayName).Text : T("Create New Content").Text), "Create", null, new { @class = "button primaryAction" }) + @Html.ActionLink(createLinkText.Text, "Create", new { Area = "Contents", Id = (string)Model.Options.SelectedFilter }, new { @class = "button primaryAction" })
@using (Html.BeginFormAntiForgeryPost()) {
@@ -20,7 +28,7 @@ diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content-HomePage.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content-HomePage.cshtml deleted file mode 100644 index 29372907c..000000000 --- a/src/Orchard.Web/Core/Contents/Views/Items/Content-HomePage.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@{ - //home page content - should fall back to items/content so this template is optional (e.g. in a theme) -} -
-
-@Display(Model.Header) -
-
-@Display(Model.primary) -
-
\ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml index 250d662ca..f6850e19e 100644 --- a/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml @@ -4,7 +4,6 @@ ContentItem contentItem = Model.ContentItem; var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString(); } -
@@ -17,4 +16,4 @@
@Display(Model.meta)
@Display(Model.primary)
-
+ \ No newline at end of file diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index 45d7c20a5..69a853366 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -279,7 +279,7 @@ - + @@ -288,7 +288,6 @@ - diff --git a/src/Orchard.Web/Core/Routable/Handlers/RoutePartHandler.cs b/src/Orchard.Web/Core/Routable/Handlers/RoutePartHandler.cs index 6dd7faca1..56324b327 100644 --- a/src/Orchard.Web/Core/Routable/Handlers/RoutePartHandler.cs +++ b/src/Orchard.Web/Core/Routable/Handlers/RoutePartHandler.cs @@ -62,6 +62,7 @@ namespace Orchard.Core.Routable.Handlers { public override void GetContentItemMetadata(GetContentItemMetadataContext context) { var routable = context.ContentItem.As(); if (routable != null) { + context.Metadata.DisplayText = routable.Title; context.Metadata.DisplayRouteValues = new RouteValueDictionary { {"Area", "Routable"}, {"Controller", "Item"}, diff --git a/src/Orchard.Web/Core/Shapes/Views/Menu.cshtml.rej b/src/Orchard.Web/Core/Shapes/Views/Menu.cshtml.rej deleted file mode 100644 index 8a22339e6..000000000 --- a/src/Orchard.Web/Core/Shapes/Views/Menu.cshtml.rej +++ /dev/null @@ -1,12 +0,0 @@ ---- Menu.cshtml -+++ Menu.cshtml -@@ -1,3 +1,8 @@ --