<div data-element="editor-media" ng-controller="Umbraco.Editors.Media.EditController">

    <umb-load-indicator ng-if="page.loading"></umb-load-indicator>

    <form novalidate name="contentForm"
          ng-submit="save()"
          val-form-manager>

        <umb-editor-view ng-if="!page.loading">

            <umb-editor-header name="content.name"
                               menu="page.menu"
                               hide-icon="true"
                               hide-description="true"
                               hide-alias="true"
                               navigation="content.apps"
                               on-select-navigation-item="appChanged(item)"
                               show-back-button="showBack()"
                               on-back="onBack()"
                               setpagetitle="header.setPageTitle">
            </umb-editor-header>

            <umb-editor-container>
                <div class="umb-editor-sub-views" ng-if="!page.loading">
                    <div id="sub-view-{{$index}}" ng-repeat="app in content.apps track by app.alias">
                        <umb-editor-sub-view model="app" content="content">
                        </umb-editor-sub-view>
                    </div>
                </div>
            </umb-editor-container>

            <umb-editor-footer>

                <umb-editor-footer-content-left>

                    <umb-breadcrumbs ng-if="ancestors && ancestors.length > 0"
                                     ancestors="ancestors"
                                     entity-type="media">
                    </umb-breadcrumbs>

                </umb-editor-footer-content-left>


                <umb-editor-footer-content-right>

                    <umb-button ng-if="model.infiniteMode"
                                type="button"
                                button-style="link"
                                label-key="general_close"
                                shortcut="esc"
                                action="close()">
                    </umb-button>

                    <umb-button alias="returnToList"
                                ng-if="page.listViewPath && !model.infiniteMode"
                                type="link"
                                href="#{{page.listViewPath}}"
                                label-key="buttons_returnToList">
                    </umb-button>

                    <!-- label-key="buttons_save" -->
                    <umb-button alias="save"
                                type="submit"
                                button-style="success"
                                state="page.saveButtonState"
                                label-key="{{page.submitButtonLabelKey}}"
                                shortcut="ctrl+s">
                    </umb-button>

                </umb-editor-footer-content-right>


            </umb-editor-footer>


        </umb-editor-view>

    </form>
</div>
