/
update-form.jade
executable file
·42 lines (42 loc) · 1.8 KB
/
update-form.jade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.panel.panel-default.z-depth-1(ng-controller="FormWizardCtrl as updateForm")
.panel-body
form(name="updateVM.form", novalidate)
.h4.text-dark-secondary
strong #{ __("General") }
hr
.form-group(ng-class="{ 'has-error': updateForm.hasError(updateVM.form.name) }")
label #{ __("Name") }
input.form-control(
type="text"
name="name"
ng-model="updateVM.data.name"
required
ng-maxlength="100"
field-unique="Category"
field-original-value="{{ updateVM.item.name }}"
)
.help-block(
ng-messages="updateVM.form.name.$error"
ng-show="updateForm.hasError(updateVM.form.name)"
)
span(ng-message="required") #{ __("This field is required.") }
span(ng-message="maxlength") #{ __("This field must not exceed 100 chars.") }
span(ng-message="unique") #{ __("This name is already taken.") }
.form-group
label Status
.status-group
.status-item(ng-repeat="status in FILTER_STATUS", class="status-{{ status.value | lowercase }}", ng-class="{ active: updateVM.data.lifecycleStatus == status.value }")
span.item-icon
span.item-text {{ status.value }}
.form-group
label
span #{ __("Description") }
small.text-muted (#{ __("optional") })
textarea.form-control(rows="3", name="description", ng-model="updateVM.data.description")
.form-group.text-right
a.btn.btn-success(
ng-click="updateVM.update()"
ng-disabled="!updateVM.form.$valid || updateVM.update.status === updateVM.STATUS.PENDING"
)
span.item-icon.fa.fa-spin.fa-spinner(ng-if="updateVM.update.status === updateVM.STATUS.PENDING")
span.item-text #{ __("Update") }