/
update-profile.jade
executable file
·128 lines (128 loc) · 5.38 KB
/
update-profile.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.panel.panel-default.z-depth-1
.panel-body
.h4.text-dark-secondary
strong #{ __("Profile") }
hr
form(name="updateVM.form", novalidate)
.alert.alert-info #{ __("This information is public so it may be viewed by anyone.") }
.row
.col-sm-6
.form-group(ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.firstName) }")
label #{ __("First name") }
input.form-control(
type="text"
name="firstName"
ng-model="updateVM.data.givenName"
required
ng-maxlength="100"
)
.help-block(
ng-messages="updateVM.form.firstName.$error"
ng-show="updateVM.hasFieldError(updateVM.form.firstName)"
)
span(ng-message="required") #{ __("This field is required.") }
span(ng-message="maxlength") #{ __("This field must not exceed %s chars.", "100") }
.col-sm-6
.form-group(
ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.lastName) }"
)
label #{ __("Last name") }
input.form-control(
type="text"
name="lastName"
ng-model="updateVM.data.familyName"
required
ng-maxlength="100"
)
.help-block(
ng-messages="updateVM.form.lastName.$error"
ng-show="updateVM.hasFieldError(updateVM.form.lastName)"
)
span(ng-message="required") #{ __("This field is required.") }
span(ng-message="maxlength") #{ __("This field must not exceed %s chars.", "100") }
.row
.col-sm-6
.form-group(ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.title) }")
label #{ __("Title") }
select.form-control(
name="title"
ng-model="updateVM.data.title"
)
option(value="") #{ __("Prefer not to say") }
option(ng-repeat="title in ['Miss', 'Mrs', 'Mr', 'Ms']", value="{{ title }}") {{ title }}
.col-sm-6
.form-group(ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.maritalStatus) }")
label #{ __("Marital status") }
select.form-control(
name="maritalStatus"
ng-model="updateVM.data.maritalStatus"
)
option(value="") #{ __("Prefer not to say") }
option(ng-repeat="status in ['Divorced', 'Married', 'Separated', 'Single', 'Widowed']", value="{{ status }}") {{ status }}
.row
.col-sm-6
.form-group(ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.gender) }")
label #{ __("Gender") }
select.form-control(
name="gender"
ng-model="updateVM.data.gender"
)
option(value="") #{ __("Prefer not to say") }
option(ng-repeat="gender in ['Female', 'Male']", value="{{ gender }}") {{ gender }}
.col-sm-6
.form-group(ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.nationality) }")
label #{ __("Nationality") }
input.form-control(
type="text"
name="nationality"
ng-model="updateVM.data.nationality"
)
.h4.text-dark-secondary
strong #{ __("Birth") }
hr
.row
.col-sm-6
.form-group(ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.birthDate) }")
label #{ __("Date") }
input.form-control(
type="date"
name="birthDate"
ng-model="updateVM.data.birthDate"
convert-to-date
)
.help-block(
ng-messages="updateVM.form.birthDate.$error"
ng-show="updateVM.hasFieldError(updateVM.form.birthDate)"
)
span(ng-message="date") #{ __("This field must be a valid date.") }
.row
.col-sm-6
.form-group(ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.countryOfBirth) }")
label #{ __("Country") }
select.form-control(
name="countryOfBirth"
ng-model="updateVM.data.countryOfBirth"
)
option(value="") #{ __("Prefer not to say") }
option(ng-repeat="country in updateVM.COUNTRIES", value="{{ country.code }}") {{ country.name }}
.col-sm-6
.form-group(ng-class="{ 'has-error': updateVM.hasFieldError(updateVM.form.placeOfBirth) }")
label #{ __("Place") }
input.form-control(
type="text"
name="placeOfBirth"
ng-model="updateVM.data.placeOfBirth"
ng-maxlength="100"
)
.help-block(
ng-messages="updateVM.form.placeOfBirth.$error"
ng-show="updateVM.hasFieldError(updateVM.form.placeOfBirth)"
)
span(ng-message="maxlength") #{ __("This field must not exceed %s chars.", "100") }
.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") }