manually merges list view changes with new blueprint functionality, manually merges other files, fixes issue with Action drop down in v8
This commit is contained in:
@@ -80,6 +80,7 @@
|
||||
line-height: @baseLineHeight;
|
||||
color: @dropdownLinkColor;
|
||||
white-space: nowrap;
|
||||
cursor:pointer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
});
|
||||
|
||||
//special check for a comma in the name
|
||||
newVal += files[i].name.replace(',', '-') + ",";
|
||||
newVal += files[i].name.split(',').join('-') + ",";
|
||||
|
||||
if (isImage) {
|
||||
|
||||
|
||||
@@ -307,12 +307,12 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
|
||||
navInit = true;
|
||||
initNav();
|
||||
}
|
||||
else {
|
||||
//keep track of the current section, when it changes change the state, and we listen for that event change above
|
||||
if ($scope.currentSection != $routeParams.section) {
|
||||
appState.setSectionState("currentSection", $routeParams.section);
|
||||
}
|
||||
|
||||
//keep track of the current section when it changes
|
||||
if ($scope.currentSection != $routeParams.section) {
|
||||
appState.setSectionState("currentSection", $routeParams.section);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -373,8 +373,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
|
||||
|
||||
//the nav is ready, let the app know
|
||||
eventsService.emit("app.navigationReady", { treeApi: $scope.treeApi });
|
||||
//finally set the section state
|
||||
appState.setSectionState("currentSection", $routeParams.section);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,12 +32,10 @@
|
||||
no-dirty-check />
|
||||
|
||||
<div class="form-search__toggle">
|
||||
<input type="checkbox" ng-model="showChilds" ng-change="toggle()" />
|
||||
<label>
|
||||
<localize key="general_includeFromsubFolders">Include subfolders in search</localize>
|
||||
</label>
|
||||
<umb-toggle checked="showChilds"
|
||||
on-click="toggle()">
|
||||
</umb-toggle>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -72,11 +72,10 @@
|
||||
<umb-editor-menu
|
||||
data-element="editor-actions"
|
||||
current-node="menu.currentNode"
|
||||
current-section="{{menu.currentNode.section}}">
|
||||
current-section="{{menu.currentSection}}">
|
||||
</umb-editor-menu>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function listViewController($scope, $routeParams, $injector, $timeout, currentUserResource, notificationsService, iconHelper, editorState, localizationService, appState, mediaResource, listViewHelper, navigationService, editorService, overlayService, languageResource) {
|
||||
function listViewController($scope, $routeParams, $injector, $timeout, currentUserResource, notificationsService, iconHelper, editorState, localizationService, appState, $location, listViewHelper, navigationService, editorService, overlayService, languageResource) {
|
||||
|
||||
//this is a quick check to see if we're in create mode, if so just exit - we cannot show children for content
|
||||
// that isn't created yet, if we continue this will use the parent id in the route params which isn't what
|
||||
@@ -59,9 +59,9 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
items: []
|
||||
};
|
||||
|
||||
$scope.createAllowedButtonSingle = false;
|
||||
$scope.createAllowedButtonSingleWithBlueprints = false;
|
||||
$scope.createAllowedButtonMultiWithBlueprints = false;
|
||||
$scope.createAllowedButtonSingle = false;
|
||||
$scope.createAllowedButtonSingleWithBlueprints = false;
|
||||
$scope.createAllowedButtonMultiWithBlueprints = false;
|
||||
|
||||
|
||||
//when this is null, we don't check permissions
|
||||
@@ -164,7 +164,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
allowBulkDelete: $scope.model.config.bulkActionPermissions.allowBulkDelete,
|
||||
cultureName: $routeParams.cculture ? $routeParams.cculture : $routeParams.mculture
|
||||
};
|
||||
|
||||
|
||||
//watch for culture changes in the query strings and update accordingly
|
||||
$scope.$watch(function () {
|
||||
return $routeParams.cculture ? $routeParams.cculture : $routeParams.mculture;
|
||||
@@ -235,7 +235,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
if (successMsgPromise) {
|
||||
localizationService.localize("bulk_done")
|
||||
.then(function (v) {
|
||||
successMsgPromise.then(function(successMsg) {
|
||||
successMsgPromise.then(function (successMsg) {
|
||||
notificationsService.success(v, successMsg);
|
||||
})
|
||||
});
|
||||
@@ -263,11 +263,11 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
with simple values */
|
||||
|
||||
$scope.getContent = function (contentId) {
|
||||
|
||||
|
||||
$scope.reloadView($scope.contentId);
|
||||
}
|
||||
|
||||
$scope.reloadView = function (id) {
|
||||
$scope.reloadView = function (id) {
|
||||
$scope.viewLoaded = false;
|
||||
$scope.folders = [];
|
||||
|
||||
@@ -282,13 +282,13 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
if ($scope.listViewResultSet.items) {
|
||||
_.each($scope.listViewResultSet.items, function (e, index) {
|
||||
setPropertyValues(e);
|
||||
if (e.contentTypeAlias === 'Folder') {
|
||||
$scope.folders.push(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (e.contentTypeAlias === 'Folder') {
|
||||
$scope.folders.push(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$scope.viewLoaded = true;
|
||||
$scope.viewLoaded = true;
|
||||
|
||||
//NOTE: This might occur if we are requesting a higher page number than what is actually available, for example
|
||||
// if you have more than one page and you delete all items on the last page. In this case, we need to reset to the last
|
||||
@@ -329,7 +329,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
$scope.reloadView($scope.contentId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$scope.selectedItemsCount = function () {
|
||||
return $scope.selection.length;
|
||||
};
|
||||
@@ -345,7 +345,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
function serial(selected, fn, getStatusMsg, index) {
|
||||
return fn(selected, index).then(function (content) {
|
||||
index++;
|
||||
getStatusMsg(index, selected.length).then(function(value) {
|
||||
getStatusMsg(index, selected.length).then(function (value) {
|
||||
$scope.bulkStatus = value;
|
||||
});
|
||||
return index < selected.length ? serial(selected, fn, getStatusMsg, index) : content;
|
||||
@@ -365,7 +365,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
|
||||
$scope.actionInProgress = true;
|
||||
|
||||
getStatusMsg(0, selected.length).then(function(value){
|
||||
getStatusMsg(0, selected.length).then(function (value) {
|
||||
$scope.bulkStatus = value;
|
||||
});
|
||||
|
||||
@@ -409,7 +409,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
function (total) {
|
||||
var key = (total === 1 ? "bulk_deletedItem" : "bulk_deletedItems");
|
||||
return localizationService.localize(key, [total]);
|
||||
}).then(function() {
|
||||
}).then(function () {
|
||||
$scope.reloadView($scope.contentId);
|
||||
});
|
||||
}
|
||||
@@ -420,7 +420,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
// check if any of the selected nodes has variants
|
||||
$scope.selection.forEach(selectedItem => {
|
||||
$scope.listViewResultSet.items.forEach(resultItem => {
|
||||
if((selectedItem.id === resultItem.id || selectedItem.key === resultItem.key) && resultItem.variesByCulture) {
|
||||
if ((selectedItem.id === resultItem.id || selectedItem.key === resultItem.key) && resultItem.variesByCulture) {
|
||||
variesByCulture = true;
|
||||
}
|
||||
})
|
||||
@@ -437,9 +437,9 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
submit: function (model) {
|
||||
// create a comma seperated array of selected cultures
|
||||
let selectedCultures = [];
|
||||
if(model.languages && model.languages.length > 0) {
|
||||
if (model.languages && model.languages.length > 0) {
|
||||
model.languages.forEach(language => {
|
||||
if(language.publish) {
|
||||
if (language.publish) {
|
||||
selectedCultures.push(language.culture);
|
||||
}
|
||||
});
|
||||
@@ -451,12 +451,12 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
overlayService.close();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// if any of the selected nodes has variants we want to
|
||||
// show a dialog where the languages can be chosen
|
||||
if(selectionHasVariants()) {
|
||||
if (selectionHasVariants()) {
|
||||
languageResource.getAll()
|
||||
.then(languages => {
|
||||
.then(languages => {
|
||||
dialog.languages = languages;
|
||||
overlayService.open(dialog);
|
||||
}, error => {
|
||||
@@ -478,7 +478,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
function (total) {
|
||||
var key = (total === 1 ? "bulk_publishedItem" : "bulk_publishedItems");
|
||||
return localizationService.localize(key, [total]);
|
||||
}).then(function(){
|
||||
}).then(function () {
|
||||
$scope.reloadView($scope.contentId);
|
||||
});
|
||||
}
|
||||
@@ -489,12 +489,12 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
view: "views/propertyeditors/listview/overlays/listviewunpublish.html",
|
||||
submitButtonLabelKey: "actions_unpublish",
|
||||
submit: function (model) {
|
||||
|
||||
|
||||
// create a comma seperated array of selected cultures
|
||||
let selectedCultures = [];
|
||||
if(model.languages && model.languages.length > 0) {
|
||||
if (model.languages && model.languages.length > 0) {
|
||||
model.languages.forEach(language => {
|
||||
if(language.unpublish) {
|
||||
if (language.unpublish) {
|
||||
selectedCultures.push(language.culture);
|
||||
}
|
||||
});
|
||||
@@ -510,9 +510,9 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
|
||||
// if any of the selected nodes has variants we want to
|
||||
// show a dialog where the languages can be chosen
|
||||
if(selectionHasVariants()) {
|
||||
if (selectionHasVariants()) {
|
||||
languageResource.getAll()
|
||||
.then(languages => {
|
||||
.then(languages => {
|
||||
dialog.languages = languages;
|
||||
overlayService.open(dialog);
|
||||
}, error => {
|
||||
@@ -534,7 +534,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
function (total) {
|
||||
var key = (total === 1 ? "bulk_unpublishedItem" : "bulk_unpublishedItems");
|
||||
return localizationService.localize(key, [total]);
|
||||
}).then(function(){
|
||||
}).then(function () {
|
||||
$scope.reloadView($scope.contentId);
|
||||
});
|
||||
}
|
||||
@@ -700,27 +700,26 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
id = -1;
|
||||
}
|
||||
|
||||
//$scope.listViewAllowedTypes = getContentTypesCallback(id);
|
||||
getContentTypesCallback(id).then(function (listViewAllowedTypes) {
|
||||
var blueprints = false;
|
||||
$scope.listViewAllowedTypes = listViewAllowedTypes;
|
||||
getContentTypesCallback(id).then(function (listViewAllowedTypes) {
|
||||
var blueprints = false;
|
||||
$scope.listViewAllowedTypes = listViewAllowedTypes;
|
||||
|
||||
angular.forEach(listViewAllowedTypes, function (allowedType) {
|
||||
angular.forEach(allowedType.blueprints, function (value, key) {
|
||||
blueprints = true;
|
||||
});
|
||||
});
|
||||
angular.forEach(listViewAllowedTypes, function (allowedType) {
|
||||
angular.forEach(allowedType.blueprints, function (value, key) {
|
||||
blueprints = true;
|
||||
});
|
||||
});
|
||||
|
||||
if (listViewAllowedTypes.length === 1 && blueprints === false) {
|
||||
$scope.createAllowedButtonSingle = true;
|
||||
}
|
||||
if (listViewAllowedTypes.length === 1 && blueprints === true) {
|
||||
$scope.createAllowedButtonSingleWithBlueprints = true;
|
||||
}
|
||||
if (listViewAllowedTypes.length > 1) {
|
||||
$scope.createAllowedButtonMultiWithBlueprints = true;
|
||||
}
|
||||
});
|
||||
if (listViewAllowedTypes.length === 1 && blueprints === false) {
|
||||
$scope.createAllowedButtonSingle = true;
|
||||
}
|
||||
if (listViewAllowedTypes.length === 1 && blueprints === true) {
|
||||
$scope.createAllowedButtonSingleWithBlueprints = true;
|
||||
}
|
||||
if (listViewAllowedTypes.length > 1) {
|
||||
$scope.createAllowedButtonMultiWithBlueprints = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$scope.contentId = id;
|
||||
@@ -735,7 +734,7 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
$scope.options.allowBulkMove ||
|
||||
$scope.options.allowBulkDelete;
|
||||
|
||||
$scope.reloadView($scope.contentId);
|
||||
$scope.reloadView($scope.contentId);
|
||||
}
|
||||
|
||||
function getLocalizedKey(alias) {
|
||||
@@ -774,20 +773,20 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
}
|
||||
|
||||
|
||||
function createBlank(entityType,docTypeAlias) {
|
||||
$location
|
||||
.path("/" + entityType + "/" + entityType + "/edit/" + $scope.contentId)
|
||||
.search("doctype=" + docTypeAlias + "&create=true");
|
||||
}
|
||||
function createBlank(entityType, docTypeAlias) {
|
||||
$location
|
||||
.path("/" + entityType + "/" + entityType + "/edit/" + $scope.contentId)
|
||||
.search("doctype=" + docTypeAlias + "&create=true");
|
||||
}
|
||||
|
||||
function createFromBlueprint(entityType,docTypeAlias, blueprintId) {
|
||||
$location
|
||||
.path("/" + entityType + "/" + entityType + "/edit/" + $scope.contentId)
|
||||
.search("doctype=" + docTypeAlias + "&create=true&blueprintId=" + blueprintId);
|
||||
}
|
||||
function createFromBlueprint(entityType, docTypeAlias, blueprintId) {
|
||||
$location
|
||||
.path("/" + entityType + "/" + entityType + "/edit/" + $scope.contentId)
|
||||
.search("doctype=" + docTypeAlias + "&create=true&blueprintId=" + blueprintId);
|
||||
}
|
||||
|
||||
$scope.createBlank = createBlank;
|
||||
$scope.createFromBlueprint = createFromBlueprint;
|
||||
$scope.createBlank = createBlank;
|
||||
$scope.createFromBlueprint = createFromBlueprint;
|
||||
|
||||
//GO!
|
||||
initView();
|
||||
|
||||
@@ -11,25 +11,73 @@
|
||||
<umb-editor-sub-header-content-left>
|
||||
|
||||
<umb-editor-sub-header-section ng-if="(listViewAllowedTypes && listViewAllowedTypes.length > 0 && (selection.length == 0)) && (currentNodePermissions == null || currentNodePermissions.canCreate)">
|
||||
<div class="btn-group" ng-show="listViewAllowedTypes.length > 1">
|
||||
<a class="btn btn-success dropdown-toggle" ng-click="page.createDropdownOpen = !page.createDropdownOpen" ng-href="">
|
||||
|
||||
<div class="btn-group" ng-show="createAllowedButtonSingle">
|
||||
<a class="btn btn-success" ng-click="createBlank(entityType,listViewAllowedTypes[0].alias)">
|
||||
<localize key="actions_create">Create</localize> {{listViewAllowedTypes[0].name}}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" ng-show="createAllowedButtonSingleWithBlueprints">
|
||||
<a class="btn btn-success dropdown-toggle" data-toggle="dropdown" ng-href="">
|
||||
<span ng-click="createBlank(entityType,listViewAllowedTypes[0].alias)">
|
||||
<localize key="actions_create">Create</localize> {{listViewAllowedTypes[0].name}}
|
||||
</span>
|
||||
<span class="caret" ng-click="page.createDropdownOpen = !page.createDropdownOpen"></span>
|
||||
</a>
|
||||
|
||||
<umb-dropdown ng-if="page.createDropdownOpen" on-close="page.createDropdownOpen = false">
|
||||
<umb-dropdown-item ng-repeat="(key, value) in listViewAllowedTypes[0].blueprints track by key">
|
||||
<a ng-click="createFromBlueprint(entityType, listViewAllowedTypes[0].blueprints.alias, key)">
|
||||
<i class="{{::listViewAllowedTypes[0].icon}}"></i>
|
||||
{{::value}}
|
||||
</a>
|
||||
</umb-dropdown-item>
|
||||
</umb-dropdown>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" ng-show="createAllowedButtonMultiWithBlueprints">
|
||||
<a class="btn btn-success dropdown-toggle" data-toggle="dropdown" ng-href="" ng-click="page.createDropdownOpen = !page.createDropdownOpen">
|
||||
<localize key="actions_create">Create</localize>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
|
||||
<umb-dropdown ng-if="page.createDropdownOpen" on-close="page.createDropdownOpen = false">
|
||||
<umb-dropdown-item ng-repeat="contentType in listViewAllowedTypes track by contentType.key | orderBy:'name':false">
|
||||
<a ng-href="#/{{entityType}}/{{entityType}}/edit/{{contentId}}?doctype={{contentType.alias}}&create=true">
|
||||
{{::contentType.name}}
|
||||
</a>
|
||||
</umb-dropdown-item>
|
||||
</umb-dropdown>
|
||||
</div>
|
||||
<div class="btn-group" ng-show="listViewAllowedTypes.length === 1">
|
||||
<a class="btn btn-success" ng-href="#/{{entityType}}/{{entityType}}/edit/{{contentId}}?doctype={{listViewAllowedTypes[0].alias}}&create=true">
|
||||
<i class="icon-{{listViewAllowedTypes[0].cssClass}}"></i>
|
||||
<localize key="actions_create">Create</localize> {{ listViewAllowedTypes[0].name }}
|
||||
</a>
|
||||
<umb-dropdown-item ng-repeat="contentType in listViewAllowedTypes track by contentType.key | orderBy:'name':false">
|
||||
<a ng-click="createBlank(entityType,contentType.alias)" prevent-default ng-href="">
|
||||
<i class="{{::contentType.icon}}"></i>
|
||||
{{::contentType.name}} <span ng-show="contentType.blueprints && contentType.blueprints.length != 0" style="text-transform: lowercase;">(<localize key="blueprints_blankBlueprint">blank</localize>)</span>
|
||||
</a>
|
||||
<a href="" ng-repeat="(key, value) in contentType.blueprints track by key" ng-click="createFromBlueprint(entityType,contentType.alias , key)" prevent-default>
|
||||
<i class="{{::contentType.icon}}"></i>
|
||||
{{::value}}
|
||||
</a>
|
||||
</umb-dropdown-item>
|
||||
</umb-dropdown>
|
||||
</div>
|
||||
|
||||
<ul class="umb-actions umb-actions-child">
|
||||
|
||||
<li ng-repeat="(key, value) in docType.blueprints | orderBy:'name':false">
|
||||
<a ng-click="createFromBlueprint(key)">
|
||||
<i class="large {{docType.icon}}"></i>
|
||||
<span class="menu-label">
|
||||
{{value}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="sep" ng-show="allowBlank">
|
||||
<a ng-click="createBlank(docType)">
|
||||
<i class="large {{docType.icon}}"></i>
|
||||
<span class="menu-label">
|
||||
<localize key="blueprints_blankBlueprint">Blank</localize>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</umb-editor-sub-header-section>
|
||||
|
||||
<umb-editor-sub-header-section ng-show="(selection.length > 0)">
|
||||
|
||||
Reference in New Issue
Block a user