move new editor to media section edit

This commit is contained in:
Mads Rasmussen
2015-09-01 13:43:26 +02:00
parent 9f5d5af713
commit 7ed6eb35f9
2 changed files with 56 additions and 57 deletions

View File

@@ -1,64 +1,58 @@
<form novalidate name="contentForm"
ng-controller="Umbraco.Editors.Media.EditController"
ng-show="loaded"
ng-submit="save()"
val-form-manager>
<umb-panel umb-tabs ng-class="{'editor-breadcrumb': ancestors && ancestors.length > 0}">
<umb-header tabs="content.tabs">
<form novalidate name="contentForm"
ng-controller="Umbraco.Editors.Media.EditController"
ng-show="loaded"
ng-submit="save()"
val-form-manager>
<div class="span7">
<umb-content-name placeholder="@placeholders_entername"
ng-model="content.name" />
</div>
<umb-editor-view umb-tabs>
<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-editor-header
name="content.name"
tabs="content.tabs"
menu="page.menu">
</umb-editor-header>
<umb-options-menu ng-show="currentNode"
current-node="currentNode"
current-section="{{currentSection}}">
</umb-options-menu>
</div>
</div>
</umb-header>
<umb-editor-container>
<umb-tab-view>
<umb-tabs-content view="true" class="form-horizontal">
<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-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>
</button>
</div>
</div>
</div>
<umb-property property="property" ng-repeat="property in tab.properties">
<umb-editor model="property"></umb-editor>
</umb-property>
</umb-tab>
</umb-tab-view>
</umb-tabs-content>
<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>
<li></li>
</ul>
</umb-panel>
</form>
</umb-editor-container>
<umb-editor-footer>
<umb-editor-footer-content-left>
<umb-breadcrumbs ng-if="ancestors && ancestors.length > 0" ancestors="ancestors"></umb-breadcrumbs>
</umb-editor-footer-content-left>
<umb-editor-footer-content-right 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>
</button>
</div>
</umb-editor-footer-content-right>
</umb-editor-footer>
</umb-editor-view>
</form>

View File

@@ -12,12 +12,17 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
$scope.currentSection = appState.getSectionState("currentSection");
$scope.currentNode = null; //the editors affiliated node
$scope.page = {};
$scope.page.menu = {};
$scope.page.menu.currentSection = appState.getSectionState("currentSection");
$scope.page.menu.currentNode = null; //the editors affiliated node
/** Syncs the content item to it's tree node - this occurs on first load and after saving */
function syncTreeNode(content, path, initialLoad) {
if (!$scope.content.isChildOfListView) {
navigationService.syncTree({ tree: "media", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) {
$scope.currentNode = syncArgs.node;
$scope.page.menu.currentNode = syncArgs.node;
});
}
else if (initialLoad === true) {
@@ -30,7 +35,7 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
umbRequestHelper.resourcePromise(
$http.get(content.treeNodeUrl),
'Failed to retrieve data for child node ' + content.id).then(function (node) {
$scope.currentNode = node;
$scope.page.menu.currentNode = node;
});
}
}