c19ba1f2849d0117e00af42e302a5de747ab3cd1
[motion-next.git] /
1 <md-dialog class="company-dialog" aria-label="New Company">
2   <form name="companyForm" 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="CONTACTMANAGER.NAME">Name</label>
42         <input
43           type="text"
44           name="name"
45           ng-model="vm.company.name"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="companyForm['name'].$error"
52           ng-show="companyForm['name'].$touched"
53           role="alert"
54         >
55           <div ng-message="required">
56             <span translate="CONTACTMANAGER.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="CONTACTMANAGER.PHONE">Phone</label>
64         <input type="text" name="phone" ng-model="vm.company.phone" />
65
66         <div
67           ng-messages="companyForm['phone'].$error"
68           ng-show="companyForm['phone'].$touched"
69           role="alert"
70         >
71           <div ng-message="required">
72             <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED"
73               >Phone field is required</span
74             >
75           </div>
76         </div>
77       </md-input-container>
78       <md-input-container class="md-block">
79         <label translate="CONTACTMANAGER.VAT">Vat</label>
80         <input type="text" name="vat" ng-model="vm.company.vat" />
81
82         <div
83           ng-messages="companyForm['vat'].$error"
84           ng-show="companyForm['vat'].$touched"
85           role="alert"
86         >
87           <div ng-message="required">
88             <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED"
89               >Vat field is required</span
90             >
91           </div>
92         </div>
93       </md-input-container>
94       <md-input-container class="md-block">
95         <label translate="CONTACTMANAGER.FAX">Fax</label>
96         <input type="text" name="fax" ng-model="vm.company.fax" />
97
98         <div
99           ng-messages="companyForm['fax'].$error"
100           ng-show="companyForm['fax'].$touched"
101           role="alert"
102         >
103           <div ng-message="required">
104             <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED"
105               >Fax field is required</span
106             >
107           </div>
108         </div>
109       </md-input-container>
110       <md-input-container class="md-block">
111         <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>
112         <input type="text" name="companyId" ng-model="vm.company.companyId" />
113
114         <div
115           ng-messages="companyForm['companyId'].$error"
116           ng-show="companyForm['companyId'].$touched"
117           role="alert"
118         >
119           <div ng-message="required">
120             <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED"
121               >CompanyId field is required</span
122             >
123           </div>
124         </div>
125       </md-input-container>
126       <md-input-container class="md-block">
127         <label translate="CONTACTMANAGER.TYPE">Type</label>
128         <input type="text" name="type" ng-model="vm.company.type" />
129
130         <div
131           ng-messages="companyForm['type'].$error"
132           ng-show="companyForm['type'].$touched"
133           role="alert"
134         >
135           <div ng-message="required">
136             <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED"
137               >Type field is required</span
138             >
139           </div>
140         </div>
141       </md-input-container>
142       <md-input-container class="md-block">
143         <label translate="CONTACTMANAGER.WEBSITE">Website</label>
144         <input
145           type="text"
146           name="website"
147           ng-model="vm.company.website"
148           md-maxlength="255"
149         />
150
151         <div
152           ng-messages="companyForm['website'].$error"
153           ng-show="companyForm['website'].$touched"
154           role="alert"
155         >
156           <div ng-message="required">
157             <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED"
158               >Website field is required</span
159             >
160           </div>
161           <div ng-message="md-maxlength">
162             <span
163               translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH"
164               translate-values="{max: 255}"
165               >Website must have a maximum length equal to 255</span
166             >
167           </div>
168         </div>
169       </md-input-container>
170       <md-input-container class="md-block">
171         <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>
172         <input
173           type="text"
174           name="emailDomain"
175           ng-model="vm.company.emailDomain"
176         />
177
178         <div
179           ng-messages="companyForm['emailDomain'].$error"
180           ng-show="companyForm['emailDomain'].$touched"
181           role="alert"
182         >
183           <div ng-message="required">
184             <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED"
185               >Email_Domain field is required</span
186             >
187           </div>
188         </div>
189       </md-input-container>
190       <md-input-container class="md-block">
191         <label translate="CONTACTMANAGER.EMAIL">Email</label>
192         <input type="email" name="email" ng-model="vm.company.email" />
193
194         <div
195           ng-messages="companyForm['email'].$error"
196           ng-show="companyForm['email'].$touched"
197           role="alert"
198         >
199           <div ng-message="required">
200             <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED"
201               >Email field is required</span
202             >
203           </div>
204           <div ng-message="email">
205             <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID"
206               >Email must be a valid e-mail address</span
207             >
208           </div>
209         </div>
210       </md-input-container>
211       <md-input-container class="md-block">
212         <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>
213         <input
214           type="text"
215           name="description"
216           ng-model="vm.company.description"
217         />
218
219         <div
220           ng-messages="companyForm['description'].$error"
221           ng-show="companyForm['description'].$touched"
222           role="alert"
223         >
224           <div ng-message="required">
225             <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED"
226               >Description field is required</span
227             >
228           </div>
229         </div>
230       </md-input-container>
231
232       <div class="error-list">
233         <div
234           ng-repeat="error in vm.errors"
235           class="error"
236           layout="row"
237           layout-align="space-between center"
238         >
239           <div>
240             <span class="message">{{error.message}}</span>
241             <span class="type">({{error.type}})</span>
242           </div>
243           <md-button class="md-icon-button">
244             <md-icon
245               md-font-icon="icon-alert-box"
246               aria-label="alert error"
247               class="s16"
248             ></md-icon>
249           </md-button>
250         </div>
251       </div>
252     </md-dialog-content>
253
254     <md-dialog-actions
255       layout="row"
256       layout-align="space-between center"
257       ng-if="!vm.crudPermissions.readOnly"
258     >
259       <div layout="row" layout-align="start center">
260         <md-button
261           type="submit"
262           ng-if="vm.crudPermissions.canEdit && !vm.newCompany"
263           ng-click="vm.saveCompany()"
264           class="send-button md-accent md-raised"
265           ng-disabled="companyForm.$invalid || companyForm.$pristine"
266           aria-label="SAVE"
267           translate="CONTACTMANAGER.SAVE"
268           translate-attr-aria-label="CONTACTMANAGER.SAVE"
269         >
270           SAVE
271         </md-button>
272
273         <md-button
274           type="submit"
275           ng-if="vm.crudPermissions.canEdit && vm.newCompany"
276           ng-click="vm.addNewCompany()"
277           class="send-button md-accent md-raised"
278           ng-disabled="companyForm.$invalid"
279           aria-label="ADD"
280           translate="CONTACTMANAGER.ADD_COMPANY"
281           translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY"
282         >
283           ADD COMPANY
284         </md-button>
285       </div>
286       <div layout="row">
287         <md-button
288           class="md-icon-button"
289           ng-if="vm.crudPermissions.canDelete && !vm.newCompany"
290           ng-click="vm.deleteCompany($event)"
291           aria-label="DELETE"
292           translate
293           translate-attr-aria-label="CONTACTMANAGER.DELETE"
294         >
295           <md-icon md-font-icon="icon-delete"></md-icon>
296           <md-tooltip
297             ><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip
298           >
299         </md-button>
300       </div>
301     </md-dialog-actions>
302   </form>
303 </md-dialog>