|
| 1 | +<form class="form-horizontal" name="fieldsForm" ng-submit="$vm.saveField()" novalidate> |
| 2 | + <div class="modal-header bg-primary"> |
| 3 | + <h3 class="modal-title">{{$vm.customField.id ? 'Update' : 'Add'}} custom field</h3> |
| 4 | + </div> |
| 5 | + <div class="modal-body"> |
| 6 | + |
| 7 | + <div class="form-group" ng-class="{ 'has-error' : fieldsForm.name.$invalid && !fieldsForm.name.$pristine }"> |
| 8 | + <label class="col-sm-2 control-label"> |
| 9 | + Name |
| 10 | + <i class="fa fa-asterisk text-danger"></i> |
| 11 | + </label> |
| 12 | + <div class="col-sm-10"> |
| 13 | + <input class="form-control" name="name" ng-model="$vm.customField.name" placeholder="Ex: cvss, threatActor, businessRisk" required type="text"> |
| 14 | + <p class="help-block" ng-show="fieldsForm.name.$invalid && !fieldsForm.name.$pristine">This field is required.</p> |
| 15 | + </div> |
| 16 | + </div> |
| 17 | + <div class="form-group" ng-class="{ 'has-error' : fieldsForm.label.$invalid && !fieldsForm.label.$pristine }"> |
| 18 | + <label class="col-sm-2 control-label"> |
| 19 | + Label |
| 20 | + <i class="fa fa-asterisk text-danger"></i> |
| 21 | + </label> |
| 22 | + <div class="col-sm-10"> |
| 23 | + <input class="form-control" name="label" ng-model="$vm.customField.label" placeholder="Ex: CVSS, Threat actor, Business risk" required type="text"> |
| 24 | + <p class="help-block" ng-show="fieldsForm.label.$invalid && !fieldsForm.label.$pristine">This field is required.</p> |
| 25 | + </div> |
| 26 | + </div> |
| 27 | + |
| 28 | + <div class="form-group" ng-class="{ 'has-error' : fieldsForm.description.$invalid && !fieldsForm.description.$pristine }"> |
| 29 | + <label class="col-sm-2 control-label"> |
| 30 | + Description |
| 31 | + <i class="fa fa-asterisk text-danger"></i> |
| 32 | + </label> |
| 33 | + <div class="col-sm-10"> |
| 34 | + <input class="form-control" name="description" ng-model="$vm.customField.description" placeholder="A brief description of the custom field" required type="text"> |
| 35 | + <p class="help-block" ng-show="fieldsForm.description.$invalid && !fieldsForm.description.$pristine">This field is required.</p> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + <div class="form-group" ng-class="{ 'has-error' : fieldsForm.type.$invalid && !fieldsForm.type.$pristine }"> |
| 39 | + <label class="col-sm-2 control-label"> |
| 40 | + Type |
| 41 | + <i class="fa fa-asterisk text-danger"></i> |
| 42 | + </label> |
| 43 | + <div class="col-sm-10"> |
| 44 | + <select class="form-control" name="type" ng-model="$vm.customField.type" |
| 45 | + ng-options="fieldType for fieldType in $vm.reference.types" |
| 46 | + placeholder="Field's type" required></select> |
| 47 | + <p class="help-block" ng-show="fieldsForm.type.$invalid && !fieldsForm.type.$pristine">This field is required.</p> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + |
| 51 | + <div class="form-group"> |
| 52 | + <label class="col-sm-2 control-label"> |
| 53 | + Possible values |
| 54 | + </label> |
| 55 | + <div class="col-sm-10"> |
| 56 | + <textarea class="form-control" name="options" ng-model="$vm.customField.options" rows="5" placeholder="Possible values, one per line" type="text"></textarea> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + <div class="modal-footer text-left"> |
| 61 | + <button class="btn btn-default" ng-click="$vm.cancel()" type="button">Cancel</button> |
| 62 | + <button class="btn btn-primary pull-right" ng-disabled="fieldsForm.$invalid" type="submit">Save field</button> |
| 63 | + </div> |
| 64 | +</form> |
0 commit comments