Enables the breadcrumb nav on media edit

This commit is contained in:
perploug
2014-02-24 11:55:54 +01:00
parent 458c51a955
commit 7c4c44cf7e
2 changed files with 16 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
ng-show="loaded"
ng-submit="save()"
val-form-manager>
<umb-panel>
<umb-panel ng-class="'editor-breadcrumb'">
<umb-header tabs="content.tabs">
<div class="span7">
@@ -48,5 +48,12 @@
</umb-tab>
</umb-tab-view>
<ul class="umb-panel-footer-nav nav nav-pills" ng-if="content.parentId">
<li ng-repeat="ancestor in ancestors">
<a href="#/media/media/edit/{{ancestor.id}}">{{ancestor.name}}</a>
</li>
<li></li>
</ul>
</umb-panel>
</form>

View File

@@ -6,7 +6,7 @@
* @description
* The controller for the media editor
*/
function mediaEditController($scope, $routeParams, appState, mediaResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, treeService, formHelper, umbModelMapper, editorState, umbRequestHelper, $http) {
function mediaEditController($scope, $routeParams, appState, mediaResource, entityResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, treeService, formHelper, umbModelMapper, editorState, umbRequestHelper, $http) {
//setup scope vars
$scope.nav = navigationService;
@@ -60,6 +60,13 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, navi
syncTreeNode($scope.content, data.path, true);
});
//We fetch all ancestors of the node to generate the footer breadcrump navigation
entityResource.getAncestors($routeParams.id, "media")
.then(function(anc) {
anc.pop();
$scope.ancestors = anc;
});
}
$scope.save = function () {