f5aa2fd7b17027c64c9b2913d60f9e4b67ecb6dd
[motion-next.git] /
1 <md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">
2   <form name="chatWebsiteFormApp" 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="CHAT.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="chatWebsiteFormApp['key'].$error"
53           ng-show="chatWebsiteFormApp['key'].$touched"
54           role="alert"
55         >
56           <div ng-message="required">
57             <span translate="CHAT.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="CHAT.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="chatWebsiteFormApp['language'].$error"
94           ng-show="chatWebsiteFormApp['language'].$touched"
95           role="alert"
96         >
97           <div ng-message="required">
98             <span translate="CHAT.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="CHAT.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="CHAT.HELP.WELCOMEMESSAGE"></span>
113         </div>
114
115         <div
116           ng-messages="chatWebsiteFormApp['welcomemessage'].$error"
117           ng-show="chatWebsiteFormApp['welcomemessage'].$touched"
118           role="alert"
119         >
120           <div ng-message="md-maxlength">
121             <span
122               translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH"
123               translate-values="{max: 255}"
124               >welcomemessage must have a maximum length equal to 255</span
125             >
126           </div>
127         </div>
128       </md-input-container>
129
130       <div class="error-list">
131         <div
132           ng-repeat="error in vm.errors"
133           class="error"
134           layout="row"
135           layout-align="space-between center"
136         >
137           <div>
138             <span class="message">{{error.message}}</span>
139             <span class="type">({{error.type}})</span>
140           </div>
141           <md-button class="md-icon-button">
142             <md-icon
143               md-font-icon="icon-alert-box"
144               aria-label="alert error"
145               class="s16"
146             ></md-icon>
147           </md-button>
148         </div>
149       </div>
150     </md-dialog-content>
151
152     <md-dialog-actions layout="row" layout-align="space-between center">
153       <div
154         layout="row"
155         layout-align="start center"
156         ng-if="vm.crudPermissions.canEdit"
157       >
158         <md-button
159           type="submit"
160           ng-click="vm.saveChatWebsiteApp()"
161           class="send-button md-accent md-raised"
162           ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine"
163           aria-label="SAVE"
164           translate="CHAT.SAVE"
165           translate-attr-aria-label="CHAT.SAVE"
166         >
167           SAVE
168         </md-button>
169       </div>
170     </md-dialog-actions>
171   </form>
172 </md-dialog>