8b58cdcff259a89da3bb4142c1c2c3df3e93b8c0
[motion-next.git] /
1 <md-dialog class="freshsalesAccount-dialog" aria-label="New FreshsalesAccount">
2   <form name="freshsalesAccountForm" 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.freshsalesAccount.name"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="freshsalesAccountForm['name'].$error"
52           ng-show="freshsalesAccountForm['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.USERNAME">Username</label>
64         <input
65           type="text"
66           name="username"
67           ng-model="vm.freshsalesAccount.username"
68           ng-required="true"
69         />
70
71         <div
72           ng-messages="freshsalesAccountForm['username'].$error"
73           ng-show="freshsalesAccountForm['username'].$touched"
74           role="alert"
75         >
76           <div ng-message="required">
77             <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED"
78               >Username field is required</span
79             >
80           </div>
81         </div>
82       </md-input-container>
83       <md-input-container class="md-block">
84         <label translate="INTEGRATIONS.URI">Uri</label>
85         <input
86           type="url"
87           name="remoteUri"
88           ng-model="vm.freshsalesAccount.remoteUri"
89           ng-required="true"
90         />
91
92         <div
93           ng-messages="freshsalesAccountForm['remoteUri'].$error"
94           ng-show="freshsalesAccountForm['remoteUri'].$touched"
95           role="alert"
96         >
97           <div ng-message="required">
98             <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED"
99               >Uri field is required</span
100             >
101           </div>
102           <div ng-message="url">
103             <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL"
104               >Uri must be a valid url http://www.xcally.com</span
105             >
106           </div>
107         </div>
108       </md-input-container>
109       <md-input-container class="md-block">
110         <label translate="INTEGRATIONS.APIKEY">ApiKey</label>
111         <input
112           type="text"
113           name="apiKey"
114           ng-model="vm.freshsalesAccount.apiKey"
115           ng-required="true"
116         />
117
118         <div
119           ng-messages="freshsalesAccountForm['apiKey'].$error"
120           ng-show="freshsalesAccountForm['apiKey'].$touched"
121           role="alert"
122         >
123           <div ng-message="required">
124             <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED"
125               >ApiKey field is required</span
126             >
127           </div>
128         </div>
129       </md-input-container>
130       <md-input-container class="md-block">
131         <label translate="INTEGRATIONS.MOTIONPROXYADDRESS"
132           >MotionProxyAddress</label
133         >
134         <input
135           type="url"
136           name="serverUrl"
137           ng-model="vm.freshsalesAccount.serverUrl"
138         />
139
140         <div class="hint">
141           <span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span>
142         </div>
143         <div
144           ng-messages="freshsalesAccountForm['serverUrl'].$error"
145           ng-show="freshsalesAccountForm['serverUrl'].$touched"
146           role="alert"
147         >
148           <div ng-message="required">
149             <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED"
150               >MotionProxyAddress field is required</span
151             >
152           </div>
153           <div ng-message="url">
154             <span
155               translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL"
156               >MotionProxyAddress must be a valid url
157               http://www.xcally.com</span
158             >
159           </div>
160         </div>
161       </md-input-container>
162       <md-input-container class="md-block">
163         <label translate="INTEGRATIONS.DESCRIPTION">Description</label>
164         <input
165           type="text"
166           name="description"
167           ng-model="vm.freshsalesAccount.description"
168         />
169
170         <div
171           ng-messages="freshsalesAccountForm['description'].$error"
172           ng-show="freshsalesAccountForm['description'].$touched"
173           role="alert"
174         >
175           <div ng-message="required">
176             <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED"
177               >Description field is required</span
178             >
179           </div>
180         </div>
181       </md-input-container>
182
183       <div class="error-list">
184         <div
185           ng-repeat="error in vm.errors"
186           class="error"
187           layout="row"
188           layout-align="space-between center"
189         >
190           <div>
191             <span class="message">{{error.message}}</span>
192             <span class="type">({{error.type}})</span>
193           </div>
194           <md-button class="md-icon-button">
195             <md-icon
196               md-font-icon="icon-alert-box"
197               aria-label="alert error"
198               class="s16"
199             ></md-icon>
200           </md-button>
201         </div>
202       </div>
203     </md-dialog-content>
204
205     <md-dialog-actions
206       layout="row"
207       layout-align="space-between center"
208       ng-if="!vm.crudPermissions.readOnly"
209     >
210       <div layout="row" layout-align="start center">
211         <md-button
212           type="submit"
213           ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesAccount"
214           ng-click="vm.saveFreshsalesAccount()"
215           class="send-button md-accent md-raised"
216           ng-disabled="freshsalesAccountForm.$invalid || freshsalesAccountForm.$pristine"
217           aria-label="SAVE"
218           translate="INTEGRATIONS.SAVE"
219           translate-attr-aria-label="INTEGRATIONS.SAVE"
220         >
221           SAVE
222         </md-button>
223
224         <md-button
225           type="submit"
226           ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesAccount"
227           ng-click="vm.addNewFreshsalesAccount()"
228           class="send-button md-accent md-raised"
229           ng-disabled="freshsalesAccountForm.$invalid"
230           aria-label="ADD"
231           translate="INTEGRATIONS.ADD_FRESHSALESACCOUNT"
232           translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT"
233         >
234           ADD FRESHSALESACCOUNT
235         </md-button>
236       </div>
237       <div layout="row">
238         <md-button
239           class="md-icon-button"
240           ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesAccount"
241           ng-click="vm.deleteFreshsalesAccount($event)"
242           aria-label="DELETE"
243           translate
244           translate-attr-aria-label="INTEGRATIONS.DELETE"
245         >
246           <md-icon md-font-icon="icon-delete"></md-icon>
247           <md-tooltip
248             ><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip
249           >
250         </md-button>
251       </div>
252     </md-dialog-actions>
253   </form>
254 </md-dialog>