Dixsie Wolmers | c15f66b | 2019-09-11 15:26:38 -0500 | [diff] [blame^] | 1 | <div class="uib-modal__content"> |
| 2 | <div class="modal-header"> |
| 3 | <h2 class="modal-title" id="modal_label"> |
| 4 | Add new certificate |
| 5 | </h2> |
| 6 | <button |
| 7 | type="button" |
| 8 | class="btn btn--close" |
| 9 | ng-click="$dismiss()" |
| 10 | aria-label="close"> |
| 11 | <icon file="icon-close.svg" aria-hidden="true"></icon> |
| 12 | </button> |
| 13 | </div> |
| 14 | <form |
| 15 | name="addCertForm" |
| 16 | id="addCertForm" |
| 17 | ng-class="{'submitted': submitted}"> |
| 18 | <div class="modal-body"> |
| 19 | <div class="form__field"> |
| 20 | <label class="content-label" for="certType">Certificate type</label> |
| 21 | <select |
| 22 | class="cert-dropdown" |
| 23 | id="certType" |
| 24 | name="certType" |
| 25 | ng-model="newCertificate.selectedType" |
| 26 | required> |
| 27 | <option class="courier-bold" ng-value="">Select an option</option> |
| 28 | <option |
| 29 | class="courier-bold" |
| 30 | ng-value="type" |
| 31 | ng-repeat="type in availableCertificateTypes"> |
| 32 | {{ type.name }} |
| 33 | </option> |
| 34 | </select> |
| 35 | <div |
| 36 | ng-messages="addCertForm.certType.$error" |
| 37 | class="form-error" |
| 38 | ng-class="{'visible' : addCertForm.certType.$touched || submitted }"> |
| 39 | <p ng-message="required">Field is required</p> |
| 40 | </div> |
| 41 | </div> |
| 42 | <div class="content-label form__field">Certificate file</div> |
| 43 | <div class="file-upload"> |
| 44 | <label |
| 45 | for="upload_cert_new" |
| 46 | class="file-upload-btn btn btn-secondary" |
| 47 | tabindex="0"> |
| 48 | Choose file |
| 49 | </label> |
| 50 | <input |
| 51 | name="uploadCertNew" |
| 52 | id="upload_cert_new" |
| 53 | type="file" |
| 54 | file="newCertificate.file" |
| 55 | class="file-upload-input"/> |
| 56 | <div class="form__field file-upload-container"> |
| 57 | <span ng-hide="newCertificate.file">No file selected</span> |
| 58 | <span>{{ newCertificate.file.name }}</span> |
| 59 | <button |
| 60 | type="reset" |
| 61 | class="btn file-upload-reset" |
| 62 | ng-if="newCertificate.file.name" |
| 63 | ng-click="newCertificate.file = '';" |
| 64 | aria-label="remove selected file"> |
| 65 | <icon file="icon-close.svg" aria-hidden="true"></icon> |
| 66 | </button> |
| 67 | </div> |
| 68 | </div> |
| 69 | </div> |
| 70 | <div class="modal-footer"> |
| 71 | <button |
| 72 | type="button" |
| 73 | class="btn btn-secondary" |
| 74 | ng-click="$dismiss(); addCertForm.$setUntouched();"> |
| 75 | Cancel |
| 76 | </button> |
| 77 | <button |
| 78 | type="submit" |
| 79 | class="btn btn-primary" |
| 80 | ng-click="submitted = true; uploadCertificate(); $dismiss()" |
| 81 | ng-disabled="addCertForm.$invalid || !newCertificate.file"> |
| 82 | Save |
| 83 | </button> |
| 84 | </div> |
| 85 | </form> |
| 86 | </div> |