making variant dialogs up to date with Segments.
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
.date-wrapper-mini--checkbox{
|
||||
margin: 0 0 0 26px;
|
||||
margin: 0 0 0 28px;
|
||||
}
|
||||
|
||||
.date-wrapper-mini__date {
|
||||
@@ -62,6 +62,10 @@
|
||||
&:first-of-type {
|
||||
margin-left: 0;
|
||||
}
|
||||
.flatpickr-input > button:first-of-type {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.date-wrapper-mini__date .flatpickr-input > a {
|
||||
|
||||
@@ -133,7 +133,6 @@
|
||||
});
|
||||
|
||||
if (vm.availableVariants.length !== 0) {
|
||||
//now sort it so that the current one is at the top
|
||||
vm.availableVariants = vm.availableVariants.sort(function (a, b) {
|
||||
if (a.language && b.language) {
|
||||
if (a.language.name > b.language.name) {
|
||||
|
||||
+29
-8
@@ -5,11 +5,14 @@
|
||||
|
||||
var vm = this;
|
||||
|
||||
vm.includeUnpublished = false;
|
||||
|
||||
vm.changeSelection = changeSelection;
|
||||
vm.toggleIncludeUnpublished = toggleIncludeUnpublished;
|
||||
|
||||
|
||||
function onInit() {
|
||||
|
||||
vm.includeUnpublished = false;
|
||||
vm.variants = $scope.model.variants;
|
||||
vm.labels = {};
|
||||
|
||||
@@ -27,9 +30,24 @@
|
||||
|
||||
if (vm.variants.length > 1) {
|
||||
|
||||
//now sort it so that the current one is at the top
|
||||
vm.variants = _.sortBy(vm.variants, function (v) {
|
||||
return v.active ? 0 : 1;
|
||||
vm.variants = vm.variants.sort(function (a, b) {
|
||||
if (a.language && b.language) {
|
||||
if (a.language.name > b.language.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.language.name < b.language.name) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (a.segment && b.segment) {
|
||||
if (a.segment > b.segment) {
|
||||
return -1;
|
||||
}
|
||||
if (a.segment < b.segment) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
var active = _.find(vm.variants, function (v) {
|
||||
@@ -48,14 +66,17 @@
|
||||
// localize help text for invariant content
|
||||
vm.labels.help = {
|
||||
"key": "content_publishDescendantsHelp",
|
||||
"tokens": []
|
||||
"tokens": [vm.variants[0].name]
|
||||
};
|
||||
// add the node name as a token so it will show up in the translated text
|
||||
vm.labels.help.tokens.push(vm.variants[0].name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function toggleIncludeUnpublished() {
|
||||
console.log("toggleIncludeUnpublished")
|
||||
vm.includeUnpublished = !vm.includeUnpublished;
|
||||
}
|
||||
|
||||
/** Returns true if publishing is possible based on if there are un-published mandatory languages */
|
||||
function canPublish() {
|
||||
var selected = [];
|
||||
@@ -64,7 +85,7 @@
|
||||
|
||||
var published = !(variant.state === "NotCreated" || variant.state === "Draft");
|
||||
|
||||
if (variant.language.isMandatory && !published && !variant.publish) {
|
||||
if (variant.segment == null && variant.language && variant.language.isMandatory && !published && !variant.publish) {
|
||||
//if a mandatory variant isn't published
|
||||
//and not flagged for saving
|
||||
//then we cannot continue
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div ng-controller="Umbraco.Overlays.PublishDescendantsController as vm">
|
||||
<div ng-controller="Umbraco.Overlays.PublishDescendantsController as vm" class="umb-variant-selector-overlay">
|
||||
|
||||
<div ng-if="vm.variants.length === 1">
|
||||
<div class="mb3">
|
||||
@@ -6,11 +6,12 @@
|
||||
</div>
|
||||
|
||||
<div class="flex mb3">
|
||||
<umb-checkbox
|
||||
model="model.includeUnpublished"
|
||||
text="Include drafts: also publish unpublished content items."
|
||||
label-key="content_includeUnpublished"
|
||||
<umb-toggle
|
||||
checked="vm.includeUnpublished"
|
||||
on-click="vm.toggleIncludeUnpublished()"
|
||||
class="mr2"
|
||||
/>
|
||||
<localize key="content_includeUnpublished"></localize>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -22,44 +23,43 @@
|
||||
</div>
|
||||
|
||||
<div class="flex mb3">
|
||||
<umb-checkbox
|
||||
model="model.includeUnpublished"
|
||||
text="Include drafts: also publish unpublished content items."
|
||||
label-key="content_includeUnpublished"
|
||||
<umb-toggle
|
||||
checked="vm.includeUnpublished"
|
||||
on-click="vm.toggleIncludeUnpublished()"
|
||||
class="mr2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="bold mb1">
|
||||
<localize key="treeHeaders_languages"></localize>
|
||||
<localize key="content_includeUnpublished"></localize>
|
||||
</div>
|
||||
|
||||
<div class="umb-list umb-list--condensed">
|
||||
|
||||
<div class="umb-list-item umb-list--condensed" ng-repeat="variant in vm.variants">
|
||||
<ng-form name="publishVariantSelectorForm">
|
||||
<div ng-class="{'umb-list-item--error': publishVariantSelectorForm.publishVariantSelector.$invalid}">
|
||||
<div class="umb-variant-selector-entry" ng-class="{'umb-list-item--error': publishVariantSelectorForm.publishVariantSelector.$invalid}">
|
||||
|
||||
<umb-checkbox
|
||||
name="publishVariantSelector"
|
||||
model="variant.publish"
|
||||
on-change="vm.changeSelection(variant)"
|
||||
server-validation-field="{{variant.htmlId}}"
|
||||
text="{{variant.language.name}}"/>
|
||||
>
|
||||
|
||||
<div>
|
||||
<span class="db umb-list-item__description umb-list-item__description--checkbox" ng-if="!publishVariantSelectorForm.publishVariantSelector.$invalid && !(variant.notifications && variant.notifications.length > 0)">
|
||||
<span class="db umb-list-item__description" ng-if="!publishVariantSelectorForm.publishVariantSelector.$invalid && !(variant.notifications && variant.notifications.length > 0)">
|
||||
<umb-variant-state variant="variant"></umb-variant-state>
|
||||
<span ng-if="variant.language.isMandatory"> - <localize key="languages_mandatoryLanguage"></localize></span>
|
||||
</span>
|
||||
|
||||
<span class="db" ng-messages="publishVariantSelectorForm.publishVariantSelector.$error" show-validation-on-submit>
|
||||
<span class="db umb-list-item__description umb-list-item__description--checkbox text-error" ng-message="valServerField">{{publishVariantSelectorForm.publishVariantSelector.errorMsg}}</span>
|
||||
</span>
|
||||
|
||||
<umb-variant-notification-list notifications="variant.notifications"></umb-variant-notification-list>
|
||||
<span class="umb-variant-selector-entry__title">
|
||||
<span ng-bind="variant.displayName"></span>
|
||||
<strong ng-if="variant.isMandatory" class="umb-control-required">*</strong>
|
||||
</span>
|
||||
</div>
|
||||
<span class="umb-variant-selector-entry__description" ng-if="!publishVariantSelectorForm.publishVariantSelector.$invalid && !(variant.notifications && variant.notifications.length > 0)">
|
||||
<umb-variant-state variant="variant"></umb-variant-state>
|
||||
<span ng-if="variant.isMandatory"> - </span>
|
||||
<span ng-if="variant.isMandatory" ng-class="{'text-error': (variant.publish === false) }"><localize key="languages_mandatoryLanguage"></localize></span>
|
||||
</span>
|
||||
<span class="umb-variant-selector-entry__description" ng-messages="publishVariantSelectorForm.publishVariantSelector.$error" show-validation-on-submit>
|
||||
<span class="text-error" ng-message="valServerField">{{publishVariantSelectorForm.publishVariantSelector.errorMsg}}</span>
|
||||
</span>
|
||||
|
||||
</umb-checkbox>
|
||||
|
||||
<umb-variant-notification-list notifications="variant.notifications"></umb-variant-notification-list>
|
||||
</div>
|
||||
|
||||
</ng-form>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
vm.changeSelection = changeSelection;
|
||||
vm.dirtyVariantFilter = dirtyVariantFilter;
|
||||
vm.pristineVariantFilter = pristineVariantFilter;
|
||||
|
||||
function changeSelection(variant) {
|
||||
var firstSelected = _.find(vm.variants, function (v) {
|
||||
@@ -23,14 +22,9 @@
|
||||
//determine a variant is 'dirty' (meaning it will show up as save-able) if it's
|
||||
// * the active one
|
||||
// * it's editor is in a $dirty state
|
||||
// * it is in NotCreated state
|
||||
return (variant.active || variant.isDirty);
|
||||
}
|
||||
|
||||
function pristineVariantFilter(variant) {
|
||||
return !(dirtyVariantFilter(variant));
|
||||
}
|
||||
|
||||
function hasAnyData(variant) {
|
||||
if(variant.name == null || variant.name.length === 0) {
|
||||
return false;
|
||||
@@ -64,10 +58,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
vm.hasPristineVariants = false;
|
||||
|
||||
_.each(vm.variants,
|
||||
function (variant) {
|
||||
|
||||
//reset state:
|
||||
variant.save = false;
|
||||
variant.publish = false;
|
||||
|
||||
if(variant.state !== "NotCreated"){
|
||||
vm.isNew = false;
|
||||
}
|
||||
@@ -78,31 +75,40 @@
|
||||
variant.compositeId = contentEditingHelper.buildCompositeVariantId(variant);
|
||||
variant.htmlId = "_content_variant_" + variant.compositeId;
|
||||
|
||||
//check for pristine variants
|
||||
if (!vm.hasPristineVariants) {
|
||||
vm.hasPristineVariants = pristineVariantFilter(variant);
|
||||
}
|
||||
|
||||
if(vm.isNew && hasAnyData(variant)){
|
||||
variant.save = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (vm.variants.length !== 0) {
|
||||
//now sort it so that the current one is at the top
|
||||
vm.variants = _.sortBy(vm.variants, function (v) {
|
||||
return v.active ? 0 : 1;
|
||||
|
||||
vm.variants = vm.variants.sort(function (a, b) {
|
||||
if (a.language && b.language) {
|
||||
if (a.language.name > b.language.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.language.name < b.language.name) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (a.segment && b.segment) {
|
||||
if (a.segment > b.segment) {
|
||||
return -1;
|
||||
}
|
||||
if (a.segment < b.segment) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
var active = _.find(vm.variants, function (v) {
|
||||
return v.active;
|
||||
|
||||
_.find(vm.variants, function (v) {
|
||||
if(v.active) {
|
||||
//ensure that the current one is selected
|
||||
v.save = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (active) {
|
||||
//ensure that the current one is selected
|
||||
active.save = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
//disable save button if we have nothing to save
|
||||
$scope.model.disableSubmitButton = true;
|
||||
|
||||
@@ -46,31 +46,5 @@
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
<div class="umb-list umb-list--condensed" ng-if="vm.hasPristineVariants">
|
||||
<div class="bold mb3">
|
||||
<p>
|
||||
<localize ng-if="!vm.isNew" key="content_unmodifiedLanguages"></localize>
|
||||
<localize ng-if="vm.isNew" key="content_untouchedLanguagesForFirstTime"></localize>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="umb-list-item" ng-repeat="variant in vm.variants | filter:vm.pristineVariantFilter">
|
||||
<div>
|
||||
<div style="margin-bottom: 2px;">
|
||||
<span>{{ variant.language.name }}</span>
|
||||
<strong ng-if="variant.language.isMandatory" class="umb-control-required">*</strong>
|
||||
</div>
|
||||
|
||||
<div ng-if="!(variant.notifications && variant.notifications.length > 0)">
|
||||
<umb-variant-state class="umb-list-item__description" variant="variant"></umb-variant-state>
|
||||
</div>
|
||||
|
||||
<div ng-repeat="notification in variant.notifications">
|
||||
<div class="umb-list-item__description text-success">{{notification.message}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,9 +54,25 @@
|
||||
}
|
||||
});
|
||||
|
||||
//now sort it so that the current one is at the top
|
||||
vm.variants = _.sortBy(vm.variants, function (v) {
|
||||
return v.active ? 0 : 1;
|
||||
|
||||
vm.variants = vm.variants.sort(function (a, b) {
|
||||
if (a.language && b.language) {
|
||||
if (a.language.name > b.language.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.language.name < b.language.name) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (a.segment && b.segment) {
|
||||
if (a.segment > b.segment) {
|
||||
return -1;
|
||||
}
|
||||
if (a.segment < b.segment) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
var active = _.find(vm.variants, function (v) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div ng-controller="Umbraco.Overlays.ScheduleContentController as vm">
|
||||
<div ng-controller="Umbraco.Overlays.ScheduleContentController as vm" class="umb-variant-selector-overlay">
|
||||
|
||||
<!-- invariant nodes -->
|
||||
<div ng-if="vm.variants.length === 1">
|
||||
@@ -86,23 +86,28 @@
|
||||
|
||||
<div class="umb-list-item" ng-repeat="variant in vm.variants">
|
||||
<ng-form name="scheduleSelectorForm" style="width:100%;">
|
||||
<div ng-class="{'umb-list-item--error': scheduleSelectorForm.saveVariantReleaseDate.$invalid}">
|
||||
<div class="umb-variant-selector-entry" ng-class="{'umb-list-item--error': scheduleSelectorForm.saveVariantReleaseDate.$invalid}">
|
||||
|
||||
<umb-checkbox
|
||||
input-id="{{'saveVariantSelector_' + variant.language.culture}}"
|
||||
name="saveVariantSelector"
|
||||
model="variant.save"
|
||||
on-change="vm.changeSelection(variant)"
|
||||
text="{{variant.language.name}}"
|
||||
/>
|
||||
>
|
||||
<span class="umb-variant-selector-entry__title">
|
||||
<span ng-bind="variant.displayName"></span>
|
||||
<strong ng-if="variant.isMandatory" class="umb-control-required">*</strong>
|
||||
</span>
|
||||
<span class="umb-variant-selector-entry__description"
|
||||
ng-if="!scheduleSelectorForm.$invalid && !(variant.notifications && variant.notifications.length > 0)">
|
||||
<umb-variant-state variant="variant"></umb-variant-state>
|
||||
<span ng-show="variant.language.isMandatory"> - <localize key="languages_mandatoryLanguage"></localize></span>
|
||||
</span>
|
||||
</umb-checkbox>
|
||||
|
||||
<div>
|
||||
|
||||
<span class="db umb-list-item__description umb-list-item__description--checkbox"
|
||||
ng-if="!scheduleSelectorForm.$invalid && !(variant.notifications && variant.notifications.length > 0)">
|
||||
<umb-variant-state variant="variant"></umb-variant-state>
|
||||
<span ng-show="variant.language.isMandatory"> - <localize key="languages_mandatoryLanguage"></localize></span>
|
||||
</span>
|
||||
|
||||
|
||||
<div class="date-wrapper-mini date-wrapper-mini--checkbox">
|
||||
<div class="date-wrapper-mini__date" ng-if="vm.dirtyVariantFilter(variant) && (variant.releaseDate || variant.save)">
|
||||
@@ -117,7 +122,7 @@
|
||||
on-open="vm.datePickerShow(variant, 'publish')"
|
||||
on-close="vm.datePickerClose(variant, 'publish')">
|
||||
<div>
|
||||
<button ng-show="variant.releaseDate" class="btn umb-button--xxs" style="outline: none;">
|
||||
<button ng-show="variant.releaseDate" class="btn umb-button--xxs btn-outline umb-outline">
|
||||
{{variant.releaseDateFormatted}}
|
||||
</button>
|
||||
|
||||
@@ -126,9 +131,9 @@
|
||||
</a>
|
||||
</div>
|
||||
</umb-date-time-picker>
|
||||
<a ng-show="variant.releaseDate" ng-click="vm.clearPublishDate(variant)" class="btn umb-button--xxs dropdown-toggle umb-button-group__toggle" style="margin-left: -2px;">
|
||||
<button ng-show="variant.releaseDate" ng-click="vm.clearPublishDate(variant)" class="btn umb-button--xxs dropdown-toggle umb-button-group__toggle btn-outline umb-outline" style="margin-left: -2px;">
|
||||
<span class="icon icon-wrong"></span>
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -143,7 +148,7 @@
|
||||
on-open="vm.datePickerShow(variant, 'unpublish')"
|
||||
on-close="vm.datePickerClose(variant, 'unpublish')">
|
||||
<div>
|
||||
<button ng-show="variant.expireDate" class="btn umb-button--xxs" style="outline: none;">
|
||||
<button ng-show="variant.expireDate" class="btn umb-button--xxs btn-outline umb-outline">
|
||||
{{variant.expireDateFormatted}}
|
||||
</button>
|
||||
|
||||
@@ -152,7 +157,7 @@
|
||||
</a>
|
||||
</div>
|
||||
</umb-date-time-picker>
|
||||
<a ng-show="variant.expireDate" ng-click="vm.clearUnpublishDate(variant)" class="btn umb-button--xxs dropdown-toggle umb-button-group__toggle" style="margin-left: -2px;">
|
||||
<a ng-show="variant.expireDate" ng-click="vm.clearUnpublishDate(variant)" class="btn umb-button--xxs dropdown-toggle umb-button-group__toggle btn-outline umb-outline" style="margin-left: -2px;">
|
||||
<span class="icon icon-wrong"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
$scope.model.title = value;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (vm.variants.length !== 0) {
|
||||
_.each(vm.variants,
|
||||
function (variant) {
|
||||
@@ -29,9 +28,24 @@
|
||||
variant.htmlId = "_content_variant_" + variant.compositeId;
|
||||
});
|
||||
|
||||
//now sort it so that the current one is at the top
|
||||
vm.variants = _.sortBy(vm.variants, function (v) {
|
||||
return v.active ? 0 : 1;
|
||||
vm.variants = vm.variants.sort(function (a, b) {
|
||||
if (a.language && b.language) {
|
||||
if (a.language.name > b.language.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.language.name < b.language.name) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (a.segment && b.segment) {
|
||||
if (a.segment > b.segment) {
|
||||
return -1;
|
||||
}
|
||||
if (a.segment < b.segment) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
var active = _.find(vm.variants, function (v) {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
vm.changeSelection = changeSelection;
|
||||
vm.publishedVariantFilter = publishedVariantFilter;
|
||||
vm.unpublishedVariantFilter = unpublishedVariantFilter;
|
||||
|
||||
function onInit() {
|
||||
|
||||
@@ -29,16 +28,32 @@
|
||||
|
||||
// node has variants
|
||||
if (vm.variants.length !== 1) {
|
||||
//now sort it so that the current one is at the top
|
||||
vm.variants = _.sortBy(vm.variants, function (v) {
|
||||
return v.active ? 0 : 1;
|
||||
|
||||
vm.variants = vm.variants.sort(function (a, b) {
|
||||
if (a.language && b.language) {
|
||||
if (a.language.name > b.language.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.language.name < b.language.name) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (a.segment && b.segment) {
|
||||
if (a.segment > b.segment) {
|
||||
return -1;
|
||||
}
|
||||
if (a.segment < b.segment) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
var active = _.find(vm.variants, function (v) {
|
||||
return v.active;
|
||||
});
|
||||
|
||||
if (active) {
|
||||
if (active && publishedVariantFilter(active)) {
|
||||
//ensure that the current one is selected
|
||||
active.save = true;
|
||||
}
|
||||
@@ -51,21 +66,15 @@
|
||||
|
||||
function changeSelection(selectedVariant) {
|
||||
|
||||
// disable submit button if nothing is selected
|
||||
var firstSelected = _.find(vm.variants, function (v) {
|
||||
return v.save;
|
||||
});
|
||||
$scope.model.disableSubmitButton = !firstSelected; //disable submit button if there is none selected
|
||||
|
||||
// if a mandatory variant is selected we want to select all other variants
|
||||
// if a mandatory variant is selected we want to select all other variants, we cant have anything published if a mandatory variants gets unpublished.
|
||||
// and disable selection for the others
|
||||
if(selectedVariant.save && selectedVariant.language.isMandatory) {
|
||||
if(selectedVariant.save && selectedVariant.segment == null && selectedVariant.language && selectedVariant.language.isMandatory) {
|
||||
|
||||
angular.forEach(vm.variants, function(variant){
|
||||
if(!variant.save && publishedVariantFilter(variant)) {
|
||||
if(!variant.save) {
|
||||
// keep track of the variants we automaically select
|
||||
// so we can remove the selection again
|
||||
autoSelectedVariants.push(variant.language.culture);
|
||||
autoSelectedVariants.push(variant);
|
||||
variant.save = true;
|
||||
}
|
||||
variant.disabled = true;
|
||||
@@ -79,12 +88,12 @@
|
||||
// if a mandatory variant is deselected we want to deselet all the variants
|
||||
// that was automatically selected so it goes back to the state before the mandatory language was selected.
|
||||
// We also want to enable all checkboxes again
|
||||
if(!selectedVariant.save && selectedVariant.language.isMandatory) {
|
||||
if(!selectedVariant.save && selectedVariant.segment == null && selectedVariant.language && selectedVariant.language.isMandatory) {
|
||||
|
||||
angular.forEach(vm.variants, function(variant){
|
||||
|
||||
// check if variant was auto selected, then deselect
|
||||
if(_.contains(autoSelectedVariants, variant.language.culture)) {
|
||||
if(_.contains(autoSelectedVariants, variant)) {
|
||||
variant.save = false;
|
||||
};
|
||||
|
||||
@@ -93,6 +102,12 @@
|
||||
autoSelectedVariants = [];
|
||||
}
|
||||
|
||||
// disable submit button if nothing is selected
|
||||
var firstSelected = _.find(vm.variants, function (v) {
|
||||
return v.save;
|
||||
});
|
||||
$scope.model.disableSubmitButton = !firstSelected; //disable submit button if there is none selected
|
||||
|
||||
}
|
||||
|
||||
function publishedVariantFilter(variant) {
|
||||
@@ -102,13 +117,6 @@
|
||||
return (variant.state === "Published" || variant.state === "PublishedPendingChanges");
|
||||
}
|
||||
|
||||
function unpublishedVariantFilter(variant) {
|
||||
//determine a variant is 'modified' (meaning it will NOT show up as able to unpublish)
|
||||
// * it's editor is in a $dirty state
|
||||
// * it is published with pending changes
|
||||
return (variant.state !== "Published" && variant.state !== "PublishedPendingChanges");
|
||||
}
|
||||
|
||||
//when this dialog is closed, remove all unpublish and disabled flags
|
||||
$scope.$on('$destroy', function () {
|
||||
for (var i = 0; i < vm.variants.length; i++) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div ng-controller="Umbraco.Overlays.UnpublishController as vm">
|
||||
<div ng-controller="Umbraco.Overlays.UnpublishController as vm" class="umb-variant-selector-overlay">
|
||||
|
||||
<!-- Single language -->
|
||||
<div ng-if="vm.variants.length === 1">
|
||||
@@ -10,12 +10,12 @@
|
||||
<div style="margin-bottom: 15px;">
|
||||
<p><localize key="content_languagesToUnpublish"></localize></p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="umb-list umb-list--condensed">
|
||||
|
||||
|
||||
<div class="umb-list-item" ng-repeat="variant in vm.variants | filter:vm.publishedVariantFilter">
|
||||
<ng-form name="unpublishVariantSelectorForm">
|
||||
<div>
|
||||
<div class="umb-variant-selector-entry" ng-class="{'umb-list-item--error': unpublishVariantSelectorForm.unpublishVariantSelector.$invalid}">
|
||||
|
||||
<umb-checkbox
|
||||
input-id="{{variant.htmlId}}"
|
||||
@@ -24,41 +24,30 @@
|
||||
on-change="vm.changeSelection(variant)"
|
||||
disabled="variant.disabled"
|
||||
server-validation-field="{{variant.htmlId}}"
|
||||
text="{{ variant.language.name }}"
|
||||
/>
|
||||
|
||||
<div>
|
||||
<span class="db umb-list-item__description umb-list-item__description--checkbox">
|
||||
<umb-variant-state variant="variant"></umb-variant-state>
|
||||
<span ng-if="variant.language.isMandatory"> - <localize key="languages_mandatoryLanguage"></localize></span>
|
||||
>
|
||||
<span class="umb-variant-selector-entry__title">
|
||||
<span ng-bind="variant.displayName"></span>
|
||||
<strong ng-if="variant.isMandatory" class="umb-control-required">*</strong>
|
||||
</span>
|
||||
</div>
|
||||
<span class="umb-variant-selector-entry__description" ng-if="!publishVariantSelectorForm.publishVariantSelector.$invalid && !(variant.notifications && variant.notifications.length > 0)">
|
||||
<umb-variant-state variant="variant"></umb-variant-state>
|
||||
<span ng-if="variant.isMandatory"> - </span>
|
||||
<span ng-if="variant.isMandatory" ng-class="{'text-error': (variant.publish === false) }"><localize key="languages_mandatoryLanguage"></localize></span>
|
||||
</span>
|
||||
<span class="umb-variant-selector-entry__description" ng-messages="publishVariantSelectorForm.publishVariantSelector.$error" show-validation-on-submit>
|
||||
<span class="text-error" ng-message="valServerField">{{publishVariantSelectorForm.publishVariantSelector.errorMsg}}</span>
|
||||
</span>
|
||||
</umb-checkbox>
|
||||
|
||||
<umb-variant-notification-list notifications="variant.notifications"></umb-variant-notification-list>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</ng-form>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div class="umb-list umb-list--condensed" ng-if="!vm.loading && (vm.variants | filter:vm.unpublishedVariantFilter).length > 0">
|
||||
<div class="bold mb3">
|
||||
<p><localize key="content_unpublishedLanguages"></localize></p>
|
||||
</div>
|
||||
|
||||
<div class="umb-list-item" ng-repeat="variant in vm.variants | filter:vm.unpublishedVariantFilter">
|
||||
<div>
|
||||
<div style="margin-bottom: 2px;">
|
||||
<span>{{ variant.language.name }}</span>
|
||||
<strong ng-if="variant.language.isMandatory" class="umb-control-required">*</strong>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<umb-variant-state class="umb-list-item__description" variant="variant"></umb-variant-state>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -250,8 +250,8 @@
|
||||
<key alias="published">Published</key>
|
||||
<key alias="publishedPendingChanges">Published (pending changes)</key>
|
||||
<key alias="publishStatus">Publication Status</key>
|
||||
<key alias="publishDescendantsHelp"><![CDATA[Click <em>Publish with descendants</em> to publish <strong>%0%</strong> and all content items underneath and thereby making their content publicly available.]]></key>
|
||||
<key alias="publishDescendantsWithVariantsHelp"><![CDATA[Click <em>Publish with descendants</em> to publish <strong>the selected languages</strong> and the same languages of content items underneath and thereby making their content publicly available.]]></key>
|
||||
<key alias="publishDescendantsHelp"><![CDATA[Publish <strong>%0%</strong> and all content items underneath and thereby making their content publicly available.]]></key>
|
||||
<key alias="publishDescendantsWithVariantsHelp"><![CDATA[Publish variants and variants of same type underneath and thereby making their content publicly available.]]></key>
|
||||
<key alias="releaseDate">Publish at</key>
|
||||
<key alias="unpublishDate">Unpublish at</key>
|
||||
<key alias="removeDate">Clear Date</key>
|
||||
@@ -288,7 +288,7 @@
|
||||
<key alias="addTextBox">Add another text box</key>
|
||||
<key alias="removeTextBox">Remove this text box</key>
|
||||
<key alias="contentRoot">Content root</key>
|
||||
<key alias="includeUnpublished">Include drafts: also publish unpublished content items.</key>
|
||||
<key alias="includeUnpublished">Include drafts and unpublished content items.</key>
|
||||
<key alias="isSensitiveValue">This value is hidden. If you need access to view this value please contact your website administrator.</key>
|
||||
<key alias="isSensitiveValue_short">This value is hidden.</key>
|
||||
<key alias="languagesToPublishForFirstTime">What languages would you like to publish? All languages with content are saved!</key>
|
||||
@@ -312,7 +312,7 @@
|
||||
<key alias="publishRequiresVariants">The following variants is required for publishing to take place:</key>
|
||||
|
||||
<key alias="notReadyToPublish">We are not ready to Publish</key>
|
||||
<key alias="readyToPublish">Save and Publish</key>
|
||||
<key alias="readyToPublish">Ready to publish?</key>
|
||||
<key alias="readyToSave">Ready to Save?</key>
|
||||
<key alias="sendForApproval">Send for approval</key>
|
||||
<key alias="schedulePublishHelp">Select the date and time to publish and/or unpublish the content item.</key>
|
||||
|
||||
@@ -253,8 +253,8 @@
|
||||
<key alias="published">Published</key>
|
||||
<key alias="publishedPendingChanges">Published (pending changes)</key>>
|
||||
<key alias="publishStatus">Publication Status</key>
|
||||
<key alias="publishDescendantsHelp"><![CDATA[Click <em>Publish with descendants</em> to publish <strong>%0%</strong> and all content items underneath and thereby making their content publicly available.]]></key>
|
||||
<key alias="publishDescendantsWithVariantsHelp"><![CDATA[Click <em>Publish with descendants</em> to publish <strong>the selected languages</strong> and the same languages of content items underneath and thereby making their content publicly available.]]></key>
|
||||
<key alias="publishDescendantsHelp"><![CDATA[Publish <strong>%0%</strong> and all content items underneath and thereby making their content publicly available.]]></key>
|
||||
<key alias="publishDescendantsWithVariantsHelp"><![CDATA[Publish variants and variants of same type underneath and thereby making their content publicly available.]]></key>
|
||||
<key alias="releaseDate">Publish at</key>
|
||||
<key alias="unpublishDate">Unpublish at</key>
|
||||
<key alias="removeDate">Clear Date</key>
|
||||
@@ -292,7 +292,7 @@
|
||||
<key alias="addTextBox">Add another text box</key>
|
||||
<key alias="removeTextBox">Remove this text box</key>
|
||||
<key alias="contentRoot">Content root</key>
|
||||
<key alias="includeUnpublished">Include drafts: also publish unpublished content items.</key>
|
||||
<key alias="includeUnpublished">Include drafts and unpublished content items.</key>
|
||||
<key alias="isSensitiveValue">This value is hidden. If you need access to view this value please contact your website administrator.</key>
|
||||
<key alias="isSensitiveValue_short">This value is hidden.</key>
|
||||
<key alias="languagesToPublishForFirstTime">What languages would you like to publish? All languages with content are saved!</key>
|
||||
@@ -316,7 +316,7 @@
|
||||
<key alias="publishRequiresVariants">The following variants is required for publishing to take place:</key>
|
||||
|
||||
<key alias="notReadyToPublish">We are not ready to Publish</key>
|
||||
<key alias="readyToPublish">Save and Publish</key>
|
||||
<key alias="readyToPublish">Ready to publish?</key>
|
||||
<key alias="readyToSave">Ready to Save?</key>
|
||||
<key alias="sendForApproval">Send for approval</key>
|
||||
<key alias="schedulePublishHelp">Select the date and time to publish and/or unpublish the content item.</key>
|
||||
|
||||
Reference in New Issue
Block a user