mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Getting Blogs onto the new UI composotion model
--HG-- branch : dev
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -12,6 +12,6 @@
|
||||
</Match>
|
||||
<Match DisplayType="SummaryAdmin">
|
||||
<Place Parts_Common_Body_Summary="-"
|
||||
Parts_PublishLater_Metadata_SummaryAdmin="Metadata:1"/>
|
||||
Parts_Common_Metadata_SummaryAdmin="Meta:5"/>
|
||||
</Match>
|
||||
</Placement>
|
||||
|
@@ -6,4 +6,4 @@
|
||||
string bodyHtml = Model.Html.ToString();
|
||||
var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString().Replace(Environment.NewLine, "</p>" + Environment.NewLine + "<p>"));
|
||||
}
|
||||
<p>@body @Html.ItemDisplayLink(T("[more]").ToString(), contentItem)</p>
|
||||
<p>@body @Html.ItemDisplayLink(T("[more]").ToString(), contentItem)</p>
|
@@ -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))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -3,9 +3,9 @@
|
||||
<Place Parts_Contents_Publish_Summary="-"/>
|
||||
<Place Parts_Contents_Publish_SummaryAdmin="-"/>
|
||||
<Match DisplayType="Detail">
|
||||
<Place Parts_Contents_Publish="Primary:5"/>
|
||||
<Place Parts_Contents_Publish="Content:5"/>
|
||||
</Match>
|
||||
<Match DisplayType="SummaryAdmin">
|
||||
<Place Parts_Contents_Publish_SummaryAdmin="Secondary:5"/>
|
||||
<Place Parts_Contents_Publish_SummaryAdmin="Related:5"/>
|
||||
</Match>
|
||||
</Placement>
|
@@ -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);
|
||||
}
|
||||
});
|
||||
|
@@ -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)))
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -1,14 +1,13 @@
|
||||
<Placement>
|
||||
<Place Parts_Localization_ContentTranslations="-"/>
|
||||
<Place Parts_Localization_ContentTranslations_Summary="-"/>
|
||||
<Place Parts_Localization_ContentTranslations_SummaryAdmin="-"/>
|
||||
<Match DisplayType="Detail">
|
||||
<Place Parts_Localization_ContentTranslations="Primary:5"/>
|
||||
<Place Parts_Localization_ContentTranslations="Content:before.5"/>
|
||||
</Match>
|
||||
<Match DisplayType="Summary">
|
||||
<Place Parts_Localization_ContentTranslations_Summary="Primary:5"/>
|
||||
<Place Parts_Localization_ContentTranslations_Summary="Content:after.5"/>
|
||||
</Match>
|
||||
<Match DisplayType="SummaryAdmin">
|
||||
<Place Parts_Localization_ContentTranslations_SummaryAdmin="Primary:5"/>
|
||||
<Place Parts_Localization_ContentTranslations_Summary="Content:after.5"/>
|
||||
</Match>
|
||||
</Placement>
|
@@ -1 +1,17 @@
|
||||
@model Orchard.Core.Localization.ViewModels.ContentLocalizationsViewModel
|
||||
@using Orchard.Core.Contents;
|
||||
@using Orchard.Core.Localization.Models;
|
||||
@{
|
||||
Style.Require("LocalizationAdmin");
|
||||
IEnumerable<LocalizationPart> localizations = Model.Localizations;
|
||||
var localizationLinks = Html.UnorderedList(localizations, (c, i) => Html.ItemEditLink(c.Culture.Culture, c), "localizations");
|
||||
}
|
||||
@if (localizations.Count() > 0 || AuthorizedFor(Permissions.PublishContent)) {
|
||||
<div class="content-localization">
|
||||
@if (localizations.Count() > 0) {
|
||||
<div class="content-localizations"><h4>@T("Translations:")</h4>@localizationLinks</div>
|
||||
}
|
||||
@if (AuthorizedFor(Permissions.PublishContent)) {
|
||||
<div class="add-localization">@Html.ActionLink(T("+ New translation").Text, "Translate", "Admin", new { area = "Localization", id = Model.MasterId }, null)</div>
|
||||
}
|
||||
</div>
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
@using Orchard.Core.Localization.Models;
|
||||
@{
|
||||
Style.Require("LocalizationAdmin");
|
||||
IEnumerable<LocalizationPart> localizations = Model.Localizations;
|
||||
var localizationLinks = Html.UnorderedList(localizations, (c, i) => Html.ItemEditLink(c.Culture.Culture, c), "localizations");
|
||||
}
|
||||
<div class="content-localization">
|
||||
@if (localizations.Count() > 0) {
|
||||
<div class="content-localizations"><h4>@T("Translations:")</h4>@localizationLinks</div>
|
||||
}
|
||||
<div class="add-localization">@Html.ActionLink(T("+ New translation").Text, "translate", "admin", new { area = "Localization", id = Model.MasterId }, null)</div>
|
||||
</div>
|
@@ -297,7 +297,6 @@
|
||||
<Content Include="Reports\Views\Admin\Index.cshtml" />
|
||||
<Content Include="Localization\Module.txt" />
|
||||
<Content Include="Localization\Views\Admin\Translate.cshtml" />
|
||||
<Content Include="Localization\Views\Parts\Localization.ContentTranslations.SummaryAdmin.cshtml" />
|
||||
<Content Include="Localization\Views\CultureSelection.cshtml" />
|
||||
<Content Include="Routable\Module.txt" />
|
||||
<Content Include="Routable\Scripts\jquery.slugify.js" />
|
||||
|
@@ -1 +1,10 @@
|
||||
@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Common.Models;
|
||||
@using Orchard.Core.PublishLater.Models;
|
||||
@{
|
||||
PublishLaterPart publishLaterPart = Model.ContentPart;
|
||||
DateTime? versionPublishedUtc = publishLaterPart.As<CommonPart>() == null ? null : publishLaterPart.As<CommonPart>().VersionPublishedUtc;
|
||||
}
|
||||
@if (publishLaterPart.IsPublished() && versionPublishedUtc.HasValue) {
|
||||
@T("Published: {0}", Html.DateTimeRelative(versionPublishedUtc.Value, T))
|
||||
}
|
@@ -58,11 +58,12 @@ namespace Orchard.Blogs.Controllers {
|
||||
|
||||
[HttpPost, ActionName("Create")]
|
||||
public ActionResult CreatePOST() {
|
||||
var blog = Services.ContentManager.New<BlogPart>("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<BlogPart>("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);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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<DriverResult>();
|
||||
|
||||
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) {
|
||||
|
@@ -132,20 +132,15 @@
|
||||
<Content Include="Views\Blog\List.cshtml" />
|
||||
<Content Include="Views\Parts\Blogs.Blog.Manage.cshtml" />
|
||||
<Content Include="Views\Parts\Blogs.Blog.Description.cshtml" />
|
||||
<Content Include="Views\Parts\Common.Metadata.Admin.Blog.cshtml" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Blogs.Blog.Fields.cshtml" />
|
||||
<Content Include="Views\Parts\Blogs.BlogPost.List.Admin.cshtml">
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
<Content Include="Views\Items\Content.Blog.Admin.cshtml" />
|
||||
<Content Include="Views\Items\Content.Blog.cshtml" />
|
||||
<Content Include="Views\Items\Content.Detail.BlogPost.cshtml" />
|
||||
<Content Include="Views\Items\Content.Edit.Blog.cshtml">
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
<Content Include="Views\Items\Content.Summary.Blog.cshtml" />
|
||||
<Content Include="Views\Items\Content.Summary.BlogPost.cshtml" />
|
||||
<Content Include="Views\Items\Content.SummaryAdmin.Blog.cshtml" />
|
||||
<Content Include="Views\Items\Blog.cshtml" />
|
||||
<Content Include="Views\Items\BlogPost.cshtml" />
|
||||
<Content Include="Views\Items\Blog.Summary.cshtml" />
|
||||
<Content Include="Views\Items\BlogPost.Summary.cshtml" />
|
||||
<Content Include="Views\Items\Blog.SummaryAdmin.cshtml" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
@@ -159,38 +154,18 @@
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Common.Metadata.Blog.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Localization.ContentTranslations.Summary.BlogPost.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Common.Body.Summary.BlogPost.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Tags.ShowTags.Summary.BlogPost.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\PublishLater.Metadata.Detail.BlogPost.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Common.Metadata.Detail.BlogPost.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Localization.ContentTranslations.Detail.BlogPost.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Common.Body.Detail.BlogPost.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Tags.ShowTags.Detail.BlogPost.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App_Data\Localization\fr-FR\orchard.module.po" />
|
||||
<None Include="Placement.info">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Views\DisplayTemplates\Parts\Blogs.BlogArchives.cshtml" />
|
||||
<None Include="Views\EditorTemplates\Parts\Blogs.RecentBlogPosts.cshtml" />
|
||||
<None Include="Views\EditorTemplates\Parts\Blogs.BlogArchives.cshtml" />
|
||||
<None Include="Views\Items\Blog.DetailAdmin.cshtml" />
|
||||
<None Include="Views\Items\Blog.Editor.cshtml" />
|
||||
<None Include="Views\Items\BlogPost.Editor.cshtml" />
|
||||
<None Include="Views\Items\BlogPost.SummaryAdmin.cshtml" />
|
||||
<None Include="Views\Parts\Blogs.BlogPost.List.cshtml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
|
23
src/Orchard.Web/Modules/Orchard.Blogs/Placement.info
Normal file
23
src/Orchard.Web/Modules/Orchard.Blogs/Placement.info
Normal file
@@ -0,0 +1,23 @@
|
||||
<Placement>
|
||||
<Place Parts_Blogs_Blog_Manage="-"/>
|
||||
<Place Parts_Blogs_Blog_Description="-"/>
|
||||
<Place Parts_Blogs_BlogPost_List="-"/>
|
||||
<Place Parts_Blogs_BlogPost_List_Admin="-"/>
|
||||
<Place Parts_Blogs_Blog_Fields="Primary:2"/>
|
||||
<Match ContentType="Blog">
|
||||
<Match DisplayType="Detail">
|
||||
<Place Parts_Blogs_BlogPost_List="Content:5" />
|
||||
</Match>
|
||||
<Match DisplayType="DetailAdmin">
|
||||
<Place Parts_Blogs_BlogPost_List_Admin="Content:5"
|
||||
Parts_Blogs_Blog_Manage="Manage"
|
||||
Parts_Blogs_Blog_Description="Manage:after"/>
|
||||
</Match>
|
||||
<Match DisplayType="Summary">
|
||||
<Place Parts_Blogs_Blog_Description="Content:before"/>
|
||||
</Match>
|
||||
<Match DisplayType="SummaryAdmin">
|
||||
<Place Parts_Blogs_Blog_Description="Content:before"/>
|
||||
</Match>
|
||||
</Match>
|
||||
</Placement>
|
@@ -1,8 +1,23 @@
|
||||
@using Orchard.Blogs.Extensions;
|
||||
@using Orchard.Core.Contents.ViewModels;
|
||||
@using Orchard.Utility.Extensions;
|
||||
<h1>@Html.TitleForPage(T("Manage Blogs").ToString())</h1>
|
||||
@if (Model.ContentItems.Items.Count > 0) {
|
||||
<div class="actions"><a class="add button primaryAction" href="@Url.BlogCreate()">@T("New Blog")</a></div>
|
||||
@Display(Model.ContentItems)
|
||||
using(Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" }))) {
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="publishActions">@T("Actions:")</label>
|
||||
<select id="publishActions" name="Options.BulkAction">
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.None, T("Choose action...").ToString())
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.Remove, T("Remove").ToString())
|
||||
</select>
|
||||
@Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString())
|
||||
<button type="submit" name="submit.BulkEdit" value="yes">@T("Apply")</button>
|
||||
</fieldset>
|
||||
<fieldset class="contentItems bulk-items">
|
||||
@Display(Model.ContentItems)
|
||||
</fieldset>
|
||||
}
|
||||
} else {
|
||||
<div class="info message">@T("There are no blogs for you to see. Want to <a href=\"{0}\">add one</a>?", Url.BlogCreate())</div>
|
||||
}
|
@@ -1,7 +1,6 @@
|
||||
@using Orchard.Blogs.Extensions;
|
||||
@using Orchard.Blogs.Models;
|
||||
<h1><a href="@Url.BlogForAdmin((string)Model.Slug)">@Html.TitleForPage((string)Model.Title)</a></h1>
|
||||
@Display(Model.manage)
|
||||
@Display(Model.Manage)
|
||||
<div class="manage"><a href="@Url.BlogPostCreate((BlogPart)Model.ContentItem.Get(typeof(BlogPart)))" class="add button primaryAction">@T("New Post")</a></div>
|
||||
@Display(Model.metadata)
|
||||
@Display(Model.Primary)
|
||||
@Display(Model.Content)
|
@@ -0,0 +1,6 @@
|
||||
@using Orchard.Mvc.Html;
|
||||
@{
|
||||
Html.AddTitleParts((string)Model.Title);
|
||||
}
|
||||
@Display(Model.Primary)
|
||||
<fieldset><input class="button primaryAction" type="submit" value="@T("Add")" /></fieldset>
|
@@ -0,0 +1,10 @@
|
||||
@using Orchard.Blogs.Extensions;
|
||||
@using Orchard.Blogs.Models;
|
||||
<h2>@Html.Link((string)Model.Title, Url.Blog((string)Model.Slug))</h2>
|
||||
<div class="blog metadata">
|
||||
@T.Plural("1 post", "{0} posts", (int)Model.PostCount)
|
||||
@if (Model.Meta != null) {
|
||||
@T(" | ")@Display(Model.Meta)
|
||||
}
|
||||
</div>
|
||||
@Display(Model.Content)
|
@@ -1,21 +1,28 @@
|
||||
@using Orchard.Blogs.Extensions;
|
||||
@using Orchard.Blogs.Models;
|
||||
<div class="summary">
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Utility.Extensions;
|
||||
@{
|
||||
ContentItem contentItem = Model.ContentItem;
|
||||
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||
}
|
||||
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
|
||||
<div class="properties">
|
||||
<input type="checkbox" value="@contentItem.Id" name="itemIds"/>
|
||||
<h3>@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))</h3>
|
||||
@if (Model.Meta != null) {
|
||||
<div class="metadata">@Display(Model.Meta)</div>
|
||||
}
|
||||
@* <p>[list of authors] [modify blog access]</p> *@
|
||||
</div>
|
||||
<div class="related">
|
||||
<a href="@Url.Blog((string)Model.Slug)" title="@T("View")">@T("View")</a>@T(" | ")
|
||||
<a href="@Url.BlogForAdmin((string)Model.Slug)" title="@T("List Posts")">@T("List Posts")</a>@T(" | ")
|
||||
<a href="@Url.BlogPostCreate((BlogPart)Model.ContentItem.Get(typeof(BlogPart)))" title="@T("New Post")">@T("New Post")</a>@T(" | ")
|
||||
<a href="@Url.BlogEdit((string)Model.Slug)" title="@T("Edit")">@T("Edit")</a>@T(" | ")
|
||||
@* todo: (heskew) this is a bit too verbose. need template helpers for all ibuttons *@
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.BlogRemove((string)Model.Slug), FormMethod.Post, new { @class = "inline link" })) {
|
||||
<button type="submit" class="linkButton" title="@T("Remove")">@T("Remove")</button>
|
||||
}
|
||||
<a href="Url.BlogRemove((string)Model.Slug)" title="@T("Remove")" itemprop="RemoveUrl UnsafeUrl">@T("Remove")</a>
|
||||
</div>
|
||||
<div class="properties">
|
||||
<h3>@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))</h3>
|
||||
<p>@Display(Model.meta)</p>
|
||||
@* <p>[list of authors] [modify blog access]</p> *@
|
||||
<p>@Model.Description</p>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
@if (Model.Content != null) {
|
||||
<div class="primary">@Display(Model.Content)</div>
|
||||
}
|
||||
</div>
|
@@ -5,4 +5,4 @@
|
||||
@using Orchard.Core.Common.ViewModels;
|
||||
<h2>@Html.Link((string)Model.Title, Url.BlogPost((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart))))</h2>
|
||||
<div class="meta">@Html.PublishedState(new CommonMetadataViewModel((CommonPart)Model.ContentItem.Get(typeof(CommonPart))), T) | @Display(Model.meta)</div>
|
||||
<div class="content">@Display(Model.Primary)</div>
|
||||
<div class="content">@Display(Model.Content)</div>
|
@@ -6,17 +6,16 @@
|
||||
ContentItem contentItem = Model.ContentItem;
|
||||
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||
}
|
||||
|
||||
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
|
||||
<div class="properties">
|
||||
<input type="checkbox" value="@contentItem.Id" name="itemIds"/>
|
||||
<h3>@Html.Link((string)Model.Title, Url.BlogPost((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart))))</h3>
|
||||
<div class="metadata">@Display(Model.metadata)</div>
|
||||
<div class="metadata">@Display(Model.Meta)</div> <!-- was: metadata -->
|
||||
</div>
|
||||
<div class="related">@Display(Model.secondary)
|
||||
<div class="related">@Display(Model.Related) <!-- was: secondary -->
|
||||
@Html.Link(T("Edit").Text, Url.BlogPost((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart)))) @T(" | ")
|
||||
@Html.Link(T("Remove").Text, Url.Action("Remove", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl }), new { itemprop = "RemoveUrl UnsafeUrl" })
|
||||
<br />@Display(Model.meta)
|
||||
<br />@Display(Model.Secondary) <!-- was: meta -->
|
||||
</div>
|
||||
<div class="primary">@Display(Model.Primary)</div>
|
||||
</div>
|
||||
<div class="primary">@Display(Model.Content)</div>
|
||||
</div>
|
@@ -0,0 +1,9 @@
|
||||
<h1>@Html.TitleForPage((string)Model.Title)</h1>
|
||||
@if (Model.Meta != null) {
|
||||
<div class="metadata">
|
||||
@Display(Model.Meta)
|
||||
</div>
|
||||
}
|
||||
<div class="content">
|
||||
@Display(Model.Content)
|
||||
</div>
|
@@ -1,3 +0,0 @@
|
||||
<h1>@Html.TitleForPage((string)Model.Title)</h1>
|
||||
@Display(Model.metadata)
|
||||
@Display(Model.Primary)
|
@@ -1,4 +0,0 @@
|
||||
@Html.AddTitleParts(Model.Title)
|
||||
@Display(Model.Primary)
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111 Content.Edit.Blog !!!!!!!!!!!!!!!!!!!!!!!!11
|
||||
<fieldset><input class="button primaryAction" type="submit" value="@T("Add")" /></fieldset>
|
@@ -1,7 +0,0 @@
|
||||
@using Orchard.Blogs.Extensions;
|
||||
@using Orchard.Blogs.Models;
|
||||
<h2>@Html.Link((string)Model.Title, Url.Blog((string)Model.Slug))</h2>
|
||||
@if (!string.IsNullOrEmpty((string)Model.Description)) {
|
||||
<p>@Model.Description</p>
|
||||
}
|
||||
<div class="blog metadata">@T.Plural("1 post", "{0} posts", (int)Model.PostCount) | @Display(Model.meta)</div>
|
@@ -1,3 +1,5 @@
|
||||
<div class="blog-description">
|
||||
@if (HasText(Model.Description)) {
|
||||
<div class="blog-description">
|
||||
<p>@Model.Description</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
@@ -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 = "" }))) {
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="publishActions">@T("Actions:")</label>
|
||||
<select id="publishActions" name="Options.BulkAction">
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.None, T("Choose action...").ToString())
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.PublishNow, T("Publish Now").ToString())
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.Unpublish, T("Unpublish").ToString())
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.Remove, T("Remove").ToString())
|
||||
</select>
|
||||
@Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString())
|
||||
<button type="submit" name="submit.BulkEdit" value="yes">@T("Apply")</button>
|
||||
</fieldset>
|
||||
<fieldset class="contentItems bulk-items">
|
||||
@Display(Model.BlogPosts)
|
||||
</fieldset>
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="publishActions">@T("Actions:")</label>
|
||||
<select id="publishActions" name="Options.BulkAction">
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.None, T("Choose action...").ToString())
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.PublishNow, T("Publish Now").ToString())
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.Unpublish, T("Unpublish").ToString())
|
||||
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.Remove, T("Remove").ToString())
|
||||
</select>
|
||||
@Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString())
|
||||
<button type="submit" name="submit.BulkEdit" value="yes">@T("Apply")</button>
|
||||
</fieldset>
|
||||
<fieldset class="contentItems bulk-items">
|
||||
@Display(Model.ContentItems)
|
||||
</fieldset>
|
||||
}
|
||||
} else {
|
||||
<div class="info message">@T("There are no posts for this blog.")</div>
|
||||
<div class="info message">@T("There are no posts for this blog.")</div>
|
||||
}
|
@@ -1,7 +1,9 @@
|
||||
@{
|
||||
IEnumerable<object> blogPosts = Model.BlogPosts;
|
||||
}
|
||||
@Display(blogPosts)
|
||||
@Display(ContentItems)
|
||||
@if (blogPosts == null || blogPosts.Count() < 1) {
|
||||
<p>@T("There are no posts for this blog.")</p>
|
||||
}
|
||||
}
|
||||
|
||||
hi
|
@@ -1 +0,0 @@
|
||||
@Model.Html
|
@@ -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, "</p>" + Environment.NewLine + "<p>"));
|
||||
}
|
||||
<p>@body @Html.ItemDisplayLink(T("[more]").ToString(), (IContent)Model.ContentPart.ContentItem)</p>
|
@@ -1 +0,0 @@
|
||||
|
@@ -1 +0,0 @@
|
||||
|
@@ -1,5 +0,0 @@
|
||||
@using Orchard.Core.Common.Extensions;
|
||||
@if (Model.Creator != null) {
|
||||
<div class="metadata">
|
||||
<div class="posted">@T("Published by {0} {1}", (string)Model.ContentPart.Creator.UserName, Html.PublishedWhen((DateTime?)Model.ContentPart.VersionPublishedUtc, T))</div>
|
||||
</div>}
|
@@ -1,13 +0,0 @@
|
||||
@using Orchard.Core.Localization.Models;
|
||||
@{
|
||||
Style.Require("Localization");
|
||||
IEnumerable<LocalizationPart> localizations = Model.Localizations;
|
||||
}
|
||||
@if (localizations != null && localizations.Count() > 0) {
|
||||
<div class="content-localization">
|
||||
<div class="content-localizations">
|
||||
<h4>@T("Translations:")</h4>
|
||||
@Html.UnorderedList(localizations, (c, i) => Html.ItemDisplayLink(c.Culture.Culture, c), "localizations")
|
||||
</div>
|
||||
</div>
|
||||
}
|
@@ -1 +0,0 @@
|
||||
|
@@ -1 +0,0 @@
|
||||
|
@@ -1,16 +0,0 @@
|
||||
@{
|
||||
var tagsHtml = new List<IHtmlString>();
|
||||
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()) {
|
||||
<p class="tags">
|
||||
<span>@T("Tags:")</span>
|
||||
@foreach(var htmlString in tagsHtml) { @htmlString }
|
||||
</p>
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
@{
|
||||
var tagsHtml = new List<IHtmlString>();
|
||||
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()) {
|
||||
<p class="tags">
|
||||
<span>@T("Tags:")</span>
|
||||
@foreach(var htmlString in tagsHtml) { @htmlString }
|
||||
</p>
|
||||
}
|
@@ -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))
|
||||
|
@@ -1,5 +1,5 @@
|
||||
@model Orchard.Comments.ViewModels.CommentCountViewModel
|
||||
@using Orchard.Comments.ViewModels;
|
||||
@using Orchard.Comments.Models;
|
||||
@using Orchard.Comments.Extensions;
|
||||
|
||||
<span class="commentcount">@Html.CommentSummaryLinks(T, Model.Item, Model.CommentCount, Model.PendingCount)</span>
|
||||
@using Orchard.Comments.ViewModels;
|
||||
@using Orchard.ContentManagement;
|
||||
<span class="commentcount">@Html.CommentSummaryLinks(T, (ContentItem)Model.ContentPart.ContentItem, (int)Model.CommentCount, (int)Model.PendingCount)</span>
|
@@ -229,6 +229,7 @@ namespace Orchard.Setup.Services {
|
||||
htmlWidget.As<WidgetPart>().Zone = "Content";
|
||||
htmlWidget.As<WidgetPart>().Position = "5";
|
||||
htmlWidget.As<BodyPart>().Text = "<p>Congratulations, you've successfully set-up your Orchard site.</p><p>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 <a href=\"/Admin/Contents/Edit/7\">Edit</a> to go into edit mode and replace this with whatever you want on your home page to make it your own.</p><p>One thing you could do (but you don't have to) is go into <a href=\"Admin/Settings\">Manage Settings</a> (follow the <a href=\"Admin\">Admin</a> link and then look for it under \"Settings\" in the menu on the left) and check that everything is configured the way you want.</p><p>You probably want to make the site your own. One of the ways you can do that is by clicking <a href=\"Admin/Themes\">Manage Themes</a> in the admin menu. A theme is a packaged look and feel that affects the whole site.</p><p>Next, you can start playing with the content types that we installed. For example, go ahead and click <a href=\"Admin/Pages/Create\">Add New Page</a> in the admin menu and create an \"about\" page. Then, add it to the navigation menu by going to <a href=\"Admin/Navigation\">Manage Menu</a>. You can also click <a href=\"Admin/Blogs/Create\">Add New Blog</a> and start posting by clicking \"Add New Post\".</p><p>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 <a href=\"Admin/Themes\">Manage Themes</a> and clicking <a href=\"Admin/Themes/Install\">Install a new Theme</a>. Like for themes, modules are created by other users of Orchard just like you so if you feel up to it, please <a href=\"http://www.orchardproject.net/\">consider participating</a>.</p><p>--The Orchard Crew</p>";
|
||||
htmlWidget.As<CommonPart>().Owner = user;
|
||||
contentManager.Publish(htmlWidget);
|
||||
|
||||
// and three more for the third aside...really need this elsewhere...
|
||||
|
@@ -29,7 +29,7 @@ namespace Orchard.Widgets {
|
||||
var zoneName = contentItem.As<WidgetPart>().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);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user