mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00

- Does not include jQuery.datepicker localization, currently forced to en-US parsing --HG-- branch : dev
52 lines
3.0 KiB
Plaintext
52 lines
3.0 KiB
Plaintext
@model Orchard.PublishLater.ViewModels.PublishLaterViewModel
|
|
@{
|
|
Script.Require("jQueryUtils_TimePicker");
|
|
Script.Require("jQueryUI_DatePicker");
|
|
Style.Require("PublishLater_DatePicker");
|
|
Style.Require("jQueryUtils_TimePicker");
|
|
Style.Require("jQueryUI_DatePicker");
|
|
}
|
|
<fieldset>
|
|
<legend>@T("Publish Settings")</legend>
|
|
<div>
|
|
@Html.RadioButton("Command", "SaveDraft", Model.ContentItem.VersionRecord == null || !Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft") })
|
|
<label class="forcheckbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft")">@T("Save Draft")</label>
|
|
</div>
|
|
<div>
|
|
@Html.RadioButton("Command", "PublishNow", Model.ContentItem.VersionRecord != null && Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow") })
|
|
<label class="forcheckbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow")">@T("Publish Now")</label>
|
|
</div>
|
|
<div>
|
|
@Html.RadioButton("Command", "PublishLater", Model.ScheduledPublishUtc != null, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater") })
|
|
<label class="forcheckbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")">@T("Publish Later")</label>
|
|
</div>
|
|
<div>
|
|
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")">@T("Date")</label>
|
|
@Html.EditorFor(m => m.ScheduledPublishDate)
|
|
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")">@T("Time")</label>
|
|
@Html.EditorFor(m => m.ScheduledPublishTime)
|
|
</div>
|
|
</fieldset>
|
|
@using(Script.Foot()) {
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
$(function () {
|
|
@* todo: (heskew) make a plugin *@
|
|
$("label.forpicker").each(function () {
|
|
var $this = $(this);
|
|
var pickerInput = $("#" + $this.attr("for"));
|
|
pickerInput.data("hint", $this.text());
|
|
if (!pickerInput.val()) {
|
|
pickerInput.addClass("hinted")
|
|
.val(pickerInput.data("hint"))
|
|
.focus(function () { var $this = $(this); if ($this.val() == $this.data("hint")) { $this.removeClass("hinted").val("") } })
|
|
.blur(function () { var $this = $(this); setTimeout(function () { if (!$this.val()) { $this.addClass("hinted").val($this.data("hint")) } }, 300) });
|
|
}
|
|
});
|
|
$('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")').datepicker({ showAnim: "" }).focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")').attr("checked", "checked") });
|
|
$('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")').timepickr().focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")').attr("checked", "checked") });
|
|
|
|
})
|
|
//]]>
|
|
</script>
|
|
} |