From adc891d2f09508f7c3d294aae6c56384c3b40f81 Mon Sep 17 00:00:00 2001 From: BertrandLeRoy Date: Thu, 16 Sep 2010 15:43:51 -0700 Subject: [PATCH] Moving PublishLater back in. --HG-- branch : dev --- src/Orchard.Web/Core/Orchard.Core.csproj | 6 +-- src/Orchard.Web/Core/PublishLater/Module.txt | 2 +- .../PublishLater.Metadata.SummaryAdmin.ascx | 31 ------------ .../PublishLater.Metadata.SummaryAdmin.cshtml | 30 ++++++++++++ .../Parts/PublishLater.Metadata.ascx | 1 - .../Parts/PublishLater.Metadata.cshtml | 1 + .../EditorTemplates/Parts/PublishLater.ascx | 47 ------------------ .../EditorTemplates/Parts/PublishLater.cshtml | 49 +++++++++++++++++++ 8 files changed, 84 insertions(+), 83 deletions(-) delete mode 100644 src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.ascx create mode 100644 src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.cshtml delete mode 100644 src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.ascx create mode 100644 src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.cshtml delete mode 100644 src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.ascx create mode 100644 src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index 6f5dd8f66..dc2fbe713 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -266,8 +266,8 @@ - - + + @@ -300,7 +300,7 @@ - + diff --git a/src/Orchard.Web/Core/PublishLater/Module.txt b/src/Orchard.Web/Core/PublishLater/Module.txt index 8fda62f2a..99e3d03e4 100644 --- a/src/Orchard.Web/Core/PublishLater/Module.txt +++ b/src/Orchard.Web/Core/PublishLater/Module.txt @@ -9,4 +9,4 @@ features: PublishLater: Description: Draft creation and scheduled publishing. Category: Content - Dependencies: Common, Settings + Dependencies: Common, Settings, Scheduling diff --git a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.ascx b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.ascx deleted file mode 100644 index 785076cc0..000000000 --- a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.ascx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> -
    -
  • <% - // Published or not - if (Model.HasPublished) { %> - " alt="<%:T("Online") %>" title="<%:T("The page is currently online") %>" /> <%:T("Published") %> | <% - } - else { %> - " alt="<%:T("Offline") %>" title="<%:T("The page is currently offline") %>" /> <%:T("Not Published") %> | <% - } %> -
  • -
  • <% - // Does the page have a draft - if (Model.HasDraft) { %> - " alt="<%:T("Draft") %>" title="<%:T("The page has a draft") %>" /><%:T("Draft") %> | <% - } - else { %> - <%:T("No Draft") %> | <% - } %> -
  • -
  • <% - if ((Model.ScheduledPublishUtc.HasValue && Model.ScheduledPublishUtc.Value > DateTime.UtcNow) || (Model.IsPublished && Model.VersionPublishedUtc.HasValue)) { - if (Model.IsPublished && Model.VersionPublishedUtc.HasValue) { %> - <%:T("Published: {0}", Html.DateTimeRelative(Model.VersionPublishedUtc.Value, T)) %><% - } - else { %> - " alt="<%:T("Scheduled") %>" title="<%:T("The page is scheduled for publishing") %>" /><%:T("Scheduled") %> - <%:Html.DateTime(Model.ScheduledPublishUtc.Value, T("M/d/yyyy h:mm tt")) %><% - } %> | 
  • <% - } %> -
\ No newline at end of file diff --git a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.cshtml b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.cshtml new file mode 100644 index 000000000..3239d6593 --- /dev/null +++ b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.cshtml @@ -0,0 +1,30 @@ +@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel +
    +
  • @// Published or not + @if (Model.HasPublished) { + @T( @T("Published") |  + } + else { + @T( @T("Not Published") |  + } +
  • +
  • + @// Does the page have a draft + @if (Model.HasDraft) { + @T( @T("Draft") |  + } + else { + @T("No Draft") |  + } +
  • + @if ((Model.ScheduledPublishUtc.HasValue && Model.ScheduledPublishUtc.Value > DateTime.UtcNow) || (Model.IsPublished && Model.VersionPublishedUtc.HasValue)) { +
  • + @if (Model.IsPublished && Model.VersionPublishedUtc.HasValue) { + @T("Published: {0}", Html.DateTimeRelative(Model.VersionPublishedUtc.Value, T)) + } + else { + @T( @T("Scheduled") + @Html.DateTime(Model.ScheduledPublishUtc.Value, T("M/d/yyyy h:mm tt")) + } | 
  • + } +
\ No newline at end of file diff --git a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.ascx b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.ascx deleted file mode 100644 index ce4cd4e1a..000000000 --- a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.ascx +++ /dev/null @@ -1 +0,0 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> \ No newline at end of file diff --git a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.cshtml b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.cshtml new file mode 100644 index 000000000..8b6405dd7 --- /dev/null +++ b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.cshtml @@ -0,0 +1 @@ +@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel \ No newline at end of file diff --git a/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.ascx b/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.ascx deleted file mode 100644 index 0f98fc6c8..000000000 --- a/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.ascx +++ /dev/null @@ -1,47 +0,0 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> -<% Html.RegisterStyle("datetime.css"); %> -<% Html.RegisterStyle("jquery-ui-1.7.2.custom.css"); %> -<% Html.RegisterStyle("ui.datepicker.css"); %> -<% Html.RegisterStyle("ui.timepickr.css"); %> -<% Html.RegisterFootScript("jquery.ui.core.js"); %> -<% Html.RegisterFootScript("jquery.ui.widget.js"); %> -<% Html.RegisterFootScript("jquery.ui.datepicker.js"); %> -<% Html.RegisterFootScript("jquery.utils.js"); %> -<% Html.RegisterFootScript("ui.timepickr.js"); %> -
- <%: T("Publish Settings")%> -
- <%: Html.RadioButton("Command", "SaveDraft", Model.ContentItem.VersionRecord == null || !Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft") })%> - -
-
- <%: Html.RadioButton("Command", "PublishNow", Model.ContentItem.VersionRecord != null && Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow") })%> - -
-
- <%: Html.RadioButton("Command", "PublishLater", Model.ScheduledPublishUtc != null, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater") }) %> - -
-
- - <%: Html.EditorFor(m => m.ScheduledPublishUtcDate)%> - - <%: Html.EditorFor(m => m.ScheduledPublishUtcTime)%> -
-
- \ No newline at end of file diff --git a/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml b/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml new file mode 100644 index 000000000..6664e806f --- /dev/null +++ b/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml @@ -0,0 +1,49 @@ +@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel +@{ + Html.RegisterStyle("datetime.css"); + Html.RegisterStyle("jquery-ui-1.7.2.custom.css"); + Html.RegisterStyle("ui.datepicker.css"); + Html.RegisterStyle("ui.timepickr.css"); + Html.RegisterFootScript("jquery.ui.core.js"); + Html.RegisterFootScript("jquery.ui.widget.js"); + Html.RegisterFootScript("jquery.ui.datepicker.js"); + Html.RegisterFootScript("jquery.utils.js"); + Html.RegisterFootScript("ui.timepickr.js"); +} +
+ @T("Publish Settings") +
+ @Html.RadioButton("Command", "SaveDraft", Model.ContentItem.VersionRecord == null || !Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft") }) + +
+
+ @Html.RadioButton("Command", "PublishNow", Model.ContentItem.VersionRecord != null && Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow") }) + +
+
+ @Html.RadioButton("Command", "PublishLater", Model.ScheduledPublishUtc != null, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater") }) + +
+
+ + @Html.EditorFor(m => m.ScheduledPublishUtcDate) + + @Html.EditorFor(m => m.ScheduledPublishUtcTime) +
+
+ \ No newline at end of file