mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
#16998: Publish Later UI now much less confusing with 3 buttons: Save, Publish Now, and Publish Later.
This also moves some publish-later specific css from the admin css to the publish later css, and makes the _Archive_ Later UI look better when active. --HG-- branch : dev
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.Common.Services;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.PublishLater.Models;
|
||||
using Orchard.PublishLater.Services;
|
||||
using Orchard.PublishLater.ViewModels;
|
||||
@@ -58,6 +59,7 @@ namespace Orchard.PublishLater.Drivers {
|
||||
|
||||
updater.TryUpdateModel(model, Prefix, null, null);
|
||||
|
||||
if (Services.WorkContext.Resolve<IHttpContextAccessor>().Current().Request.Form["submit.Save"] == "submit.PublishLater") {
|
||||
if (!string.IsNullOrWhiteSpace(model.ScheduledPublishDate) && !string.IsNullOrWhiteSpace(model.ScheduledPublishTime)) {
|
||||
DateTime scheduled;
|
||||
string parseDateTime = String.Concat(model.ScheduledPublishDate, " ", model.ScheduledPublishTime);
|
||||
@@ -72,7 +74,8 @@ namespace Orchard.PublishLater.Drivers {
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(model.ScheduledPublishDate) || !string.IsNullOrWhiteSpace(model.ScheduledPublishTime)) {
|
||||
updater.AddModelError(Prefix, T("Both the date and time need to be specified for when this is to be published. If you don't want to schedule publishing then clear both the date and time fields."));
|
||||
updater.AddModelError(Prefix, T("Both the date and time need to be specified for when this is to be published. If you don't want to schedule publishing then click Save or Publish Now."));
|
||||
}
|
||||
}
|
||||
|
||||
return ContentShape("Parts_PublishLater_Edit",
|
||||
|
@@ -7,7 +7,7 @@
|
||||
-->
|
||||
<!-- edit shape just get default placement -->
|
||||
<!-- edit "shape" -->
|
||||
<Place Parts_PublishLater_Edit="Sidebar:22"/><!-- immediately following the contents module's save button -->
|
||||
<Place Parts_PublishLater_Edit="Sidebar:25"/><!-- immediately following the contents module's Publish Now button -->
|
||||
<!-- default positioning -->
|
||||
<Match DisplayType="SummaryAdmin">
|
||||
<Place Parts_PublishLater_Metadata_SummaryAdmin="Meta:1"/>
|
||||
|
@@ -6,9 +6,25 @@ html.dyn input.hinted {
|
||||
color:#ccc;
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
fieldset.publish-later-datetime {
|
||||
float:left;
|
||||
clear:none;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
}
|
||||
fieldset.publish-later-datetime legend {
|
||||
display:none;
|
||||
}
|
||||
fieldset.publish-later-datetime input {
|
||||
padding:1px;
|
||||
text-align:center;
|
||||
color:#666;
|
||||
}
|
||||
|
||||
input#PublishLater_ScheduledPublishDate {
|
||||
width:49%;
|
||||
width:39%;
|
||||
}
|
||||
input#PublishLater_ScheduledPublishTime {
|
||||
width:43%;
|
||||
width:33%;
|
||||
}
|
@@ -12,6 +12,7 @@
|
||||
@Html.EditorFor(m => m.ScheduledPublishDate)
|
||||
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")">@T("Time")</label>
|
||||
@Html.EditorFor(m => m.ScheduledPublishTime)
|
||||
<button type="submit" name="submit.Save" value="submit.PublishLater">@T("Publish Later")</button>
|
||||
</fieldset>
|
||||
@using(Script.Foot()) {
|
||||
<script type="text/javascript">
|
||||
|
@@ -868,6 +868,9 @@ fieldset.publish-button, fieldset.delete-button, fieldset.save-button {
|
||||
clear:none;
|
||||
float:left;
|
||||
}
|
||||
fieldset.save-button {
|
||||
clear:left;
|
||||
}
|
||||
fieldset.publish-button {
|
||||
margin: 0 12px;
|
||||
padding: 0 12px;
|
||||
@@ -876,17 +879,7 @@ fieldset.publish-button {
|
||||
fieldset.delete-button {
|
||||
margin: 0 0 0 12px;
|
||||
}
|
||||
fieldset.publish-later-datetime {
|
||||
float:left;
|
||||
}
|
||||
fieldset.publish-later-datetime legend {
|
||||
display:none;
|
||||
}
|
||||
fieldset.publish-later-datetime input {
|
||||
padding:1px;
|
||||
text-align:center;
|
||||
color:#666;
|
||||
}
|
||||
|
||||
|
||||
/* Fields
|
||||
***************************************************************/
|
||||
|
Reference in New Issue
Block a user