<div class="box box-primary"><div class="box-header"><h3 class="box-title" x-ng-if="state === 'create'">{{ 'DOMAIN_PATTERNS.BOX_FORM.TITLE_CREATION' | translate }}</h3><h3 class="box-title" x-ng-if="state === 'edit'">{{domainPattern.label}}</h3><div class="pull-right box-tools"><a class="list btn-back" x-ui-sref="domainpattern.list" tooltip="{{'COMMON.BASIC_FORM.BUTTON_CLOSE' | translate}}"><i class="fa fa-2x fa-list pink"></i></a></div></div><form class="form" name="domainPatternForm" role="form" novalidate x-ls-form-submit="submit()" x-ls-form-attempt><fieldset><div class="box-body"><div class="row"><!-- Model selector --><!-- No ng-if here because the $watch cannot acces to the child scope --><div class="form-group col-sm-5" x-ng-show="state==='create'"><label for="modelSelector">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_MODEL_SELECTOR' | translate }}</label><select id="modelSelector" class="form-control" x-ng-model="modelSelector" x-ng-options="model as model.label for model in models | orderBy:'label'"></select></div></div><div class="row"><div class="col-md-7"><!-- Legend --><div x-ng-if="state === 'create'"><!-- Identifier --><div class="form-group" x-ng-class="{'has-error': domainPatternForm.label.$invalid &&
                    (domainPatternForm.label.$dirty || ls.domainPatternForm.attempted)}"><label for="label">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_IDENTIFIER' | translate }}</label><input id="label" name="label" class="form-control" type="text" required x-ng-model="domainPattern.label"></div></div><!-- Description --><div class="form-group"><label for="description">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_DESCRIPTION' | translate }}</label><textarea id="description" name="description" class="form-control" x-ng-model="domainPattern.description">
              </textarea></div><!-- Authentication --><div class="form-group" x-ng-class="{'has-error': domainPatternForm.authentication.$invalid &&
                   (domainPatternForm.authentication.$dirty || ls.domainPatternForm.attempted)}"><label for="authentication">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_AUTHENTICATION' | translate }}</label><textarea id="authentication" name="authentication" class="form-control" required x-ng-model="domainPattern.authCommand">
              </textarea><p class="help-block">{{ 'DOMAIN_PATTERNS.BOX_FORM.HELP_AUTHENTICATION' | translate }}</p></div><!-- Search User --><div class="form-group" x-ng-class="{'has-error': domainPatternForm.searchUser.$invalid &&
                   (domainPatternForm.searchUser.$dirty || ls.domainPatternForm.attempted)}"><label for="searchUser">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_SEARCH_USER' | translate }}</label><textarea id="searchUser" name="searchUser" class="form-control" required x-ng-model="domainPattern.searchUserCommand">
              </textarea><p class="help-block">{{ 'DOMAIN_PATTERNS.BOX_FORM.HELP_SEARCH_USER' | translate }}</p></div><!-- Auto complete User using firstname, lastname and mail --><div class="form-group" x-ng-class="{'has-error': domainPatternForm.autocomplete1.$invalid &&
                   (domainPatternForm.autocomplete1.$dirty || ls.domainPatternForm.attempted)}"><label for="autocomplete1">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_AUTOCOMPLETE_ALL' | translate }}</label><textarea id="autocomplete1" name="autocomplete1" class="form-control" required x-ng-model="domainPattern.autoCompleteCommandOnAllAttributes">
              </textarea><p class="help-block">{{ 'DOMAIN_PATTERNS.BOX_FORM.HELP_AUTOCOMPLETE_ALL' | translate }}</p></div><!-- Auto complete User using firstname and lastname --><div class="form-group" x-ng-class="{'has-error': domainPatternForm.autocomplete2.$invalid &&
                   (domainPatternForm.autocomplete2.$dirty || ls.domainPatternForm.attempted)}"><label for="autocomplete2">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_AUTOCOMPLETE_PARTIAL' | translate }}</label><textarea id="autocomplete2" name="autocomplete2" class="form-control" required x-ng-model="domainPattern.autoCompleteCommandOnFirstAndLastName">
              </textarea><p class="help-block">{{ 'DOMAIN_PATTERNS.BOX_FORM.HELP_AUTOCOMPLETE_PARTIAL' | translate }}</p></div></div><div class="col-md-5"><!-- Attributes --><div class="well"><h4>{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_ATTRIBUTES' | translate }}</h4><div class="form-group" x-ng-class="{'has-error': domainPatternForm.email.$invalid &&
                     (domainPatternForm.email.$dirty || ls.domainPatternForm.attempted)}"><label for="email">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_EMAIL' | translate }}</label><input id="email" name="email" type="text" class="form-control" required x-ng-model="domainPattern.userMail"></div><div class="form-group" x-ng-class="{'has-error': domainPatternForm.firstName.$invalid &&
                     (domainPatternForm.firstName.$dirty || ls.domainPatternForm.attempted)}"><label for="firstName">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_FIRST_NAME' | translate }}</label><input id="firstName" name="firstName" type="text" class="form-control" required x-ng-model="domainPattern.userFirstName"></div><div class="form-group" x-ng-class="{'has-error': domainPatternForm.lastName.$invalid &&
                     (domainPatternForm.lastName.$dirty || ls.domainPatternForm.attempted)}"><label for="lastName">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_LAST_NAME' | translate }}</label><input id="lastName" name="lastName" type="text" class="form-control" required x-ng-model="domainPattern.userLastName"></div><div class="form-group" x-ng-class="{'has-error': domainPatternForm.ldapUid.$invalid &&
                     (domainPatternForm.ldapUid.$dirty || ls.domainPatternForm.attempted)}"><label for="ldapUid">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_UUID' | translate }}</label><input id="ldapUid" name="ldapUid" type="text" class="form-control" required x-ng-model="domainPattern.ldapUid"></div><div class="form-group" x-ng-class="{'has-error': domainPatternForm.searchPageSize.$invalid &&
                     (domainPatternForm.searchPageSize.$dirty || ls.domainPatternForm.attempted)}"><label for="searchPageSize">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_SEARCH_PAGE_SIZE' | translate }}</label><input id="searchPageSize" name="searchPageSize" type="text" class="form-control" required x-ng-model="domainPattern.searchPageSize"><p class="help-block">{{ 'DOMAIN_PATTERNS.BOX_FORM.HELP_SEARCH_PAGE_SIZE' | translate }}</p></div><div class="form-group" x-ng-class="{'has-error': domainPatternForm.searchSizeLimit.$invalid &&
                     (domainPatternForm.searchSizeLimit.$dirty || ls.domainPatternForm.attempted)}"><label for="searchSizeLimit">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_SEARCH_SIZE_LIMIT' | translate }}</label><input id="searchSizeLimit" name="searchSizeLimit" type="text" class="form-control" required x-ng-model="domainPattern.searchSizeLimit"><p class="help-block">{{ 'DOMAIN_PATTERNS.BOX_FORM.HELP_SEARCH_SIZE_LIMIT' | translate }}</p></div><div class="form-group" x-ng-class="{'has-error': domainPatternForm.completionPageSize.$invalid &&
                     (domainPatternForm.completionPageSize.$dirty || ls.domainPatternForm.attempted)}"><label for="completionPageSize">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_COMPLETION_PAGE_SIZE' | translate }}</label><input id="completionPageSize" name="completionPageSize" type="text" class="form-control" required x-ng-model="domainPattern.completionPageSize"><p class="help-block">{{ 'DOMAIN_PATTERNS.BOX_FORM.HELP_COMPLETION_PAGE_SIZE' | translate }}</p></div><div class="form-group" x-ng-class="{'has-error': domainPatternForm.completionSizeLimit.$invalid &&
                     (domainPatternForm.completionSizeLimit.$dirty || ls.domainPatternForm.attempted)}"><label for="completionSizeLimit">{{ 'DOMAIN_PATTERNS.BOX_FORM.LABEL_COMPLETION_SIZE_LIMIT' | translate }}</label><input id="completionSizeLimit" name="completionSizeLimit" type="text" class="form-control" required x-ng-model="domainPattern.completionSizeLimit"><p class="help-block">{{ 'DOMAIN_PATTERNS.BOX_FORM.HELP_COMPLETION_SIZE_LIMIT' | translate }}</p></div></div></div></div></div><div class="box-footer"><!-- Validation --><button id="delete" name="delete" type="button" class="btn btn-danger" x-ng-show="state==='edit'" x-ng-click="remove()">{{ 'DOMAIN_PATTERNS.BOX_FORM.FORM_ACTIONS.BUTTON_DELETE' | translate }}</button> <button type="button" id="reset" name="reset" class="btn btn-warning" x-ng-click="reset()">{{ 'DOMAIN_PATTERNS.BOX_FORM.FORM_ACTIONS.BUTTON_RESET' | translate }}</button> <button type="submit" id="submit" name="submit" class="btn btn-success">{{ 'DOMAIN_PATTERNS.BOX_FORM.FORM_ACTIONS.BUTTON_SUBMIT' | translate }}</button></div></fieldset></form></div>