unpublish by culture

This commit is contained in:
Mads Rasmussen
2018-11-02 10:33:39 +01:00
parent 3f5fc56656
commit ef24440277

View File

@@ -461,9 +461,18 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
view: "views/propertyeditors/listview/overlays/listviewunpublish.html",
submitButtonLabelKey: "actions_unpublish",
submit: function (model) {
console.log(model);
//console.log(model.languages);
performUnpublish();
// create a comma seperated array of selected cultures
let selectedCultures = [];
if(model.languages && model.languages.length > 0) {
model.languages.forEach(language => {
if(language.unpublish) {
selectedCultures.push(language.culture);
}
});
}
performUnpublish(selectedCultures);
overlayService.close();
},
close: function () {
@@ -496,9 +505,9 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
};
function performUnpublish() {
function performUnpublish(cultures) {
applySelected(
function (selected, index) { return contentResource.unpublish(getIdCallback(selected[index])); },
function (selected, index) { return contentResource.unpublish(getIdCallback(selected[index]), cultures); },
function (count, total) {
var key = (total === 1 ? "bulk_unpublishedItemOfItem" : "bulk_unpublishedItemOfItems");
return localizationService.localize(key, [count, total]);