21bd65c49bcfc7246c3eb6ccd97b6001d1c629ab
[motion-next.git] /
1 <md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">
2   <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>
3     <md-toolbar class="md-accent md-hue-2">
4       <div
5         class="md-toolbar-tools"
6         layout="row"
7         layout-align="space-between center"
8       >
9         <span class="title">{{ vm.title | translate }}</span>
10         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
11           <md-icon
12             md-font-icon="icon-close"
13             aria-label="Close dialog"
14           ></md-icon>
15         </md-button>
16       </div>
17     </md-toolbar>
18
19     <md-dialog-content ms-scroll>
20       <div class="error-list">
21         <div
22           ng-repeat="error in vm.errors"
23           class="error"
24           layout="row"
25           layout-align="space-between center"
26         >
27           <div>
28             <span class="message">{{error.message}}</span>
29             <span class="type">({{error.type}})</span>
30           </div>
31           <md-button class="md-icon-button">
32             <md-icon
33               md-font-icon="icon-alert-box"
34               aria-label="alert error"
35               class="s16"
36             ></md-icon>
37           </md-button>
38         </div>
39       </div>
40       <md-input-container class="md-block">
41         <label translate="WHATSAPP.KEY">Key</label>
42         <input
43           type="text"
44           name="key"
45           ng-model="vm.dialogflow.key"
46           ng-required="true"
47           autofocus
48           ng-disabled="!vm.crudPermissions.canEdit"
49         />
50
51         <div
52           ng-messages="whatsappAccountFormApp['key'].$error"
53           ng-show="whatsappAccountFormApp['key'].$touched"
54           role="alert"
55         >
56           <div ng-message="required">
57             <span translate="WHATSAPP.ERRORS.KEY_REQUIRED"
58               >Key field is required</span
59             >
60           </div>
61         </div>
62       </md-input-container>
63       <md-input-container class="md-block">
64         <label translate="WHATSAPP.LANGUAGE">language</label>
65         <md-select
66           name="language"
67           ng-model="vm.dialogflow.language"
68           required
69           ng-disabled="!vm.crudPermissions.canEdit"
70         >
71           <md-option ng-value="'da'">Danish</md-option>
72           <md-option ng-value="'en'">English</md-option>
73           <md-option ng-value="'de'">German</md-option>
74           <md-option ng-value="'it'">Italian</md-option>
75           <md-option ng-value="'es'">Spanish</md-option>
76           <md-option ng-value="'fr'">French</md-option>
77           <md-option ng-value="'id'">Indonesian</md-option>
78           <md-option ng-value="'ja'">Japanese</md-option>
79           <md-option ng-value="'ko'">Korean (South Korea)</md-option>
80           <md-option ng-value="'nl'">Dutch</md-option>
81           <md-option ng-value="'no'">Norwegian</md-option>
82           <md-option ng-value="'pt'">Portuguese (European)</md-option>
83           <md-option ng-value="'pt-br'">Portuguese (Nrazilian)</md-option>
84           <md-option ng-value="'ru'">Russian</md-option>
85           <md-option ng-value="'sv'">Swedish</md-option>
86           <md-option ng-value="'th'">Thai</md-option>
87           <md-option ng-value="'uk'">Ukrainian</md-option>
88           <md-option ng-value="'zh-CN'">Chinese (Simplified)</md-option>
89           <md-option ng-value="'zh-HK'">Chinese (Hong Kong)</md-option>
90           <md-option ng-value="'zh-TW'">Chinese (Traditional)</md-option>
91         </md-select>
92         <div
93           ng-messages="whatsappAccountFormApp['language'].$error"
94           ng-show="whatsappAccountFormApp['language'].$touched"
95           role="alert"
96         >
97           <div ng-message="required">
98             <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED"
99               >language field is required</span
100             >
101           </div>
102         </div>
103       </md-input-container>
104       <md-input-container class="md-block">
105         <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>
106         <textarea
107           name="welcomemessage"
108           ng-model="vm.dialogflow.welcomemessage"
109           md-maxlength="255"
110         ></textarea>
111         <div class="hint">
112           <span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span>
113         </div>
114
115         <div
116           ng-messages="whatsappAccountFormApp['welcomemessage'].$error"
117           ng-show="whatsappAccountFormApp['welcomemessage'].$touched"
118           role="alert"
119         >
120           <div ng-message="required">
121             <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED"
122               >welcomemessage field is required</span
123             >
124           </div>
125
126           <div ng-message="md-maxlength">
127             <span
128               translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH"
129               translate-values="{max: 255}"
130               >welcomemessage must have a maximum length equal to 255</span
131             >
132           </div>
133         </div>
134       </md-input-container>
135
136       <div class="error-list">
137         <div
138           ng-repeat="error in vm.errors"
139           class="error"
140           layout="row"
141           layout-align="space-between center"
142         >
143           <div>
144             <span class="message">{{error.message}}</span>
145             <span class="type">({{error.type}})</span>
146           </div>
147           <md-button class="md-icon-button">
148             <md-icon
149               md-font-icon="icon-alert-box"
150               aria-label="alert error"
151               class="s16"
152             ></md-icon>
153           </md-button>
154         </div>
155       </div>
156     </md-dialog-content>
157
158     <md-dialog-actions layout="row" layout-align="space-between center">
159       <div
160         layout="row"
161         layout-align="start center"
162         ng-if="vm.crudPermissions.canEdit"
163       >
164         <md-button
165           type="submit"
166           ng-click="vm.saveWhatsappAccountApp()"
167           class="send-button md-accent md-raised"
168           ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine"
169           aria-label="SAVE"
170           translate="WHATSAPP.SAVE"
171           translate-attr-aria-label="WHATSAPP.SAVE"
172         >
173           SAVE
174         </md-button>
175       </div>
176     </md-dialog-actions>
177   </form>
178 </md-dialog>