diff --git a/src/Orchard.Web/Core/Feeds/IFeedManager.cs b/src/Orchard.Web/Core/Feeds/IFeedManager.cs index 90d76bfe6..b22e96253 100644 --- a/src/Orchard.Web/Core/Feeds/IFeedManager.cs +++ b/src/Orchard.Web/Core/Feeds/IFeedManager.cs @@ -1,9 +1,11 @@ +using System; using System.Web.Mvc; using System.Web.Routing; namespace Orchard.Core.Feeds { public interface IFeedManager : IDependency { void Register(string title, string format, RouteValueDictionary values); + void Register(string title, string format, string url); MvcHtmlString GetRegisteredLinks(HtmlHelper html); // Currently implemented in FeedController action... tbd diff --git a/src/Orchard.Web/Core/Feeds/Services/FeedManager.cs b/src/Orchard.Web/Core/Feeds/Services/FeedManager.cs index f8cd2ff76..d975250ee 100644 --- a/src/Orchard.Web/Core/Feeds/Services/FeedManager.cs +++ b/src/Orchard.Web/Core/Feeds/Services/FeedManager.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Text; using System.Web.Mvc; @@ -12,6 +13,7 @@ namespace Orchard.Core.Feeds.Services { class Link { public string Title { get; set; } public RouteValueDictionary RouteValues { get; set; } + public string Url { get; set; } } public void Register(string title, string format, RouteValueDictionary values) { @@ -28,14 +30,16 @@ namespace Orchard.Core.Feeds.Services { _links.Add(new Link { Title = title, RouteValues = link }); } - - + public void Register(string title, string format, string url) { + _links.Add(new Link { Title = title, Url = url }); + } + public MvcHtmlString GetRegisteredLinks(HtmlHelper html) { var urlHelper = new UrlHelper(html.ViewContext.RequestContext, html.RouteCollection); var sb = new StringBuilder(); foreach (var link in _links) { - var linkUrl = urlHelper.RouteUrl(link.RouteValues); + var linkUrl = String.IsNullOrWhiteSpace(link.Url) ? urlHelper.RouteUrl(link.RouteValues) : link.Url; sb.Append("\r\n"); sb.Append(@" x.PostCount); } set { this.Store(x => x.PostCount, value); } } + + public string FeedProxyUrl { + get { return this.Retrieve(x => x.FeedProxyUrl); } + set { this.Store(x => x.FeedProxyUrl, value); } + } + + public bool EnableCommentsFeed { + get { return this.Retrieve(x => x.EnableCommentsFeed, false); } + set { this.Store(x => x.EnableCommentsFeed, value); } + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.Blogs.Blog.Fields.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.Blogs.Blog.Fields.cshtml index a9bf742b0..9623f44db 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.Blogs.Blog.Fields.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.Blogs.Blog.Fields.cshtml @@ -1,5 +1,20 @@ -@model Orchard.Blogs.Models.BlogPart +@using Orchard.Mvc.Extensions +@model Orchard.Blogs.Models.BlogPart +
@Html.LabelFor(m => m.Description, T("Description")) @Html.TextAreaFor(m => m.Description, 5, 60, null) -
\ No newline at end of file + + +
+ @Html.LabelFor(m => m.FeedProxyUrl, T("Feed proxy Url")) + @Html.TextBoxFor(m => m.FeedProxyUrl, new { @class = "text medium" }) + @T("Provide a custom public url which will be used to proxy the local rss feed.") + @T("The current feed is available at {0}.", Url.AbsoluteAction("Index", "Feed", new { area = "Feeds", containerid = Model.Id })) +
+ +
+ @Html.CheckBoxFor(m => m.EnableCommentsFeed) + @Html.LabelFor(m => m.EnableCommentsFeed, T("Render a comments rss feed").Text, new { @class = "forcheckbox" }) + @T("Enable to render the comments rss feed.") +