<form name="repository" ng-submit="saveNewDocumentRepository()" novalidate>
    <div class="modal-header">
        <h3><span translate>document-repository.newRepository.title</span></h3>
    </div>
    <div class="modal-body">
        <div class="well-sm">
            <div class="row">
                <div class="col-sm-6 form-group">
                    <div class="form-check">
                        <label class="form-check-label">
                            <input type="checkbox" class="form-check-input" ng-model="docRepo.repositoryType"
                                    ng-change="changeType(docRepo.repositoryType)" ng-true-value="'PERSONAL'" ng-false-value="'GENERAL'">
                            {{ 'document-repository.newRepository.personalRepository' | translate }}
                        </label>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6 form-group">
                    <label for="assignee" translate>document-repository.newRepository.assigneeLabel</label>
                    <span class="required-asterisk">*</span>
                    <input type="text" id="assignee" class="input-md form-control"
                            placeholder="{{ 'document-repository.newRepository.assignee.placeholder' | translate}}"
                            style="background-color: white;" ng-model="assignee.name" ng-click="userOrGroupSearch()"
                            ng-disabled="isPersonalDocRepo()" required>
                </div>
                <div class="col-sm-6 form-group">
                    <label for="owningGroup" translate>document-repository.newRepository.owningGroupLabel</label>
                    <span ng-show="!isPersonalDocRepo()" class="required-asterisk">*</span>
                    <input type="text" class="input-md form-control" id="owningGroup" ng-disabled="true" ng-model="owningGroup.name">
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12 form-group" ng-class="{ 'has-error' : error }">
                    <label translate>document-repository.newRepository.nameLabel</label>
                    <span class="required-asterisk">*</span>
                    <mention-input ng-model="docRepo.name" params="paramsName"
                            placeholder="{{ 'document-repository.newRepository.name.placeholder' | translate }}"></mention-input>
                    <p class="help-block" ng-show="error">
                        {{ error }} </p>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12 form-group">
                    <label translate>document-repository.newRepository.descriptionLabel</label>
                    <mention-textarea ng-model="docRepo.description" params="paramsDescription"
                            placeholder="{{ 'document-repository.newRepository.description.placeholder' | translate }}"></mention-textarea>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary btn-sm" data-toggle="tooltip" data-title="Cancel" id="cancelButton"
                ng-click="cancelModal()">
            <span translate>document-repository.newRepository.cancelButton</span>
        </button>
        <button type="submit" ng-disabled="repository.$invalid || loading" class="btn btn-primary btn-sm" data-toggle="tooltip"
                data-title="Save" id="saveButton">
            <i class="fa fa-floppy-o" ng-hide="loading"></i>
            <i class="fa fa-circle-o-notch fa-spin" ng-show="loading"></i>
            <span translate>document-repository.newRepository.saveButton</span>
        </button>
    </div>
</form>