From dc5cc339a7a35f9c43970e49d97ac0a99c42e04e Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Thu, 14 Oct 2010 11:15:22 -0700 Subject: [PATCH] Getting Blogs onto the new UI composotion model --HG-- branch : dev --- .../BasicShapeTemplateHarvesterTests.cs | 5 +- src/Orchard.Web/Core/Common/Placement.info | 2 +- .../Views/Parts/Common.Body.Summary.cshtml | 2 +- .../Core/Contents/Drivers/ContentsDriver.cs | 2 +- src/Orchard.Web/Core/Contents/Placement.info | 4 +- src/Orchard.Web/Core/Contents/Shapes.cs | 6 ++ .../Drivers/LocalizationPartDriver.cs | 9 +-- .../Core/Localization/Placement.info | 7 +-- ...ization.ContentTranslations.Summary.cshtml | 18 +++++- ...on.ContentTranslations.SummaryAdmin.cshtml | 12 ---- src/Orchard.Web/Core/Orchard.Core.csproj | 1 - .../Views/Parts/PublishLater.Metadata.cshtml | 11 +++- .../Controllers/BlogAdminController.cs | 16 +++-- .../Controllers/BlogController.cs | 4 +- .../Controllers/BlogPostController.cs | 4 +- .../Orchard.Blogs/Drivers/BlogPartDriver.cs | 58 ++++++++----------- .../Orchard.Blogs/Orchard.Blogs.csproj | 49 ++++------------ .../Modules/Orchard.Blogs/Placement.info | 23 ++++++++ .../Orchard.Blogs/Views/BlogAdmin/List.cshtml | 17 +++++- ...g.Admin.cshtml => Blog.DetailAdmin.cshtml} | 5 +- .../Views/Items/Blog.Editor.cshtml | 6 ++ .../Views/Items/Blog.Summary.cshtml | 10 ++++ ...n.Blog.cshtml => Blog.SummaryAdmin.cshtml} | 31 ++++++---- .../{Content.Blog.cshtml => Blog.cshtml} | 0 .../BlogPost.Editor.cshtml} | 0 ...logPost.cshtml => BlogPost.Summary.cshtml} | 2 +- .../BlogPost.SummaryAdmin.cshtml} | 11 ++-- .../Orchard.Blogs/Views/Items/BlogPost.cshtml | 9 +++ .../Items/Content.Detail.BlogPost.cshtml | 3 - .../Views/Items/Content.Edit.Blog.cshtml | 4 -- .../Views/Items/Content.Summary.Blog.cshtml | 7 --- .../Views/Parts/Blogs.Blog.Description.cshtml | 6 +- .../Parts/Blogs.BlogPost.List.Admin.cshtml | 32 +++++----- .../Views/Parts/Blogs.BlogPost.List.cshtml | 6 +- .../Parts/Common.Body.Detail.BlogPost.cshtml | 1 - .../Parts/Common.Body.Summary.BlogPost.cshtml | 9 --- .../Parts/Common.Metadata.Admin.Blog.cshtml | 1 - .../Views/Parts/Common.Metadata.Blog.cshtml | 1 - .../Common.Metadata.Detail.BlogPost.cshtml | 5 -- ...ContentTranslations.Detail.BlogPost.cshtml | 13 ----- ...ontentTranslations.Summary.BlogPost.cshtml | 1 - ...blishLater.Metadata.Detail.BlogPost.cshtml | 1 - .../Tags.ShowTags.Detail.BlogPost.cshtml | 16 ----- .../Tags.ShowTags.Summary.BlogPost.cshtml | 16 ----- .../Drivers/CommentsPartDriver.cs | 2 +- .../Views/Parts/Comments.CountAdmin.cshtml | 8 +-- .../Orchard.Setup/Services/SetupService.cs | 1 + .../Modules/Orchard.Widgets/Shapes.cs | 2 +- 48 files changed, 216 insertions(+), 243 deletions(-) delete mode 100644 src/Orchard.Web/Core/Localization/Views/Parts/Localization.ContentTranslations.SummaryAdmin.cshtml create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Placement.info rename src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/{Content.Blog.Admin.cshtml => Blog.DetailAdmin.cshtml} (80%) create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.Editor.cshtml create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.Summary.cshtml rename src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/{Content.SummaryAdmin.Blog.cshtml => Blog.SummaryAdmin.cshtml} (50%) rename src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/{Content.Blog.cshtml => Blog.cshtml} (100%) rename src/Orchard.Web/Modules/Orchard.Blogs/Views/{Items_Content_Editor-BlogPost.cshtml => Items/BlogPost.Editor.cshtml} (100%) rename src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/{Content.Summary.BlogPost.cshtml => BlogPost.Summary.cshtml} (88%) rename src/Orchard.Web/Modules/Orchard.Blogs/Views/{Items_Content_SummaryAdmin_BlogPost.cshtml => Items/BlogPost.SummaryAdmin.cshtml} (75%) create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Detail.BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Edit.Blog.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Summary.Blog.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Body.Detail.BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Body.Summary.BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Admin.Blog.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Blog.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Detail.BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Localization.ContentTranslations.Detail.BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Localization.ContentTranslations.Summary.BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/PublishLater.Metadata.Detail.BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Tags.ShowTags.Detail.BlogPost.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Tags.ShowTags.Summary.BlogPost.cshtml diff --git a/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs b/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs index fc8b6770b..1ee81ae98 100644 --- a/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs +++ b/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Linq; using NUnit.Framework; using Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy; diff --git a/src/Orchard.Web/Core/Common/Placement.info b/src/Orchard.Web/Core/Common/Placement.info index 21436e027..dc0adb995 100644 --- a/src/Orchard.Web/Core/Common/Placement.info +++ b/src/Orchard.Web/Core/Common/Placement.info @@ -12,6 +12,6 @@ + Parts_Common_Metadata_SummaryAdmin="Meta:5"/> diff --git a/src/Orchard.Web/Core/Common/Views/Parts/Common.Body.Summary.cshtml b/src/Orchard.Web/Core/Common/Views/Parts/Common.Body.Summary.cshtml index 374c67cfc..aaa5edd12 100644 --- a/src/Orchard.Web/Core/Common/Views/Parts/Common.Body.Summary.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Parts/Common.Body.Summary.cshtml @@ -6,4 +6,4 @@ string bodyHtml = Model.Html.ToString(); var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString().Replace(Environment.NewLine, "

" + Environment.NewLine + "

")); } -

@body @Html.ItemDisplayLink(T("[more]").ToString(), contentItem)

+

@body @Html.ItemDisplayLink(T("[more]").ToString(), contentItem)

\ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs b/src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs index e3a23508a..5c25bcc7b 100644 --- a/src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs +++ b/src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs @@ -10,7 +10,7 @@ namespace Orchard.Core.Contents.Drivers { ContentShape("Parts_Contents_Publish_Summary", () => shapeHelper.Parts_Contents_Publish_Summary(ContentPart: part)), ContentShape("Parts_Contents_Publish_SummaryAdmin", - () => shapeHelper.Parts_Contents_Publish_SummaryAdmin(ContentPart: part)) + () => shapeHelper.Parts_Contents_Publish_SummaryAdmin(ContentPart: part)) ); } } diff --git a/src/Orchard.Web/Core/Contents/Placement.info b/src/Orchard.Web/Core/Contents/Placement.info index fb9e58af9..fa7c159b2 100644 --- a/src/Orchard.Web/Core/Contents/Placement.info +++ b/src/Orchard.Web/Core/Contents/Placement.info @@ -3,9 +3,9 @@ - + - + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Shapes.cs b/src/Orchard.Web/Core/Contents/Shapes.cs index 211ac3234..648ea96ee 100644 --- a/src/Orchard.Web/Core/Contents/Shapes.cs +++ b/src/Orchard.Web/Core/Contents/Shapes.cs @@ -8,9 +8,14 @@ namespace Orchard.Core.Contents { .OnDisplaying(displaying => { ContentItem contentItem = displaying.Shape.ContentItem; if (contentItem != null) { + //Content-BlogPost displaying.ShapeMetadata.Alternates.Add("Items_Content__" + contentItem.ContentType); + //Content-42 displaying.ShapeMetadata.Alternates.Add("Items_Content__" + contentItem.Id); + //Content.Summary displaying.ShapeMetadata.Alternates.Add("Items_Content_" + displaying.ShapeMetadata.DisplayType); + //Content.Summary-Page + displaying.ShapeMetadata.Alternates.Add("Items_Content_" + displaying.ShapeMetadata.DisplayType + "__" + contentItem.ContentType); } }); @@ -18,6 +23,7 @@ namespace Orchard.Core.Contents { .OnDisplaying(displaying => { ContentItem contentItem = displaying.Shape.ContentItem; if (contentItem != null) { + //Content.Editor-Page displaying.ShapeMetadata.Alternates.Add("Items_Content_Editor__" + contentItem.ContentType); } }); diff --git a/src/Orchard.Web/Core/Localization/Drivers/LocalizationPartDriver.cs b/src/Orchard.Web/Core/Localization/Drivers/LocalizationPartDriver.cs index 3173f8e1a..474db6700 100644 --- a/src/Orchard.Web/Core/Localization/Drivers/LocalizationPartDriver.cs +++ b/src/Orchard.Web/Core/Localization/Drivers/LocalizationPartDriver.cs @@ -22,13 +22,14 @@ namespace Orchard.Core.Localization.Drivers { } protected override DriverResult Display(LocalizationPart part, string displayType, dynamic shapeHelper) { + var masterId = part.MasterContentItem != null + ? part.MasterContentItem.Id + : part.Id; return Combined( ContentShape("Parts_Localization_ContentTranslations", - () => shapeHelper.Parts_Localization_ContentTranslations(ContentPart: part, Localizations: GetDisplayLocalizations(part))), + () => shapeHelper.Parts_Localization_ContentTranslations(ContentPart: part, MasterId: masterId, Localizations: GetDisplayLocalizations(part))), ContentShape("Parts_Localization_ContentTranslations_Summary", - () => shapeHelper.Parts_Localization_ContentTranslations_Summary(ContentPart: part, Localizations: GetDisplayLocalizations(part))), - ContentShape("Parts_Localization_ContentTranslations_SummaryAdmin", - () => shapeHelper.Parts_Localization_ContentTranslations_SummaryAdmin(ContentPart: part, Localizations: GetDisplayLocalizations(part))) + () => shapeHelper.Parts_Localization_ContentTranslations_Summary(ContentPart: part, MasterId: masterId, Localizations: GetDisplayLocalizations(part))) ); } diff --git a/src/Orchard.Web/Core/Localization/Placement.info b/src/Orchard.Web/Core/Localization/Placement.info index a440bbd01..94d16bb1b 100644 --- a/src/Orchard.Web/Core/Localization/Placement.info +++ b/src/Orchard.Web/Core/Localization/Placement.info @@ -1,14 +1,13 @@  - - + - + - + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Localization/Views/Parts/Localization.ContentTranslations.Summary.cshtml b/src/Orchard.Web/Core/Localization/Views/Parts/Localization.ContentTranslations.Summary.cshtml index b5d12a066..a7c4a7c45 100644 --- a/src/Orchard.Web/Core/Localization/Views/Parts/Localization.ContentTranslations.Summary.cshtml +++ b/src/Orchard.Web/Core/Localization/Views/Parts/Localization.ContentTranslations.Summary.cshtml @@ -1 +1,17 @@ -@model Orchard.Core.Localization.ViewModels.ContentLocalizationsViewModel +@using Orchard.Core.Contents; +@using Orchard.Core.Localization.Models; +@{ + Style.Require("LocalizationAdmin"); + IEnumerable localizations = Model.Localizations; + var localizationLinks = Html.UnorderedList(localizations, (c, i) => Html.ItemEditLink(c.Culture.Culture, c), "localizations"); +} +@if (localizations.Count() > 0 || AuthorizedFor(Permissions.PublishContent)) { +
+ @if (localizations.Count() > 0) { +

@T("Translations:")

@localizationLinks
+ } + @if (AuthorizedFor(Permissions.PublishContent)) { +
@Html.ActionLink(T("+ New translation").Text, "Translate", "Admin", new { area = "Localization", id = Model.MasterId }, null)
+ } +
+} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Localization/Views/Parts/Localization.ContentTranslations.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Localization/Views/Parts/Localization.ContentTranslations.SummaryAdmin.cshtml deleted file mode 100644 index e70a77955..000000000 --- a/src/Orchard.Web/Core/Localization/Views/Parts/Localization.ContentTranslations.SummaryAdmin.cshtml +++ /dev/null @@ -1,12 +0,0 @@ -@using Orchard.Core.Localization.Models; -@{ - Style.Require("LocalizationAdmin"); - IEnumerable localizations = Model.Localizations; - var localizationLinks = Html.UnorderedList(localizations, (c, i) => Html.ItemEditLink(c.Culture.Culture, c), "localizations"); -} -
- @if (localizations.Count() > 0) { -

@T("Translations:")

@localizationLinks
- } -
@Html.ActionLink(T("+ New translation").Text, "translate", "admin", new { area = "Localization", id = Model.MasterId }, null)
-
\ 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 d447398a5..d09542211 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -297,7 +297,6 @@ - diff --git a/src/Orchard.Web/Core/PublishLater/Views/Parts/PublishLater.Metadata.cshtml b/src/Orchard.Web/Core/PublishLater/Views/Parts/PublishLater.Metadata.cshtml index 8b6405dd7..be7e5bebd 100644 --- a/src/Orchard.Web/Core/PublishLater/Views/Parts/PublishLater.Metadata.cshtml +++ b/src/Orchard.Web/Core/PublishLater/Views/Parts/PublishLater.Metadata.cshtml @@ -1 +1,10 @@ -@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel \ No newline at end of file +@using Orchard.ContentManagement; +@using Orchard.Core.Common.Models; +@using Orchard.Core.PublishLater.Models; +@{ + PublishLaterPart publishLaterPart = Model.ContentPart; + DateTime? versionPublishedUtc = publishLaterPart.As() == null ? null : publishLaterPart.As().VersionPublishedUtc; +} +@if (publishLaterPart.IsPublished() && versionPublishedUtc.HasValue) { + @T("Published: {0}", Html.DateTimeRelative(versionPublishedUtc.Value, T)) +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs index 5d588442a..483af4134 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs @@ -58,11 +58,12 @@ namespace Orchard.Blogs.Controllers { [HttpPost, ActionName("Create")] public ActionResult CreatePOST() { - var blog = Services.ContentManager.New("Blog"); - + //TODO: (erikpo) Might think about moving this to an ActionFilter/Attribute if (!Services.Authorizer.Authorize(Permissions.ManageBlogs, T("Couldn't create blog"))) return new HttpUnauthorizedResult(); + var blog = Services.ContentManager.New("Blog"); + _contentManager.Create(blog, VersionOptions.Draft); var model = _contentManager.UpdateEditor(blog, this); @@ -83,7 +84,6 @@ namespace Orchard.Blogs.Controllers { if (!Services.Authorizer.Authorize(Permissions.ManageBlogs, T("Not allowed to edit blog"))) return new HttpUnauthorizedResult(); - //TODO: (erikpo) Move looking up the current blog up into a modelbinder var blog = _blogService.Get(blogSlug); if (blog == null) return new NotFoundResult(); @@ -94,10 +94,10 @@ namespace Orchard.Blogs.Controllers { [HttpPost, ActionName("Edit")] public ActionResult EditPOST(string blogSlug) { + //TODO: (erikpo) Might think about moving this to an ActionFilter/Attribute if (!Services.Authorizer.Authorize(Permissions.ManageBlogs, T("Couldn't edit blog"))) return new HttpUnauthorizedResult(); - //TODO: (erikpo) Move looking up the current blog up into a modelbinder var blog = _blogService.Get(blogSlug); if (blog == null) return new NotFoundResult(); @@ -113,10 +113,10 @@ namespace Orchard.Blogs.Controllers { [HttpPost] public ActionResult Remove(string blogSlug) { + //TODO: (erikpo) Might think about moving this to an ActionFilter/Attribute if (!Services.Authorizer.Authorize(Permissions.ManageBlogs, T("Couldn't delete blog"))) return new HttpUnauthorizedResult(); - //TODO: (erikpo) Move looking up the current blog up into a modelbinder BlogPart blogPart = _blogService.Get(blogSlug); if (blogPart == null) @@ -132,7 +132,7 @@ namespace Orchard.Blogs.Controllers { var list = Shape.List(); list.AddRange(_blogService.Get() .Select(b => { - var blog = Services.ContentManager.BuildDisplay(b, "SummaryAdmin.Blog"); + var blog = Services.ContentManager.BuildDisplay(b, "SummaryAdmin"); blog.TotalPostCount = _blogPostService.Get(b, VersionOptions.Latest).Count(); return blog; })); @@ -143,15 +143,13 @@ namespace Orchard.Blogs.Controllers { return View(viewModel); } - //TODO: (erikpo) Should move the slug parameter and get call and null check up into a model binder public ActionResult Item(string blogSlug) { BlogPart blogPart = _blogService.Get(blogSlug); if (blogPart == null) return new NotFoundResult(); - //TODO: (erikpo) Need to make templatePath be more convention based so if my controller name has "Admin" in it then "Admin/{type}" is assumed - var model = Services.ContentManager.BuildDisplay(blogPart, "Blog_Admin"); + var model = Services.ContentManager.BuildDisplay(blogPart, "DetailAdmin"); return View(model); } diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs index 61c82efa8..a226a5178 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs @@ -36,7 +36,7 @@ namespace Orchard.Blogs.Controllers { protected ILogger Logger { get; set; } public ActionResult List() { - var blogs = _blogService.Get().Select(b => _services.ContentManager.BuildDisplay(b, "Summary.Blog")); + var blogs = _blogService.Get().Select(b => _services.ContentManager.BuildDisplay(b, "Summary")); var list = Shape.List(); list.AddRange(blogs); @@ -59,7 +59,7 @@ namespace Orchard.Blogs.Controllers { if (blog == null) return new NotFoundResult(); - var blogPosts = _blogPostService.Get(blog, (page - 1)*pageSize, pageSize).Select(b => _services.ContentManager.BuildDisplay(b, "Summary.BlogPost")); + var blogPosts = _blogPostService.Get(blog, (page - 1)*pageSize, pageSize).Select(b => _services.ContentManager.BuildDisplay(b, "Summary")); var list = Shape.List(); list.AddRange(blogPosts); diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogPostController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogPostController.cs index 25dadf3e5..2b2b8a3d1 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogPostController.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogPostController.cs @@ -51,7 +51,7 @@ namespace Orchard.Blogs.Controllers { if (postPart == null) return new NotFoundResult(); - var model = _services.ContentManager.BuildDisplay(postPart, "Detail.BlogPost"); + var model = _services.ContentManager.BuildDisplay(postPart); return View(model); } @@ -66,7 +66,7 @@ namespace Orchard.Blogs.Controllers { var archive = new ArchiveData(archiveData); var list = Shape.List(); - list.AddRange(_blogPostService.Get(blogPart, archive).Select(b => _services.ContentManager.BuildDisplay(b, "Summary.BlogPost"))); + list.AddRange(_blogPostService.Get(blogPart, archive).Select(b => _services.ContentManager.BuildDisplay(b, "Summary"))); _feedManager.Register(blogPart); diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPartDriver.cs index 140c45da4..f3cb14478 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPartDriver.cs @@ -1,12 +1,10 @@ -using System.Collections.Generic; -using System.Linq; +using System.Linq; using JetBrains.Annotations; using Orchard.Blogs.Extensions; using Orchard.Blogs.Models; using Orchard.Blogs.Services; using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; -using Orchard.Core.ContentsLocation.Models; using Orchard.Core.Feeds; using Orchard.DisplayManagement; using Orchard.Localization; @@ -35,40 +33,32 @@ namespace Orchard.Blogs.Drivers { protected override string Prefix { get { return ""; } } protected override DriverResult Display(BlogPart part, string displayType, dynamic shapeHelper) { - var driverResults = new List(); - - var metadata = shapeHelper.Parts_Blogs_Blog_Manage(ContentPart: part); - driverResults.Add(ContentShape(metadata).Location("manage")); - - var description = shapeHelper.Parts_Blogs_Blog_Description(ContentPart: part); - driverResults.Add(ContentShape(description).Location("manage", "after")); - - if (displayType.StartsWith("Admin")) { - var list = shapeHelper.List(); - list.AddRange(_blogPostService.Get(part, VersionOptions.Latest) - .Select(bp => _contentManager.BuildDisplay(bp, "BlogPost_SummaryAdmin"))); - var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List_Admin(ContentPart: part, BlogPosts: list); - var contentShape = ContentShape(blogPostList).Location("Primary"); - driverResults.Add(contentShape); - } - else if (!displayType.Contains("Summary")) { - var list = shapeHelper.List(); - list.AddRange(_blogPostService.Get(part) - .Select(bp => _contentManager.BuildDisplay(bp, "BlogPost_Summary"))); - var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, BlogPosts: list); - var contentShape = ContentShape(blogPostList).Location("Primary"); - driverResults.Add(contentShape); - - _feedManager.Register(part); - } - - return Combined(driverResults.ToArray()); + return Combined( + ContentShape("Parts_Blogs_Blog_Manage", + () => shapeHelper.Parts_Blogs_Blog_Manage(ContentPart: part)), + ContentShape("Parts_Blogs_Blog_Description", + () => shapeHelper.Parts_Blogs_Blog_Description(ContentPart: part, Description: part.Description)), + ContentShape("Parts_Blogs_BlogPost_List", + () => { + _feedManager.Register(part); + var list = shapeHelper.List(); + list.AddRange(_blogPostService.Get(part) + .Select(bp => _contentManager.BuildDisplay(bp, "Summary"))); + return shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, ContentItems: list); + }), + ContentShape("Parts_Blogs_BlogPost_List_Admin", + () => { + var list = shapeHelper.List(); + list.AddRange(_blogPostService.Get(part, VersionOptions.Latest) + .Select(bp => _contentManager.BuildDisplay(bp, "SummaryAdmin"))); + return shapeHelper.Parts_Blogs_BlogPost_List_Admin(ContentPart: part, ContentItems: list); + }) + ); } protected override DriverResult Editor(BlogPart blogPart, dynamic shapeHelper) { - var location = blogPart.GetLocation("Editor"); - return Combined( - ContentPartTemplate(blogPart, "Parts/Blogs.Blog.Fields").Location(location)); + return ContentShape("Parts_Blogs_Blog_Fields", + () => shapeHelper.EditorTemplate(TemplateName: "Parts/Blogs.Blog.Fields", Model: blogPart, Prefix: Prefix)); } protected override DriverResult Editor(BlogPart blogPart, IUpdateModel updater, dynamic shapeHelper) { diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj index 3a5307772..98eaf1aa8 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj @@ -132,20 +132,15 @@ - Code - - - - - Code - - - - + + + + + @@ -159,38 +154,18 @@ Orchard.Core - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Designer + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info b/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info new file mode 100644 index 000000000..022d20e01 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/BlogAdmin/List.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/BlogAdmin/List.cshtml index f67493b8d..5ce61d2d0 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/BlogAdmin/List.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/BlogAdmin/List.cshtml @@ -1,8 +1,23 @@ @using Orchard.Blogs.Extensions; +@using Orchard.Core.Contents.ViewModels; +@using Orchard.Utility.Extensions;

@Html.TitleForPage(T("Manage Blogs").ToString())

@if (Model.ContentItems.Items.Count > 0) { -@Display(Model.ContentItems) + using(Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" }))) { +
+ + + @Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString()) + +
+
+ @Display(Model.ContentItems) +
+ } } else {
@T("There are no blogs for you to see. Want to add one?", Url.BlogCreate())
} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Blog.Admin.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.DetailAdmin.cshtml similarity index 80% rename from src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Blog.Admin.cshtml rename to src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.DetailAdmin.cshtml index 05a41787d..90868b616 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Blog.Admin.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.DetailAdmin.cshtml @@ -1,7 +1,6 @@ @using Orchard.Blogs.Extensions; @using Orchard.Blogs.Models;

@Html.TitleForPage((string)Model.Title)

-@Display(Model.manage) +@Display(Model.Manage) -@Display(Model.metadata) -@Display(Model.Primary) \ No newline at end of file +@Display(Model.Content) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.Editor.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.Editor.cshtml new file mode 100644 index 000000000..ca46e8462 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.Editor.cshtml @@ -0,0 +1,6 @@ +@using Orchard.Mvc.Html; +@{ + Html.AddTitleParts((string)Model.Title); +} +@Display(Model.Primary) +
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.Summary.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.Summary.cshtml new file mode 100644 index 000000000..f0d60c326 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.Summary.cshtml @@ -0,0 +1,10 @@ +@using Orchard.Blogs.Extensions; +@using Orchard.Blogs.Models; +

@Html.Link((string)Model.Title, Url.Blog((string)Model.Slug))

+ +@Display(Model.Content) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.SummaryAdmin.Blog.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.SummaryAdmin.cshtml similarity index 50% rename from src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.SummaryAdmin.Blog.cshtml rename to src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.SummaryAdmin.cshtml index d1a0549f8..035cd10fc 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.SummaryAdmin.Blog.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.SummaryAdmin.cshtml @@ -1,21 +1,28 @@ @using Orchard.Blogs.Extensions; @using Orchard.Blogs.Models; -
+@using Orchard.ContentManagement; +@using Orchard.Utility.Extensions; +@{ + ContentItem contentItem = Model.ContentItem; + var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString(); +} +
+
+ +

@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))

+ @if (Model.Meta != null) { + + } + @*

[list of authors] [modify blog access]

*@ +
-
-

@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))

-

@Display(Model.meta)

- @*

[list of authors] [modify blog access]

*@ -

@Model.Description

-
-
+ @if (Model.Content != null) { +
@Display(Model.Content)
+ }
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Blog.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.cshtml similarity index 100% rename from src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Blog.cshtml rename to src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Blog.cshtml diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items_Content_Editor-BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.Editor.cshtml similarity index 100% rename from src/Orchard.Web/Modules/Orchard.Blogs/Views/Items_Content_Editor-BlogPost.cshtml rename to src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.Editor.cshtml diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Summary.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.Summary.cshtml similarity index 88% rename from src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Summary.BlogPost.cshtml rename to src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.Summary.cshtml index e217cb228..92f0079ae 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Summary.BlogPost.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.Summary.cshtml @@ -5,4 +5,4 @@ @using Orchard.Core.Common.ViewModels;

@Html.Link((string)Model.Title, Url.BlogPost((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart))))

@Html.PublishedState(new CommonMetadataViewModel((CommonPart)Model.ContentItem.Get(typeof(CommonPart))), T) | @Display(Model.meta)
-
@Display(Model.Primary)
+
@Display(Model.Content)
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items_Content_SummaryAdmin_BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.SummaryAdmin.cshtml similarity index 75% rename from src/Orchard.Web/Modules/Orchard.Blogs/Views/Items_Content_SummaryAdmin_BlogPost.cshtml rename to src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.SummaryAdmin.cshtml index 4aaf65abc..7c191c172 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items_Content_SummaryAdmin_BlogPost.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.SummaryAdmin.cshtml @@ -6,17 +6,16 @@ ContentItem contentItem = Model.ContentItem; var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString(); } -

@Html.Link((string)Model.Title, Url.BlogPost((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart))))

- +
- +
@Display(Model.Content)
+
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.cshtml new file mode 100644 index 000000000..b1f6519a6 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.cshtml @@ -0,0 +1,9 @@ +

@Html.TitleForPage((string)Model.Title)

+@if (Model.Meta != null) { + +} +
+ @Display(Model.Content) +
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Detail.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Detail.BlogPost.cshtml deleted file mode 100644 index 7968e4f99..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Detail.BlogPost.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -

@Html.TitleForPage((string)Model.Title)

-@Display(Model.metadata) -@Display(Model.Primary) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Edit.Blog.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Edit.Blog.cshtml deleted file mode 100644 index 74e0ddef1..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Edit.Blog.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@Html.AddTitleParts(Model.Title) -@Display(Model.Primary) -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111 Content.Edit.Blog !!!!!!!!!!!!!!!!!!!!!!!!11 -
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Summary.Blog.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Summary.Blog.cshtml deleted file mode 100644 index abb445ea0..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content.Summary.Blog.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@using Orchard.Blogs.Extensions; -@using Orchard.Blogs.Models; -

@Html.Link((string)Model.Title, Url.Blog((string)Model.Slug))

-@if (!string.IsNullOrEmpty((string)Model.Description)) { -

@Model.Description

-} - diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.Blog.Description.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.Blog.Description.cshtml index 22b88120d..1610e4211 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.Blog.Description.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.Blog.Description.cshtml @@ -1,3 +1,5 @@ -
+@if (HasText(Model.Description)) { +

@Model.Description

-
\ No newline at end of file +
+} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.Admin.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.Admin.cshtml index 46fc0c33b..80ff6fefa 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.Admin.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.Admin.cshtml @@ -1,22 +1,22 @@ @using Orchard.Core.Contents.ViewModels; @using Orchard.Utility.Extensions; -@if (Model.Items.Count > 0) { +@if (Model.ContentItems.Items.Count > 0) { using (Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" }))) { -
- - - @Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString()) - -
-
-@Display(Model.BlogPosts) -
+
+ + + @Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString()) + +
+
+ @Display(Model.ContentItems) +
} } else { -
@T("There are no posts for this blog.")
+
@T("There are no posts for this blog.")
} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.cshtml index 115c06bc6..86506523a 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.cshtml @@ -1,7 +1,9 @@ @{ IEnumerable blogPosts = Model.BlogPosts; } -@Display(blogPosts) +@Display(ContentItems) @if (blogPosts == null || blogPosts.Count() < 1) {

@T("There are no posts for this blog.")

-} \ No newline at end of file +} + +hi \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Body.Detail.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Body.Detail.BlogPost.cshtml deleted file mode 100644 index 9ed89c7cc..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Body.Detail.BlogPost.cshtml +++ /dev/null @@ -1 +0,0 @@ -@Model.Html \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Body.Summary.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Body.Summary.BlogPost.cshtml deleted file mode 100644 index 9bf64b8b6..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Body.Summary.BlogPost.cshtml +++ /dev/null @@ -1,9 +0,0 @@ -@using Orchard.ContentManagement; -@using Orchard.Core.Common.ViewModels; -@*doing excerpt generation on the way out for now so we don't stick ourselves with needing to regen excerpts for existing data - also, doing this here, inline, until we have a pluggable processing model (both in and out) - also, ...this is ugly *@ -@{ - var body = new HtmlString(Html.Excerpt((string)Model.Html.ToString(), 200).ToString().Replace(Environment.NewLine, "

" + Environment.NewLine + "

")); -} -

@body @Html.ItemDisplayLink(T("[more]").ToString(), (IContent)Model.ContentPart.ContentItem)

diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Admin.Blog.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Admin.Blog.cshtml deleted file mode 100644 index 5f282702b..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Admin.Blog.cshtml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Blog.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Blog.cshtml deleted file mode 100644 index 5f282702b..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Blog.cshtml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Detail.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Detail.BlogPost.cshtml deleted file mode 100644 index 2f9b5fb4a..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Common.Metadata.Detail.BlogPost.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@using Orchard.Core.Common.Extensions; -@if (Model.Creator != null) { -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Localization.ContentTranslations.Detail.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Localization.ContentTranslations.Detail.BlogPost.cshtml deleted file mode 100644 index be4264423..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Localization.ContentTranslations.Detail.BlogPost.cshtml +++ /dev/null @@ -1,13 +0,0 @@ -@using Orchard.Core.Localization.Models; -@{ - Style.Require("Localization"); - IEnumerable localizations = Model.Localizations; -} -@if (localizations != null && localizations.Count() > 0) { -
-
-

@T("Translations:")

- @Html.UnorderedList(localizations, (c, i) => Html.ItemDisplayLink(c.Culture.Culture, c), "localizations") -
-
-} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Localization.ContentTranslations.Summary.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Localization.ContentTranslations.Summary.BlogPost.cshtml deleted file mode 100644 index 5f282702b..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Localization.ContentTranslations.Summary.BlogPost.cshtml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/PublishLater.Metadata.Detail.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/PublishLater.Metadata.Detail.BlogPost.cshtml deleted file mode 100644 index 5f282702b..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/PublishLater.Metadata.Detail.BlogPost.cshtml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Tags.ShowTags.Detail.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Tags.ShowTags.Detail.BlogPost.cshtml deleted file mode 100644 index 58e5dfab6..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Tags.ShowTags.Detail.BlogPost.cshtml +++ /dev/null @@ -1,16 +0,0 @@ -@{ - var tagsHtml = new List(); - foreach(var t in Model.Tags) { - if (tagsHtml.Any()) { - tagsHtml.Add(new HtmlString(", ")); - } - tagsHtml.Add(Html.ActionLink((string)t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = (string)t.TagName }, new { })); - } -} - -@if (tagsHtml.Any()) { -

- @T("Tags:") - @foreach(var htmlString in tagsHtml) { @htmlString } -

-} diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Tags.ShowTags.Summary.BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Tags.ShowTags.Summary.BlogPost.cshtml deleted file mode 100644 index 58e5dfab6..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Tags.ShowTags.Summary.BlogPost.cshtml +++ /dev/null @@ -1,16 +0,0 @@ -@{ - var tagsHtml = new List(); - foreach(var t in Model.Tags) { - if (tagsHtml.Any()) { - tagsHtml.Add(new HtmlString(", ")); - } - tagsHtml.Add(Html.ActionLink((string)t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = (string)t.TagName }, new { })); - } -} - -@if (tagsHtml.Any()) { -

- @T("Tags:") - @foreach(var htmlString in tagsHtml) { @htmlString } -

-} diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Drivers/CommentsPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Comments/Drivers/CommentsPartDriver.cs index ecf9e25a5..41b121c31 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Drivers/CommentsPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Comments/Drivers/CommentsPartDriver.cs @@ -12,7 +12,7 @@ namespace Orchard.Comments.Drivers { return null; if (displayType.StartsWith("Detail")) - return ContentShape(shapeHelper.Parts_Comments_Comments(ContentPart: part)).Location(part.GetLocation("Detail")); + return ContentShape(shapeHelper.Parts_Comments_Comments(ContentPart: part)).Location("Content:10"); if (displayType == "SummaryAdmin") return ContentShape(shapeHelper.Parts_Comments_CountAdmin(ContentPart: part, CommentCount: part.Comments.Count, PendingCount: part.PendingComments.Count)) diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.CountAdmin.cshtml b/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.CountAdmin.cshtml index 26bc8188d..fe9da4ea3 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.CountAdmin.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.CountAdmin.cshtml @@ -1,5 +1,5 @@ -@model Orchard.Comments.ViewModels.CommentCountViewModel -@using Orchard.Comments.ViewModels; +@using Orchard.Comments.Models; @using Orchard.Comments.Extensions; - -@Html.CommentSummaryLinks(T, Model.Item, Model.CommentCount, Model.PendingCount) +@using Orchard.Comments.ViewModels; +@using Orchard.ContentManagement; +@Html.CommentSummaryLinks(T, (ContentItem)Model.ContentPart.ContentItem, (int)Model.CommentCount, (int)Model.PendingCount) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs b/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs index 0f26916d1..263f5c884 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs @@ -229,6 +229,7 @@ namespace Orchard.Setup.Services { htmlWidget.As().Zone = "Content"; htmlWidget.As().Position = "5"; htmlWidget.As().Text = "

Congratulations, you've successfully set-up your Orchard site.

This is the home page of your new site. We've taken the liberty to write here about a few things you could look at next in order to get familiar with the application. Once you feel confident you don't need this anymore, just click Edit to go into edit mode and replace this with whatever you want on your home page to make it your own.

One thing you could do (but you don't have to) is go into Manage Settings (follow the Admin link and then look for it under \"Settings\" in the menu on the left) and check that everything is configured the way you want.

You probably want to make the site your own. One of the ways you can do that is by clicking Manage Themes in the admin menu. A theme is a packaged look and feel that affects the whole site.

Next, you can start playing with the content types that we installed. For example, go ahead and click Add New Page in the admin menu and create an \"about\" page. Then, add it to the navigation menu by going to Manage Menu. You can also click Add New Blog and start posting by clicking \"Add New Post\".

Finally, Orchard has been designed to be extended. It comes with a few built-in modules such as pages and blogs or themes. You can install new themes by going to Manage Themes and clicking Install a new Theme. Like for themes, modules are created by other users of Orchard just like you so if you feel up to it, please consider participating.

--The Orchard Crew

"; + htmlWidget.As().Owner = user; contentManager.Publish(htmlWidget); // and three more for the third aside...really need this elsewhere... diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs index 2789f5d1b..750c10a2b 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs @@ -29,7 +29,7 @@ namespace Orchard.Widgets { var zoneName = contentItem.As().Zone; displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + contentItem.ContentType); displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + zoneName); - //...would like... + //...would like...if '__' was collapsible //displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + zoneName + "__" + contentItem.ContentType); } });