mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Making DateTimeRelative an extension method
--HG-- branch : dev
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
}
|
||||
<ul class="pageStatus">
|
||||
<li>@if (modifiedUtc.HasValue) {
|
||||
@T("Last modified: {0}", Html.DateTimeRelative(modifiedUtc.Value, T))} |
|
||||
@T("Last modified: {0}", Display.DateTimeRelative(dateTime: modifiedUtc.Value))} |
|
||||
</li>
|
||||
<li>@T("By {0}", owner.UserName)</li>
|
||||
</ul>
|
@@ -6,5 +6,5 @@
|
||||
DateTime? versionPublishedUtc = publishLaterPart.As<CommonPart>() == null ? null : publishLaterPart.As<CommonPart>().VersionPublishedUtc;
|
||||
}
|
||||
@if (publishLaterPart.IsPublished() && versionPublishedUtc.HasValue) {
|
||||
@T("Published: {0}", Html.DateTimeRelative(versionPublishedUtc.Value, T)) @T(" | ")
|
||||
@T("Published: {0}", Display.DateTimeRelative(versionPublishedUtc.Value)) @T(" | ")
|
||||
}
|
@@ -26,7 +26,7 @@
|
||||
@if ((((DateTime?)Model.ScheduledPublishUtc).HasValue && ((DateTime?)Model.ScheduledPublishUtc).Value > DateTime.UtcNow) || (publishLaterPart.IsPublished() && versionPublishedUtc.HasValue)) {
|
||||
<li>
|
||||
@if (publishLaterPart.IsPublished() && versionPublishedUtc.HasValue) {
|
||||
@T("Published: {0}", Html.DateTimeRelative(versionPublishedUtc.Value, T))
|
||||
@T("Published: {0}", Display.DateTimeRelative(versionPublishedUtc.Value))
|
||||
}
|
||||
else {
|
||||
<img class="icon" src="@Href("~/Core/PublishLater/Content/Admin/images/scheduled.gif")" alt="@T("Scheduled")" title="@T("The page is scheduled for publishing")" /><text> @T("Scheduled") </text>
|
||||
|
@@ -6,5 +6,5 @@
|
||||
DateTime? versionPublishedUtc = publishLaterPart.As<CommonPart>() == null ? null : publishLaterPart.As<CommonPart>().VersionPublishedUtc;
|
||||
}
|
||||
@if (publishLaterPart.IsPublished() && versionPublishedUtc.HasValue) {
|
||||
@T("Published: {0}", Html.DateTimeRelative(versionPublishedUtc.Value, T))
|
||||
@T("Published: {0}", Display.DateTimeRelative(dateTime: versionPublishedUtc.Value))
|
||||
}
|
@@ -3,19 +3,19 @@
|
||||
|
||||
<ul class="comments">
|
||||
@foreach (var comment in Model) {
|
||||
<li>
|
||||
<article class="comment">
|
||||
<header>
|
||||
<h4>
|
||||
<span class="who">@Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" })
|
||||
</span>
|
||||
<span class="when">said <time datetime="@comment.Record.CommentDateUtc.GetValueOrDefault()">@Html.Link(Html.DateTimeRelative(comment.Record.CommentDateUtc.GetValueOrDefault(), T).ToString(), "#")</time>
|
||||
</span>
|
||||
</h4>
|
||||
</header>
|
||||
<p class="text">@comment.Record.CommentText</p>
|
||||
</article>
|
||||
</li>
|
||||
<li>
|
||||
<article class="comment">
|
||||
<header>
|
||||
<h4>
|
||||
<span class="who">@Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" })
|
||||
</span>
|
||||
<span class="when">said <time datetime="@comment.Record.CommentDateUtc.GetValueOrDefault()">@Html.Link(Display.DateTimeRelative(dateTime: comment.Record.CommentDateUtc.GetValueOrDefault()).ToString(), "#")</time>
|
||||
</span>
|
||||
</h4>
|
||||
</header>
|
||||
<p class="text">@comment.Record.CommentText</p>
|
||||
</article>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<p>@T("The search index contains the following fields: {0}.", string.Join(T(", ").Text, Model.IndexEntry.Fields))</p>
|
||||
}
|
||||
|
||||
<p>@T("The search index was last updated {0}.", Html.DateTimeRelative(Model.IndexEntry.LastUpdateUtc.Value, T))</p>
|
||||
<p>@T("The search index was last updated {0}.", Display.DateTimeRelative(dateTime: Model.IndexEntry.LastUpdateUtc.Value))</p>
|
||||
}
|
||||
<p>@T("Update the search index now: ")<button type="submit" title="@T("Update the search index.")" class="primaryAction">@T("Update")</button></p>
|
||||
@Html.AntiForgeryTokenOrchard()
|
||||
|
@@ -7,7 +7,7 @@ foreach (var comment in Model) { %>
|
||||
<p><%: comment.Record.CommentText %></p>
|
||||
</div>
|
||||
<div class="commentauthor">
|
||||
<span class="who"><%: Html.LinkOrDefault(Html.Encode(comment.Record.UserName), Html.Encode(comment.Record.SiteName), new { rel = "nofollow" })%></span> <span>said <%: Html.Link(Html.DateTimeRelative(comment.Record.CommentDateUtc.GetValueOrDefault(), T).Text, "#")%></span>
|
||||
<span class="who"><%: Html.LinkOrDefault(Html.Encode(comment.Record.UserName), Html.Encode(comment.Record.SiteName), new { rel = "nofollow" })%></span> <span>said <%: Html.Link(Display.DateTimeRelative(dateTime: comment.Record.CommentDateUtc.GetValueOrDefault()).Text, "#")%></span>
|
||||
</div>
|
||||
</li><%
|
||||
} %>
|
||||
|
@@ -7,7 +7,7 @@ foreach (var comment in Model) { %>
|
||||
<p><%: comment.Record.CommentText %></p>
|
||||
</div>
|
||||
<div class="commentauthor">
|
||||
<span class="who"><%: Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" })%></span> <span>said <%: Html.Link(Html.DateTimeRelative(comment.Record.CommentDateUtc.GetValueOrDefault(), T).Text, "#")%></span>
|
||||
<span class="who"><%: Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" })%></span> <span>said <%: Html.Link(Display.DateTimeRelative(dateTime: comment.Record.CommentDateUtc.GetValueOrDefault()).Text, "#")%></span>
|
||||
</div>
|
||||
</li><%
|
||||
} %>
|
||||
|
Reference in New Issue
Block a user