remove schedule publish box from info app
This commit is contained in:
@@ -69,9 +69,6 @@
|
||||
// get document type details
|
||||
scope.documentType = scope.node.documentType;
|
||||
|
||||
// make sure dates are formatted to the user's locale
|
||||
formatDatesToLocal();
|
||||
|
||||
//default setting for redirect url management
|
||||
scope.urlTrackerDisabled = false;
|
||||
|
||||
@@ -117,22 +114,6 @@
|
||||
scope.node.template = templateAlias;
|
||||
};
|
||||
|
||||
scope.datePickerChange = function (event, type) {
|
||||
if (type === 'publish') {
|
||||
setPublishDate(event.date.format("YYYY-MM-DD HH:mm"));
|
||||
} else if (type === 'unpublish') {
|
||||
setUnpublishDate(event.date.format("YYYY-MM-DD HH:mm"));
|
||||
}
|
||||
};
|
||||
|
||||
scope.clearPublishDate = function () {
|
||||
clearPublishDate();
|
||||
};
|
||||
|
||||
scope.clearUnpublishDate = function () {
|
||||
clearUnpublishDate();
|
||||
};
|
||||
|
||||
function loadAuditTrail() {
|
||||
|
||||
scope.loadingAuditTrail = true;
|
||||
@@ -243,97 +224,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
function setPublishDate(date) {
|
||||
|
||||
if (!date) {
|
||||
return;
|
||||
}
|
||||
|
||||
//The date being passed in here is the user's local date/time that they have selected
|
||||
//we need to convert this date back to the server date on the model.
|
||||
|
||||
var serverTime = dateHelper.convertToServerStringTime(moment(date), Umbraco.Sys.ServerVariables.application.serverTimeOffset);
|
||||
|
||||
// update publish value
|
||||
scope.node.releaseDate = serverTime;
|
||||
|
||||
// make sure dates are formatted to the user's locale
|
||||
formatDatesToLocal();
|
||||
|
||||
// emit event
|
||||
var args = { node: scope.node, date: date };
|
||||
eventsService.emit("editors.content.changePublishDate", args);
|
||||
|
||||
}
|
||||
|
||||
function clearPublishDate() {
|
||||
|
||||
// update publish value
|
||||
scope.node.releaseDate = null;
|
||||
|
||||
// emit event
|
||||
var args = { node: scope.node, date: null };
|
||||
eventsService.emit("editors.content.changePublishDate", args);
|
||||
|
||||
}
|
||||
|
||||
function setUnpublishDate(date) {
|
||||
|
||||
if (!date) {
|
||||
return;
|
||||
}
|
||||
|
||||
//The date being passed in here is the user's local date/time that they have selected
|
||||
//we need to convert this date back to the server date on the model.
|
||||
|
||||
var serverTime = dateHelper.convertToServerStringTime(moment(date), Umbraco.Sys.ServerVariables.application.serverTimeOffset);
|
||||
|
||||
// update publish value
|
||||
scope.node.removeDate = serverTime;
|
||||
|
||||
// make sure dates are formatted to the user's locale
|
||||
formatDatesToLocal();
|
||||
|
||||
// emit event
|
||||
var args = { node: scope.node, date: date };
|
||||
eventsService.emit("editors.content.changeUnpublishDate", args);
|
||||
|
||||
}
|
||||
|
||||
function clearUnpublishDate() {
|
||||
|
||||
// update publish value
|
||||
scope.node.removeDate = null;
|
||||
|
||||
// emit event
|
||||
var args = { node: scope.node, date: null };
|
||||
eventsService.emit("editors.content.changeUnpublishDate", args);
|
||||
|
||||
}
|
||||
|
||||
function ucfirst(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
function formatDatesToLocal() {
|
||||
// get current backoffice user and format dates
|
||||
userService.getCurrentUser().then(function (currentUser) {
|
||||
scope.node.createDateFormatted = dateHelper.getLocalDate(scope.node.createDate, currentUser.locale, 'LLL');
|
||||
|
||||
scope.node.releaseDateYear = scope.node.releaseDate ? ucfirst(dateHelper.getLocalDate(scope.node.releaseDate, currentUser.locale, 'YYYY')) : null;
|
||||
scope.node.releaseDateMonth = scope.node.releaseDate ? ucfirst(dateHelper.getLocalDate(scope.node.releaseDate, currentUser.locale, 'MMMM')) : null;
|
||||
scope.node.releaseDateDayNumber = scope.node.releaseDate ? ucfirst(dateHelper.getLocalDate(scope.node.releaseDate, currentUser.locale, 'DD')) : null;
|
||||
scope.node.releaseDateDay = scope.node.releaseDate ? ucfirst(dateHelper.getLocalDate(scope.node.releaseDate, currentUser.locale, 'dddd')) : null;
|
||||
scope.node.releaseDateTime = scope.node.releaseDate ? ucfirst(dateHelper.getLocalDate(scope.node.releaseDate, currentUser.locale, 'HH:mm')) : null;
|
||||
|
||||
scope.node.removeDateYear = scope.node.removeDate ? ucfirst(dateHelper.getLocalDate(scope.node.removeDate, currentUser.locale, 'YYYY')) : null;
|
||||
scope.node.removeDateMonth = scope.node.removeDate ? ucfirst(dateHelper.getLocalDate(scope.node.removeDate, currentUser.locale, 'MMMM')) : null;
|
||||
scope.node.removeDateDayNumber = scope.node.removeDate ? ucfirst(dateHelper.getLocalDate(scope.node.removeDate, currentUser.locale, 'DD')) : null;
|
||||
scope.node.removeDateDay = scope.node.removeDate ? ucfirst(dateHelper.getLocalDate(scope.node.removeDate, currentUser.locale, 'dddd')) : null;
|
||||
scope.node.removeDateTime = scope.node.removeDate ? ucfirst(dateHelper.getLocalDate(scope.node.removeDate, currentUser.locale, 'HH:mm')) : null;
|
||||
});
|
||||
}
|
||||
|
||||
// load audit trail and redirects when on the info tab
|
||||
evts.push(eventsService.on("app.tabChange", function (event, args) {
|
||||
$timeout(function () {
|
||||
@@ -356,7 +246,6 @@
|
||||
if(isInfoTab) {
|
||||
loadAuditTrail();
|
||||
loadRedirectUrls();
|
||||
formatDatesToLocal();
|
||||
setNodePublishStatus(scope.node);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -112,78 +112,7 @@
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__sidebar">
|
||||
<umb-box data-element="node-info-scheduled-publishing">
|
||||
<umb-box-header title-key="general_scheduledPublishing"></umb-box-header>
|
||||
<umb-box-content class="block-form">
|
||||
|
||||
<div class="date-wrapper">
|
||||
|
||||
<div class="flex items-center flex-column">
|
||||
|
||||
|
||||
<umb-date-time-picker data-element="node-info-publish"
|
||||
options="datePickerConfig"
|
||||
on-change="datePickerChange(event, 'publish')">
|
||||
|
||||
<div class="date-container">
|
||||
|
||||
<div class="date-container__title">
|
||||
<localize key="content_releaseDate"></localize>
|
||||
</div>
|
||||
|
||||
<div class="date-container__date" ng-if="node.releaseDate">
|
||||
<div class="date-wrapper__date">{{node.releaseDateMonth}} {{node.releaseDateYear}}</div>
|
||||
<div class="date-wrapper__number">{{node.releaseDateDayNumber}}</div>
|
||||
<div class="date-wrapper__date">{{node.releaseDateDay}} {{node.releaseDateTime}}</div>
|
||||
</div>
|
||||
|
||||
<a href="" ng-if="!node.releaseDate" class="bold" style="color: #00aea2; text-decoration: underline;"><localize key="content_setDate">Set date</localize></a>
|
||||
|
||||
</div>
|
||||
|
||||
</umb-date-time-picker>
|
||||
|
||||
<a ng-if="node.releaseDate" ng-click="clearPublishDate()" href="" style="text-decoration: underline;">
|
||||
<small><localize key="content_removeDate">Clear date</localize></small>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="date-separate"></div>
|
||||
|
||||
<div class="flex items-center flex-column">
|
||||
<umb-date-time-picker data-element="node-info-unpublish"
|
||||
options="datePickerConfig"
|
||||
on-change="datePickerChange(event, 'unpublish')">
|
||||
|
||||
<div class="date-container">
|
||||
|
||||
<div class="date-container__title">
|
||||
<localize key="content_unpublishDate"></localize>
|
||||
</div>
|
||||
|
||||
<div class="date-container__date" ng-if="node.removeDate">
|
||||
<div class="date-wrapper__date">{{node.removeDateMonth}} {{node.removeDateYear}}</div>
|
||||
<div class="date-wrapper__number">{{node.removeDateDayNumber}}</div>
|
||||
<div class="date-wrapper__date">{{node.removeDateDay}} {{node.removeDateTime}}</div>
|
||||
</div>
|
||||
|
||||
<a href="" ng-if="!node.removeDate" class="bold" style="color: #00aea2; text-decoration: underline;"><localize key="content_setDate">Set date</localize></a>
|
||||
|
||||
</div>
|
||||
|
||||
</umb-date-time-picker>
|
||||
|
||||
<a ng-if="node.removeDate" ng-click="clearUnpublishDate()" href="" style="text-decoration: underline;">
|
||||
<small><localize key="content_removeDate">Clear date</localize></small>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</umb-box-content>
|
||||
</umb-box>
|
||||
|
||||
<umb-box data-element="node-info-general">
|
||||
<umb-box-header title-key="general_general"></umb-box-header>
|
||||
<umb-box-content class="block-form">
|
||||
|
||||
Reference in New Issue
Block a user