<div ng-controller="Umbraco.Editors.DataTypeSettingsController as vm">

<form novalidate name="dataTypeSettingsForm" val-form-manager>

    <umb-editor-view data-element="editor-data-type-settings">

        <umb-editor-header
            name="model.title"
            name-locked="true"
            hide-alias="true"
            hide-icon="true"
            hide-description="true">
        </umb-editor-header>

        <umb-editor-container class="form-horizontal">

            <umb-load-indicator
                ng-if="vm.loadingDataType">
            </umb-load-indicator>

            <umb-box ng-if="!vm.loadingDataType">
                <umb-box-content>

                    <div class="control-group umb-control-group" ng-if="vm.dataType.id !== 0">
                        <umb-icon icon="icon-alert" class="red"></umb-icon>
                        <strong class="red"><localize key="contentTypeEditor_allDocumentTypes">All Document Types</localize></strong> <localize key="usingEditor">using this editor will get updated with the new settings.</localize>
                    </div>

                    <div class="control-group umb-control-group">
                        <div class="umb-el-wrap">
                            <label class="control-label" for="dataTypeName">
                                <localize key="general_name">Name</localize>
                            </label>
                            <div class="controls">
                                <input type="text" id="dataTypeName" ng-model="vm.dataType.name" class="umb-property-editor" umb-auto-focus focus-on-filled="true" required />
                            </div>
                        </div>
                    </div>

                    <div ng-if="vm.dataType.preValues.length > 0">
                        <h5><localize key="contentTypeEditor_configuration">Configuration</localize></h5>

                        <umb-property property="preValue" ng-repeat="preValue in vm.dataType.preValues">
                            <umb-property-editor model="preValue" is-pre-value="true"></umb-property-editor>
                        </umb-property>
                    </div>

                </umb-box-content>
            </umb-box>
        </umb-editor-container>

        <umb-editor-footer>
            <umb-editor-footer-content-right>
                <umb-button
                    type="button"
                    button-style="link"
                    label-key="general_close"
                    shortcut="esc"
                    action="vm.close()">
                </umb-button>
                <umb-button
                    alias="submit"
                    type="button"
                    button-style="success"
                    label-key="general_submit"
                    state="vm.saveButtonState"
                    action="vm.submit(model)">
                </umb-button>
            </umb-editor-footer-content-right>
        </umb-editor-footer>

    </umb-editor-view>

</form>

</div>
