fixes breadcrumb on content/media, ensures a request to load it doesn't happen if there is no parent, ensures that the full breadcrumb is shown and in the right order and ensures that the breadcrumb class is not added if there isn't one so the margins on the buttons work better.
This commit is contained in:
@@ -32,13 +32,14 @@ function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $
|
||||
|
||||
editorState.set($scope.content);
|
||||
|
||||
//We fetch all ancestors of the node to generate the footer breadcrump navigation
|
||||
//We fetch all ancestors of the node to generate the footer breadcrumb navigation
|
||||
if (!$routeParams.create) {
|
||||
entityResource.getAncestors(content.id, "document")
|
||||
.then(function (anc) {
|
||||
anc.pop();
|
||||
$scope.ancestors = anc;
|
||||
});
|
||||
if (content.parentId && content.parentId != -1) {
|
||||
entityResource.getAncestors(content.id, "document")
|
||||
.then(function (anc) {
|
||||
$scope.ancestors = anc.reverse();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,42 +4,40 @@
|
||||
ng-submit="save()"
|
||||
val-form-manager>
|
||||
|
||||
<umb-panel ng-class="'editor-breadcrumb'">
|
||||
<umb-panel ng-class="{'editor-breadcrumb': ancestors && ancestors.length > 0}">
|
||||
<umb-header tabs="content.tabs">
|
||||
|
||||
<div class="span7">
|
||||
<umb-content-name
|
||||
placeholder="@placeholders_entername"
|
||||
ng-model="content.name"/>
|
||||
<umb-content-name placeholder="@placeholders_entername"
|
||||
ng-model="content.name" />
|
||||
</div>
|
||||
|
||||
<div class="span5">
|
||||
<div class="span5">
|
||||
<div class="btn-toolbar pull-right umb-btn-toolbar">
|
||||
<div class="btn-group" ng-animate="'fade'" ng-show="formStatus">
|
||||
<p class="btn btn-link umb-status-label">{{formStatus}}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<umb-options-menu ng-show="currentNode"
|
||||
current-node="currentNode"
|
||||
current-section="{{currentSection}}">
|
||||
current-node="currentNode"
|
||||
current-section="{{currentSection}}">
|
||||
</umb-options-menu>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</umb-header>
|
||||
|
||||
<umb-tab-view>
|
||||
<umb-tab id="tab{{tab.id}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
|
||||
<div class="umb-pane">
|
||||
<umb-property
|
||||
property="property"
|
||||
ng-repeat="property in tab.properties">
|
||||
<umb-property property="property"
|
||||
ng-repeat="property in tab.properties">
|
||||
<umb-editor model="property"></umb-editor>
|
||||
</umb-property>
|
||||
|
||||
|
||||
<div class="umb-tab-buttons" detect-fold ng-class="{'umb-dimmed': busy}">
|
||||
|
||||
|
||||
<div class="btn-group" ng-show="listViewPath">
|
||||
<a class="btn" href="#{{listViewPath}}">
|
||||
<localize key="buttons_returnToList">Return to list</localize>
|
||||
@@ -52,20 +50,20 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="btn-group dropup" ng-if="defaultButton" >
|
||||
<div class="btn-group dropup" ng-if="defaultButton">
|
||||
<!-- primary button -->
|
||||
<a class="btn btn-success" href="#" ng-click="performAction(defaultButton)" prevent-default>
|
||||
<localize key="{{defaultButton.labelKey}}">{{defaultButton.labelKey}}</localize>
|
||||
<localize key="{{defaultButton.labelKey}}">{{defaultButton.labelKey}}</localize>
|
||||
</a>
|
||||
|
||||
|
||||
<a class="btn btn-success dropdown-toggle" data-toggle="dropdown" ng-if="subButtons.length > 0">
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
|
||||
<a href="#">Return to list</a>
|
||||
|
||||
|
||||
<!-- sub buttons -->
|
||||
<ul class="dropdown-menu bottom-up" role="menu" aria-labelledby="dLabel" ng-if="subButtons.length > 0">
|
||||
<ul class="dropdown-menu bottom-up" role="menu" aria-labelledby="dLabel" ng-if="subButtons.length > 0">
|
||||
<li ng-repeat="btn in subButtons">
|
||||
<a href="#" ng-click="performAction(btn)" prevent-default>
|
||||
<localize key="{{btn.labelKey}}">{{btn.labelKey}}</localize>
|
||||
@@ -73,14 +71,14 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</umb-tab>
|
||||
</umb-tab-view>
|
||||
|
||||
|
||||
<ul class="umb-panel-footer-nav nav nav-pills" ng-if="content.parentId">
|
||||
<ul class="umb-panel-footer-nav nav nav-pills" ng-if="ancestors && ancestors.length > 0">
|
||||
<li ng-repeat="ancestor in ancestors">
|
||||
<a href="#/content/content/edit/{{ancestor.id}}">{{ancestor.name}}</a>
|
||||
</li>
|
||||
|
||||
@@ -3,14 +3,13 @@
|
||||
ng-show="loaded"
|
||||
ng-submit="save()"
|
||||
val-form-manager>
|
||||
<umb-panel ng-class="'editor-breadcrumb'">
|
||||
<umb-panel ng-class="{'editor-breadcrumb': ancestors && ancestors.length > 0}">
|
||||
<umb-header tabs="content.tabs">
|
||||
|
||||
|
||||
<div class="span7">
|
||||
<umb-content-name
|
||||
placeholder="@placeholders_entername"
|
||||
ng-model="content.name"/>
|
||||
</div>
|
||||
<umb-content-name placeholder="@placeholders_entername"
|
||||
ng-model="content.name" />
|
||||
</div>
|
||||
|
||||
<div class="span5">
|
||||
<div class="btn-toolbar pull-right umb-btn-toolbar">
|
||||
@@ -19,8 +18,8 @@
|
||||
</div>
|
||||
|
||||
<umb-options-menu ng-show="currentNode"
|
||||
current-node="currentNode"
|
||||
current-section="{{currentSection}}">
|
||||
current-node="currentNode"
|
||||
current-section="{{currentSection}}">
|
||||
</umb-options-menu>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,21 +29,20 @@
|
||||
<umb-tab id="tab{{tab.id}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
|
||||
|
||||
<div class="umb-pane">
|
||||
<umb-property
|
||||
property="property"
|
||||
ng-repeat="property in tab.properties">
|
||||
|
||||
<umb-property property="property"
|
||||
ng-repeat="property in tab.properties">
|
||||
|
||||
<umb-editor model="property"></umb-editor>
|
||||
</umb-property>
|
||||
|
||||
<div class="umb-tab-buttons" detect-fold ng-class="{'umb-dimmed': busy}">
|
||||
|
||||
|
||||
<div class="btn-group" ng-show="listViewPath">
|
||||
<a class="btn" href="#{{listViewPath}}">
|
||||
<localize key="buttons_returnToList">Return to list</localize>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
|
||||
<localize key="buttons_save">Save</localize>
|
||||
@@ -56,7 +54,7 @@
|
||||
</umb-tab>
|
||||
</umb-tab-view>
|
||||
|
||||
<ul class="umb-panel-footer-nav nav nav-pills" ng-if="content.parentId">
|
||||
<ul class="umb-panel-footer-nav nav nav-pills" ng-if="ancestors && ancestors.length > 0">
|
||||
<li ng-repeat="ancestor in ancestors">
|
||||
<a href="#/media/media/edit/{{ancestor.id}}">{{ancestor.name}}</a>
|
||||
</li>
|
||||
|
||||
@@ -66,15 +66,16 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
|
||||
serverValidationManager.executeAndClearAllSubscriptions();
|
||||
|
||||
syncTreeNode($scope.content, data.path, true);
|
||||
|
||||
});
|
||||
|
||||
if ($scope.content.parentId && $scope.content.parentId != -1) {
|
||||
//We fetch all ancestors of the node to generate the footer breadcrump navigation
|
||||
entityResource.getAncestors($routeParams.id, "media")
|
||||
.then(function (anc) {
|
||||
$scope.ancestors = anc.reverse();
|
||||
});
|
||||
}
|
||||
|
||||
//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 () {
|
||||
|
||||
Reference in New Issue
Block a user