/
settings.html
91 lines (84 loc) · 5.61 KB
/
settings.html
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
<div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 translate="settings.title" translate-values="{username: '{{settingsAccount.login}}'}">User settings for [<b>{{settingsAccount.login}}</b>]</h2>
<div class="alert alert-success" ng-show="success" translate="settings.messages.success">
<strong>Settings saved!</strong>
</div>
<div class="alert alert-danger" ng-show="errorEmailExists" translate="settings.messages.error.emailexists">
<strong>E-mail is already in use!</strong> Please choose another one.
</div>
<div class="alert alert-danger" ng-show="error" translate="settings.messages.error.fail">
<strong>An error has occurred!</strong> Settings could not be saved.
</div>
<form name="form" role="form" novalidate ng-submit="save()" show-validation>
<div class="form-group">
<label translate="settings.form.firstname">First Name</label>
<input type="text" class="form-control" name="firstName" placeholder="{{'settings.form.firstname.placeholder' | translate}}"
ng-model="settingsAccount.firstName" ng-minlength=1 ng-maxlength=50 required maxlength="50">
<div ng-show="form.firstName.$dirty && form.firstName.$invalid">
<p class="help-block"
ng-show="form.firstName.$error.required" translate="settings.messages.validate.firstname.required">
Your first name is required.
</p>
<p class="help-block"
ng-show="form.firstName.$error.minlength" translate="settings.messages.validate.firstname.minlength">
Your first name is required to be at least 1 character.
</p>
<p class="help-block"
ng-show="form.firstName.$error.maxlength" translate="settings.messages.validate.firstname.maxlength">
Your first name cannot be longer than 50 characters.
</p>
</div>
</div>
<div class="form-group">
<label translate="settings.form.lastname">Last Name</label>
<input type="text" class="form-control" name="lastName" placeholder="{{'settings.form.lastname.placeholder' | translate}}"
ng-model="settingsAccount.lastName" ng-minlength=1 ng-maxlength=50 required maxlength="50">
<div ng-show="form.lastName.$dirty && form.lastName.$invalid">
<p class="help-block"
ng-show="form.lastName.$error.required" translate="settings.messages.validate.lastname.required">
Your last name is required.
</p>
<p class="help-block"
ng-show="form.lastName.$error.minlength" translate="settings.messages.validate.lastname.minlength">
Your last name is required to be at least 1 character.
</p>
<p class="help-block"
ng-show="form.lastName.$error.maxlength" translate="settings.messages.validate.lastname.maxlength">
Your last name cannot be longer than 50 characters.
</p>
</div>
</div>
<div class="form-group">
<label translate="global.form.email">E-mail</label>
<input type="email" class="form-control" name="email" placeholder="{{'global.form.email.placeholder' | translate}}"
ng-model="settingsAccount.email" ng-minlength=5 ng-maxlength=100 required maxlength="100">
<div ng-show="form.email.$dirty && form.email.$invalid">
<p class="help-block"
ng-show="form.email.$error.required" translate="global.messages.validate.email.required">
Your e-mail is required.
</p>
<p class="help-block"
ng-show="form.email.$error.email" translate="global.messages.validate.email.invalid">
Your e-mail is invalid.
</p>
<p class="help-block"
ng-show="form.email.$error.minlength" translate="global.messages.validate.email.minlength">
Your e-mail is required to be at least 5 characters.
</p>
<p class="help-block"
ng-show="form.email.$error.maxlength" translate="global.messages.validate.email.maxlength">
Your e-mail cannot be longer than 100 characters.
</p>
</div>
</div>
<div class="form-group">
<label translate="settings.form.language">Language</label>
<select name="langKey" class="form-control" ng-model="settingsAccount.langKey" ng-controller="LanguageController" ng-options="code as (code | findLanguageFromKey) for code in languages"></select>
</div>
<button type="submit" ng-disabled="form.$invalid" class="btn btn-primary" translate="settings.form.button">Save</button>
</form>
</div>
</div>
</div>