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">
5 class="md-toolbar-tools"
7 layout-align="space-between center"
9 <span class="title">{{ vm.title | translate }}</span>
10 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
12 md-font-icon="icon-close"
13 aria-label="Close dialog"
19 <md-dialog-content ms-scroll>
20 <div class="error-list">
22 ng-repeat="error in vm.errors"
25 layout-align="space-between center"
28 <span class="message">{{error.message}}</span>
29 <span class="type">({{error.type}})</span>
31 <md-button class="md-icon-button">
33 md-font-icon="icon-alert-box"
34 aria-label="alert error"
40 <md-input-container class="md-block">
41 <label translate="CONTACTMANAGER.NAME">Name</label>
45 ng-model="vm.company.name"
51 ng-messages="companyForm['name'].$error"
52 ng-show="companyForm['name'].$touched"
55 <div ng-message="required">
56 <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED"
57 >Name field is required</span
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" />
67 ng-messages="companyForm['phone'].$error"
68 ng-show="companyForm['phone'].$touched"
71 <div ng-message="required">
72 <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED"
73 >Phone field is required</span
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" />
83 ng-messages="companyForm['vat'].$error"
84 ng-show="companyForm['vat'].$touched"
87 <div ng-message="required">
88 <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED"
89 >Vat field is required</span
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" />
99 ng-messages="companyForm['fax'].$error"
100 ng-show="companyForm['fax'].$touched"
103 <div ng-message="required">
104 <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED"
105 >Fax field is required</span
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" />
115 ng-messages="companyForm['companyId'].$error"
116 ng-show="companyForm['companyId'].$touched"
119 <div ng-message="required">
120 <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED"
121 >CompanyId field is required</span
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" />
131 ng-messages="companyForm['type'].$error"
132 ng-show="companyForm['type'].$touched"
135 <div ng-message="required">
136 <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED"
137 >Type field is required</span
141 </md-input-container>
142 <md-input-container class="md-block">
143 <label translate="CONTACTMANAGER.WEBSITE">Website</label>
147 ng-model="vm.company.website"
152 ng-messages="companyForm['website'].$error"
153 ng-show="companyForm['website'].$touched"
156 <div ng-message="required">
157 <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED"
158 >Website field is required</span
161 <div ng-message="md-maxlength">
163 translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH"
164 translate-values="{max: 255}"
165 >Website must have a maximum length equal to 255</span
169 </md-input-container>
170 <md-input-container class="md-block">
171 <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>
175 ng-model="vm.company.emailDomain"
179 ng-messages="companyForm['emailDomain'].$error"
180 ng-show="companyForm['emailDomain'].$touched"
183 <div ng-message="required">
184 <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED"
185 >Email_Domain field is required</span
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" />
195 ng-messages="companyForm['email'].$error"
196 ng-show="companyForm['email'].$touched"
199 <div ng-message="required">
200 <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED"
201 >Email field is required</span
204 <div ng-message="email">
205 <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID"
206 >Email must be a valid e-mail address</span
210 </md-input-container>
211 <md-input-container class="md-block">
212 <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>
216 ng-model="vm.company.description"
220 ng-messages="companyForm['description'].$error"
221 ng-show="companyForm['description'].$touched"
224 <div ng-message="required">
225 <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED"
226 >Description field is required</span
230 </md-input-container>
232 <div class="error-list">
234 ng-repeat="error in vm.errors"
237 layout-align="space-between center"
240 <span class="message">{{error.message}}</span>
241 <span class="type">({{error.type}})</span>
243 <md-button class="md-icon-button">
245 md-font-icon="icon-alert-box"
246 aria-label="alert error"
256 layout-align="space-between center"
257 ng-if="!vm.crudPermissions.readOnly"
259 <div layout="row" layout-align="start center">
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"
267 translate="CONTACTMANAGER.SAVE"
268 translate-attr-aria-label="CONTACTMANAGER.SAVE"
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"
280 translate="CONTACTMANAGER.ADD_COMPANY"
281 translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY"
288 class="md-icon-button"
289 ng-if="vm.crudPermissions.canDelete && !vm.newCompany"
290 ng-click="vm.deleteCompany($event)"
293 translate-attr-aria-label="CONTACTMANAGER.DELETE"
295 <md-icon md-font-icon="icon-delete"></md-icon>
297 ><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip