mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Cleaned up a few uses of the DateTime shape.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<td class="category-column">@record.CategoryDescriptor.Name</td>
|
||||
<td class="event-column">@record.EventDescriptor.Name</td>
|
||||
<td class="user-column">@record.Record.UserName</td>
|
||||
<td class="timestamp-column">@Display.DateTime(DateTimeUtc: record.Record.CreatedUtc, CustomFormat: T("g"))</td>
|
||||
<td class="timestamp-column">@Display.DateTime(DateTimeUtc: record.Record.CreatedUtc)</td>
|
||||
<td class="summary-column">@Display(record.SummaryShape)</td>
|
||||
<td class="comment-column">@record.Record.Comment</td>
|
||||
<td class="actions-column">@Html.ActionLink(T("Details").Text, "Detail", "Admin", new { id = record.Record.Id, area = "Orchard.AuditTrail" }, null)</td>
|
||||
|
@@ -2,7 +2,6 @@
|
||||
@using Orchard.Azure.MediaServices.Models
|
||||
@using Orchard.Azure.MediaServices.Models.Assets
|
||||
@using Orchard.Azure.MediaServices.Models.Jobs
|
||||
@using Orchard.Localization.Services
|
||||
@{
|
||||
Style.Include("cloudmedia-edit-jobs.css", "cloudmedia-edit-jobs.min.css");
|
||||
Style.Include("cloudmedia-progress.css", "cloudmedia-progress.min.css");
|
||||
@@ -13,11 +12,10 @@
|
||||
var isUploaded = !isCreatingItem && cloudVideoPart.MezzanineAsset.UploadState.Status == AssetUploadStatus.Uploaded;
|
||||
var jobsToDisplay = cloudVideoPart != null ? cloudVideoPart.Jobs.Where(x => x.Status != JobStatus.Archived).ToArray() : Enumerable.Empty<Job>();
|
||||
var authorizedToManageJobs = AuthorizedFor(Permissions.ManageCloudMediaJobs);
|
||||
var dateTimeFormatProvider = WorkContext.Resolve<IDateTimeFormatProvider>();
|
||||
}
|
||||
@helper ShortDateTime(DateTime? value, IDateTimeFormatProvider dateTimeFormatProvider) {
|
||||
@helper ShortDateTime(DateTime? value) {
|
||||
if (value != null) {
|
||||
@Display.DateTime(DateTimeUtc: value, CustomFormat: T(dateTimeFormatProvider.ShortDateTimeFormat))
|
||||
@Display.DateTime(DateTimeUtc: value)
|
||||
}
|
||||
}
|
||||
@if (!isCreatingItem && jobsToDisplay.Any()) {
|
||||
@@ -41,7 +39,7 @@
|
||||
<tr>
|
||||
<td>@job.Name</td>
|
||||
<td>@job.Description</td>
|
||||
<td>@ShortDateTime(job.CreatedUtc, dateTimeFormatProvider)</td>
|
||||
<td>@ShortDateTime(job.CreatedUtc)</td>
|
||||
<td>
|
||||
@if (job.Status == JobStatus.Processing) {
|
||||
var percentComplete = Convert.ToInt32(job.PercentComplete);
|
||||
@@ -57,8 +55,8 @@
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>@ShortDateTime(job.StartedUtc, dateTimeFormatProvider)</td>
|
||||
<td>@ShortDateTime(job.FinishedUtc, dateTimeFormatProvider)</td>
|
||||
<td>@ShortDateTime(job.StartedUtc)</td>
|
||||
<td>@ShortDateTime(job.FinishedUtc)</td>
|
||||
<td>@job.ErrorMessage</td>
|
||||
<td>
|
||||
@if (authorizedToManageJobs) {
|
||||
|
@@ -1,5 +1,4 @@
|
||||
@using Orchard.Azure.MediaServices.Models.Jobs
|
||||
@using Orchard.Localization.Services
|
||||
@{
|
||||
Style.Include("cloudmedia-progress.css", "cloudmedia-progress.min.css");
|
||||
Script.Require("ShapesBase");
|
||||
@@ -7,11 +6,10 @@
|
||||
Layout.Title = "Manage Microsoft Azure Media Jobs";
|
||||
|
||||
var jobs = (IEnumerable<Job>)Model.Jobs;
|
||||
var dateTimeFormatProvider = WorkContext.Resolve<IDateTimeFormatProvider>();
|
||||
}
|
||||
@helper ShortDateTime(DateTime? value, IDateTimeFormatProvider dateTimeFormatProvider) {
|
||||
@helper ShortDateTime(DateTime? value) {
|
||||
if (value != null) {
|
||||
@Display.DateTime(DateTimeUtc: value, CustomFormat: T(dateTimeFormatProvider.ShortDateTimeFormat))
|
||||
@Display.DateTime(DateTimeUtc: value)
|
||||
}
|
||||
}
|
||||
<table class="items" style="width: auto">
|
||||
@@ -42,7 +40,7 @@
|
||||
<td>@job.Name</td>
|
||||
<td>@job.Description</td>
|
||||
<td>@Html.ItemEditLinkWithReturnUrl(Html.ItemDisplayText(job.CloudVideoPart).ToString(), job.CloudVideoPart)</td>
|
||||
<td>@ShortDateTime(job.CreatedUtc, dateTimeFormatProvider)</td>
|
||||
<td>@ShortDateTime(job.CreatedUtc)</td>
|
||||
<td>
|
||||
@if (job.Status == JobStatus.Processing) {
|
||||
var percentComplete = Convert.ToInt32(job.PercentComplete);
|
||||
@@ -57,8 +55,8 @@
|
||||
@T(job.Status.ToString())
|
||||
}
|
||||
</td>
|
||||
<td>@ShortDateTime(job.StartedUtc, dateTimeFormatProvider)</td>
|
||||
<td>@ShortDateTime(job.FinishedUtc, dateTimeFormatProvider)</td>
|
||||
<td>@ShortDateTime(job.StartedUtc)</td>
|
||||
<td>@ShortDateTime(job.FinishedUtc)</td>
|
||||
<td>@job.ErrorMessage</td>
|
||||
<td>
|
||||
@if (job.CanArchive) {
|
||||
|
@@ -2,11 +2,9 @@ TODO:
|
||||
* Test for proper handling of fraction (f) format specifier - suspect it does not work properly in current state
|
||||
* Add formatting and parsing of time zone information (add timezone properties to TimeParts structure)
|
||||
* Write unit tests for DefaultDateLocalizationServices
|
||||
* Add warning message when saving unsupported combination in settings
|
||||
* Add support for the different Gregorian calendar types
|
||||
* Make sure DateTimeField, ArchiveLaterPart and PublishLaterPart handle Persian dates correctly.
|
||||
* Improve CultureDateTimeFormatProvider to return correct information for fa-IR culture when PersianCalendar is in use.
|
||||
* Check for all uses of Display.DateTime that use a standard format string - no can do!
|
||||
|
||||
BREAKING:
|
||||
* DateTokens "Date.Format:<formatString>" and "Date.Local.Format:<formatString>" only supports custom date/time format strings.
|
Reference in New Issue
Block a user