#17825: Showing created instead of published datetime.

--HG--
branch : 1.x
This commit is contained in:
Andre Rodrigues
2011-05-20 16:10:34 -07:00
parent 0fba396da1
commit 984c11a80f
3 changed files with 8 additions and 4 deletions

View File

@@ -23,8 +23,12 @@ namespace Orchard.Core.Common {
}
[Shape]
public IHtmlString PublishedState(HtmlHelper Html, DateTime? dateTimeUtc) {
return Html.DateTime(dateTimeUtc, T("Draft"));
public IHtmlString PublishedState(HtmlHelper html, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc) {
if (!publisheddateTimeUtc.HasValue) {
return T("Draft");
}
return html.DateTime(createdDateTimeUtc);
}
[Shape]

View File

@@ -1 +1 @@
<div class="published">@Display.PublishedState(dateTimeUtc: Model.ContentPart.PublishedUtc)</div>
<div class="published">@Display.PublishedState(createdDateTimeUtc: Model.ContentPart.CreatedUtc, publisheddateTimeUtc: Model.ContentPart.PublishedUtc)</div>

View File

@@ -1 +1 @@
<div class="published">@Display.PublishedState(dateTimeUtc: Model.ContentPart.PublishedUtc)</div>
<div class="published">@Display.PublishedState(createdDateTimeUtc: Model.ContentPart.CreatedUtc, publisheddateTimeUtc: Model.ContentPart.PublishedUtc)</div>