08ec333907ac0b99b83d538a4ba87d74ed557c1e
[motion-next.git] /
1 <md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">
2   <form name="zohoAccountForm" 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="INTEGRATIONS.NAME">Name</label>
42         <input
43           type="text"
44           name="name"
45           ng-model="vm.zohoAccount.name"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="zohoAccountForm['name'].$error"
52           ng-show="zohoAccountForm['name'].$touched"
53           role="alert"
54         >
55           <div ng-message="required">
56             <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED"
57               >Name field is required</span
58             >
59           </div>
60         </div>
61       </md-input-container>
62       <md-input-container class="md-block">
63         <label translate="INTEGRATIONS.HOST">Host</label>
64         <md-select name="host" ng-model="vm.zohoAccount.host" required>
65           <md-option ng-value="'zoho.com'">zoho.com</md-option>
66           <md-option ng-value="'zoho.eu'">zoho.eu</md-option>
67         </md-select>
68         <div
69           ng-messages="zohoAccountForm['host'].$error"
70           ng-show="zohoAccountForm['host'].$touched"
71           role="alert"
72         >
73           <div ng-message="required">
74             <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED"
75               >Host field is required</span
76             >
77           </div>
78         </div>
79       </md-input-container>
80       <md-input-container class="md-block">
81         <label translate="INTEGRATIONS.ZONE">Zone</label>
82         <md-select name="zone" ng-model="vm.zohoAccount.zone" required>
83           <md-option ng-value="'US'">US</md-option>
84           <md-option ng-value="'AU'">AU</md-option>
85           <md-option ng-value="'EU'">EU</md-option>
86           <md-option ng-value="'IN'">IN</md-option>
87           <md-option ng-value="'CN'">CN</md-option>
88         </md-select>
89         <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>
90         <div
91           ng-messages="zohoAccountForm['zone'].$error"
92           ng-show="zohoAccountForm['zone'].$touched"
93           role="alert"
94         >
95           <div ng-message="required">
96             <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED"
97               >Zone field is required</span
98             >
99           </div>
100         </div>
101       </md-input-container>
102       <md-input-container class="md-block">
103         <label translate="INTEGRATIONS.CLIENTID">ClientId</label>
104         <input
105           type="text"
106           name="clientId"
107           ng-model="vm.zohoAccount.clientId"
108           ng-required="true"
109         />
110
111         <div class="hint">
112           <span translate="INTEGRATIONS.HELP.CLIENTID"></span>
113         </div>
114         <div
115           ng-messages="zohoAccountForm['clientId'].$error"
116           ng-show="zohoAccountForm['clientId'].$touched"
117           role="alert"
118         >
119           <div ng-message="required">
120             <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED"
121               >ClientId field is required</span
122             >
123           </div>
124         </div>
125       </md-input-container>
126       <md-input-container class="md-block">
127         <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>
128         <input
129           type="text"
130           name="clientSecret"
131           ng-model="vm.zohoAccount.clientSecret"
132           ng-required="true"
133         />
134
135         <div class="hint">
136           <span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span>
137         </div>
138         <div
139           ng-messages="zohoAccountForm['clientSecret'].$error"
140           ng-show="zohoAccountForm['clientSecret'].$touched"
141           role="alert"
142         >
143           <div ng-message="required">
144             <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED"
145               >ClientSecret field is required</span
146             >
147           </div>
148         </div>
149       </md-input-container>
150       <md-input-container class="md-block">
151         <label translate="INTEGRATIONS.CODE">Code</label>
152         <input
153           type="text"
154           name="code"
155           ng-model="vm.zohoAccount.code"
156           ng-required="true"
157         />
158
159         <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>
160         <div
161           ng-messages="zohoAccountForm['code'].$error"
162           ng-show="zohoAccountForm['code'].$touched"
163           role="alert"
164         >
165           <div ng-message="required">
166             <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED"
167               >Code field is required</span
168             >
169           </div>
170         </div>
171       </md-input-container>
172       <md-input-container class="md-block">
173         <label translate="INTEGRATIONS.MOTIONPROXYADDRESS"
174           >MotionProxyAddress</label
175         >
176         <input
177           type="url"
178           name="serverUrl"
179           ng-model="vm.zohoAccount.serverUrl"
180         />
181
182         <div class="hint">
183           <span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span>
184         </div>
185         <div
186           ng-messages="zohoAccountForm['serverUrl'].$error"
187           ng-show="zohoAccountForm['serverUrl'].$touched"
188           role="alert"
189         >
190           <div ng-message="required">
191             <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED"
192               >MotionProxyAddress field is required</span
193             >
194           </div>
195           <div ng-message="url">
196             <span
197               translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL"
198               >MotionProxyAddress must be a valid url
199               http://www.xcally.com</span
200             >
201           </div>
202         </div>
203       </md-input-container>
204       <md-input-container class="md-block">
205         <label translate="INTEGRATIONS.DESCRIPTION">Description</label>
206         <input
207           type="text"
208           name="description"
209           ng-model="vm.zohoAccount.description"
210         />
211
212         <div
213           ng-messages="zohoAccountForm['description'].$error"
214           ng-show="zohoAccountForm['description'].$touched"
215           role="alert"
216         >
217           <div ng-message="required">
218             <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED"
219               >Description field is required</span
220             >
221           </div>
222         </div>
223       </md-input-container>
224
225       <div class="error-list">
226         <div
227           ng-repeat="error in vm.errors"
228           class="error"
229           layout="row"
230           layout-align="space-between center"
231         >
232           <div>
233             <span class="message">{{error.message}}</span>
234             <span class="type">({{error.type}})</span>
235           </div>
236           <md-button class="md-icon-button">
237             <md-icon
238               md-font-icon="icon-alert-box"
239               aria-label="alert error"
240               class="s16"
241             ></md-icon>
242           </md-button>
243         </div>
244       </div>
245     </md-dialog-content>
246
247     <md-dialog-actions
248       layout="row"
249       layout-align="space-between center"
250       ng-if="!vm.crudPermissions.readOnly"
251     >
252       <div layout="row" layout-align="start center">
253         <md-button
254           type="submit"
255           ng-if="vm.crudPermissions.canEdit && !vm.newZohoAccount"
256           ng-click="vm.saveZohoAccount()"
257           class="send-button md-accent md-raised"
258           ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine"
259           aria-label="SAVE"
260           translate="INTEGRATIONS.SAVE"
261           translate-attr-aria-label="INTEGRATIONS.SAVE"
262         >
263           SAVE
264         </md-button>
265
266         <md-button
267           type="submit"
268           ng-if="vm.crudPermissions.canEdit && vm.newZohoAccount"
269           ng-click="vm.addNewZohoAccount()"
270           class="send-button md-accent md-raised"
271           ng-disabled="zohoAccountForm.$invalid"
272           aria-label="ADD"
273           translate="INTEGRATIONS.ADD_ZOHOACCOUNT"
274           translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT"
275         >
276           ADD ZOHOACCOUNT
277         </md-button>
278       </div>
279       <div layout="row">
280         <md-button
281           class="md-icon-button"
282           ng-if="vm.crudPermissions.canDelete && !vm.newZohoAccount"
283           ng-click="vm.deleteZohoAccount($event)"
284           aria-label="DELETE"
285           translate
286           translate-attr-aria-label="INTEGRATIONS.DELETE"
287         >
288           <md-icon md-font-icon="icon-delete"></md-icon>
289           <md-tooltip
290             ><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip
291           >
292         </md-button>
293       </div>
294     </md-dialog-actions>
295   </form>
296 </md-dialog>