diff --git a/src/Orchard.Web/Content/Admin/css/base.css b/src/Orchard.Web/Content/Admin/css/base.css index d050c3ad6..126907459 100644 --- a/src/Orchard.Web/Content/Admin/css/base.css +++ b/src/Orchard.Web/Content/Admin/css/base.css @@ -493,6 +493,10 @@ a.ibutton.publish, a.ibutton.publish:link, a.ibutton.publish:visited { background-position:-100px -20px; } a.ibutton.publish:hover, a.ibutton.publish:active, a.ibutton.publish:focus { background-position:-100px 0; } +a.ibutton.blog, +a.ibutton.blog:link, +a.ibutton.blog:visited { background-position:-120px -20px; } +a.ibutton.blog:hover, a.ibutton.blog:active, a.ibutton.blog:focus { background-position:-120px 0; } /* todo: (heskew) needs attention */ @@ -566,6 +570,7 @@ ol.actions label { #main .contentItems li:hover a.ibutton.add.page { background-position:-60px 0; } #main .contentItems li:hover a.ibutton.edit { background-position:-80px 0; } #main .contentItems li:hover a.ibutton.publish { background-position:-100px 0; } +#main .contentItems li:hover a.ibutton.blog { background-position:-120px 0; } /* Tables ----------------------------------------------------------*/ diff --git a/src/Orchard.Web/Content/Admin/css/images/icons.png b/src/Orchard.Web/Content/Admin/css/images/icons.png index ae3c9fd57..9db203a53 100644 Binary files a/src/Orchard.Web/Content/Admin/css/images/icons.png and b/src/Orchard.Web/Content/Admin/css/images/icons.png differ diff --git a/src/Orchard.Web/Content/Admin/css/images/icons.psd b/src/Orchard.Web/Content/Admin/css/images/icons.psd index 6998ecb32..ea412b1df 100644 Binary files a/src/Orchard.Web/Content/Admin/css/images/icons.psd and b/src/Orchard.Web/Content/Admin/css/images/icons.psd differ diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Extensions/HtmlHelperExtensions.cs b/src/Orchard.Web/Packages/Orchard.Blogs/Extensions/HtmlHelperExtensions.cs index cc4edf0cd..34c79c073 100644 --- a/src/Orchard.Web/Packages/Orchard.Blogs/Extensions/HtmlHelperExtensions.cs +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Extensions/HtmlHelperExtensions.cs @@ -4,12 +4,18 @@ using Orchard.Mvc.Html; namespace Orchard.Blogs.Extensions { public static class HtmlHelperExtensions { - public static string Published(this HtmlHelper htmlHelper) { - return htmlHelper.Published(htmlHelper.ViewData.Model); + public static string PublishedState(this HtmlHelper htmlHelper) { + return htmlHelper.PublishedState(htmlHelper.ViewData.Model); + } + public static string PublishedState(this HtmlHelper htmlHelper, BlogPost blogPost) { + return htmlHelper.DateTime(blogPost.Published, "Draft"); } - public static string Published(this HtmlHelper htmlHelper, BlogPost blogPost) { - return htmlHelper.DateTime(blogPost.Published, "as a Draft"); + public static string PublishedWhen(this HtmlHelper htmlHelper) { + return htmlHelper.PublishedWhen(htmlHelper.ViewData.Model); + } + public static string PublishedWhen(this HtmlHelper htmlHelper, BlogPost blogPost) { + return htmlHelper.DateTimeRelative(blogPost.Published, "as a Draft"); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Views/Blog/DisplayTemplates/BlogForAdmin.ascx b/src/Orchard.Web/Packages/Orchard.Blogs/Views/Blog/DisplayTemplates/BlogForAdmin.ascx index d8d9e586f..eff684d40 100644 --- a/src/Orchard.Web/Packages/Orchard.Blogs/Views/Blog/DisplayTemplates/BlogForAdmin.ascx +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Views/Blog/DisplayTemplates/BlogForAdmin.ascx @@ -4,12 +4,15 @@ <%@ Import Namespace="Orchard.Blogs.Models"%>

<%=Html.Encode(Model.Name) %>

+ <% var postCount = Model.PostCount; %><%=string.Format("{0} post{1}", postCount, postCount == 1 ? "" : "s") %> + | ?? comments + <%--

[list of authors] [modify blog access]

--%>

<%=Model.Description %>

<%-- todo: (heskew) make into a ul --%> + Manage Blog Edit Blog View Blog New Post diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Views/BlogPost/Item.aspx b/src/Orchard.Web/Packages/Orchard.Blogs/Views/BlogPost/Item.aspx index c9f602e23..7d4f44c16 100644 --- a/src/Orchard.Web/Packages/Orchard.Blogs/Views/BlogPost/Item.aspx +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Views/BlogPost/Item.aspx @@ -11,7 +11,7 @@

<%=Html.Encode(Model.Post.Title) %>

diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Views/Shared/BlogPostPreview.ascx b/src/Orchard.Web/Packages/Orchard.Blogs/Views/Shared/BlogPostPreview.ascx index 59c658ad1..d5d6d4862 100644 --- a/src/Orchard.Web/Packages/Orchard.Blogs/Views/Shared/BlogPostPreview.ascx +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Views/Shared/BlogPostPreview.ascx @@ -4,5 +4,5 @@ <%@ Import Namespace="Orchard.Core.Common.Models"%> <%@ Import Namespace="Orchard.Blogs.Models"%>

<%=Html.Encode(Model.As().Title) %>

-
<%=Html.Published() %>
+
<%=Html.PublishedWhen() %>
<%=Model.Body %>
\ No newline at end of file diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Views/Shared/DisplayTemplates/BlogPostPreviewForAdmin.ascx b/src/Orchard.Web/Packages/Orchard.Blogs/Views/Shared/DisplayTemplates/BlogPostPreviewForAdmin.ascx index 8db503cc6..fc797acc1 100644 --- a/src/Orchard.Web/Packages/Orchard.Blogs/Views/Shared/DisplayTemplates/BlogPostPreviewForAdmin.ascx +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Views/Shared/DisplayTemplates/BlogPostPreviewForAdmin.ascx @@ -5,7 +5,8 @@ <%@ Import Namespace="Orchard.Blogs.Models"%>

<%=Html.Encode(Model.Title) %>

- <%=Html.Published() %> + <%=Html.PublishedState() %> + | ?? comments
<%=Model.Body ?? "

there's no content for this blog post

" %>

diff --git a/src/Orchard.Web/Packages/Orchard.Comments/Views/Models/DisplayTemplates/HasComments.ascx b/src/Orchard.Web/Packages/Orchard.Comments/Views/Models/DisplayTemplates/HasComments.ascx index 13ad5262c..b50c868c5 100644 --- a/src/Orchard.Web/Packages/Orchard.Comments/Views/Models/DisplayTemplates/HasComments.ascx +++ b/src/Orchard.Web/Packages/Orchard.Comments/Views/Models/DisplayTemplates/HasComments.ascx @@ -8,7 +8,7 @@

<%--TODO: (erikpo) Need to clean the name and url so nothing dangerous goes out--%> <%=Html.LinkOrDefault(comment.UserName, comment.SiteName, new { rel = "nofollow" })%> - said
<%=Html.Link(Html.DateTime(comment.CommentDate), "#")%>
+ said
<%=Html.Link(Html.DateTimeRelative(comment.CommentDate), "#")%>

<%=comment.CommentText %>

diff --git a/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs b/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs index b157b1aca..3ae4d392c 100644 --- a/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs +++ b/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs @@ -87,30 +87,38 @@ namespace Orchard.Mvc.Html { #region Format Date/Time + public static string DateTimeRelative(this HtmlHelper htmlHelper, DateTime? value, string defaultIfNull) { + return value.HasValue ? htmlHelper.DateTimeRelative(value.Value) : defaultIfNull; + } + //TODO: (erikpo) This method needs localized - public static string DateTime(this HtmlHelper htmlHelper, DateTime value) - { + public static string DateTimeRelative(this HtmlHelper htmlHelper, DateTime value) { TimeSpan time = System.DateTime.UtcNow - value; if (time.TotalDays > 7) - //TODO: (erikpo) This format should come from a site setting - return "at " + value.ToString("MMM d yyyy h:mm tt"); + return "at " + htmlHelper.DateTime(value); if (time.TotalHours > 24) return string.Format("{0} day{1} ago", time.Days, time.Days == 1 ? "" : "s"); if (time.TotalMinutes > 60) return string.Format("{0} hour{1} ago", time.Hours, time.Hours == 1 ? "" : "s"); if (time.TotalSeconds > 60) return string.Format("{0} minute{1} ago", time.Minutes, time.Minutes == 1 ? "" : "s"); - else if (time.TotalSeconds > 10) + if (time.TotalSeconds > 10) return string.Format("{0} second{1} ago", time.Seconds, time.Seconds == 1 ? "" : "s"); - else - return "a moment ago"; + + return "a moment ago"; } - public static string DateTime(this HtmlHelper htmlHelper, DateTime? value, string defaultIfNull) { + public static string DateTime(this HtmlHelper htmlHelper, DateTime? value, string defaultIfNull) + { return value.HasValue ? htmlHelper.DateTime(value.Value) : defaultIfNull; } + //TODO: (erikpo) This format should come from a site setting + public static string DateTime(this HtmlHelper htmlHelper, DateTime value) { + return value.ToString("MMM d yyyy h:mm tt"); + } + #endregion #region Link