9d2a9f82499566f20e2255daedde63e731d53222
[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.ACCESSKEYID">accesskeyid</label>
42         <input
43           type="text"
44           name="accesskeyid"
45           ng-model="vm.amazonlex.accesskeyid"
46           ng-required="true"
47           autofocus
48           ng-disabled="!vm.crudPermissions.canEdit"
49         />
50
51         <div
52           ng-messages="whatsappAccountFormApp['accesskeyid'].$error"
53           ng-show="whatsappAccountFormApp['accesskeyid'].$touched"
54           role="alert"
55         >
56           <div ng-message="required">
57             <span translate="WHATSAPP.ERRORS.ACCESSKEYID_REQUIRED"
58               >accesskeyid field is required</span
59             >
60           </div>
61         </div>
62       </md-input-container>
63       <md-input-container class="md-block">
64         <label translate="WHATSAPP.SECRETACCESSKEY">secretaccesskey</label>
65         <input
66           type="text"
67           name="secretaccesskey"
68           ng-model="vm.amazonlex.secretaccesskey"
69           ng-required="true"
70           ng-disabled="!vm.crudPermissions.canEdit"
71         />
72
73         <div
74           ng-messages="whatsappAccountFormApp['secretaccesskey'].$error"
75           ng-show="whatsappAccountFormApp['secretaccesskey'].$touched"
76           role="alert"
77         >
78           <div ng-message="required">
79             <span translate="WHATSAPP.ERRORS.SECRETACCESSKEY_REQUIRED"
80               >secretaccesskey field is required</span
81             >
82           </div>
83         </div>
84       </md-input-container>
85       <md-input-container class="md-block">
86         <label translate="WHATSAPP.LEXREGION">lexregion</label>
87         <md-select
88           name="lexregion"
89           ng-model="vm.amazonlex.lexregion"
90           required
91           ng-disabled="!vm.crudPermissions.canEdit"
92         >
93           <md-option ng-value="'us-east-1'">US East (N. Virginia)</md-option>
94           <md-option ng-value="'us-west-2'">US West (Oregon)</md-option>
95           <md-option ng-value="'eu-west-1'">EU (Ireland)</md-option>
96           <md-option ng-value="'ap-southeast-2'"
97             >Asia Pacific (Sydney)</md-option
98           >
99         </md-select>
100         <div
101           ng-messages="whatsappAccountFormApp['lexregion'].$error"
102           ng-show="whatsappAccountFormApp['lexregion'].$touched"
103           role="alert"
104         >
105           <div ng-message="required">
106             <span translate="WHATSAPP.ERRORS.LEXREGION_REQUIRED"
107               >lexregion field is required</span
108             >
109           </div>
110         </div>
111       </md-input-container>
112       <md-input-container class="md-block">
113         <label translate="WHATSAPP.BOTNAME">botname</label>
114         <input
115           type="text"
116           name="botname"
117           ng-model="vm.amazonlex.botname"
118           ng-required="true"
119           ng-disabled="!vm.crudPermissions.canEdit"
120         />
121
122         <div
123           ng-messages="whatsappAccountFormApp['botname'].$error"
124           ng-show="whatsappAccountFormApp['botname'].$touched"
125           role="alert"
126         >
127           <div ng-message="required">
128             <span translate="WHATSAPP.ERRORS.BOTNAME_REQUIRED"
129               >botname field is required</span
130             >
131           </div>
132         </div>
133       </md-input-container>
134       <md-input-container class="md-block">
135         <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>
136         <textarea
137           name="welcomemessage"
138           ng-model="vm.amazonlex.welcomemessage"
139           md-maxlength="255"
140         ></textarea>
141         <div class="hint">
142           <span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span>
143         </div>
144
145         <div
146           ng-messages="whatsappAccountFormApp['welcomemessage'].$error"
147           ng-show="whatsappAccountFormApp['welcomemessage'].$touched"
148           role="alert"
149         >
150           <div ng-message="required">
151             <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED"
152               >welcomemessage field is required</span
153             >
154           </div>
155
156           <div ng-message="md-maxlength">
157             <span
158               translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH"
159               translate-values="{max: 255}"
160               >welcomemessage must have a maximum length equal to 255</span
161             >
162           </div>
163         </div>
164       </md-input-container>
165
166       <div class="error-list">
167         <div
168           ng-repeat="error in vm.errors"
169           class="error"
170           layout="row"
171           layout-align="space-between center"
172         >
173           <div>
174             <span class="message">{{error.message}}</span>
175             <span class="type">({{error.type}})</span>
176           </div>
177           <md-button class="md-icon-button">
178             <md-icon
179               md-font-icon="icon-alert-box"
180               aria-label="alert error"
181               class="s16"
182             ></md-icon>
183           </md-button>
184         </div>
185       </div>
186     </md-dialog-content>
187
188     <md-dialog-actions layout="row" layout-align="space-between center">
189       <div
190         layout="row"
191         layout-align="start center"
192         ng-if="vm.crudPermissions.canEdit"
193       >
194         <md-button
195           type="submit"
196           ng-click="vm.saveWhatsappAccountApp()"
197           class="send-button md-accent md-raised"
198           ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine"
199           aria-label="SAVE"
200           translate="WHATSAPP.SAVE"
201           translate-attr-aria-label="WHATSAPP.SAVE"
202         >
203           SAVE
204         </md-button>
205       </div>
206     </md-dialog-actions>
207   </form>
208 </md-dialog>