09e0a9b1a421d1ee1a33c25c3d8aa6fc6b441ea2
[motion-next.git] /
1 <md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">
2   <form name="mailSubstatusForm" 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="MAIL.NAME">Name</label>
42         <input
43           type="text"
44           name="name"
45           ng-model="vm.mailSubstatus.name"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="mailSubstatusForm['name'].$error"
52           ng-show="mailSubstatusForm['name'].$touched"
53           role="alert"
54         >
55           <div ng-message="required">
56             <span translate="MAIL.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="MAIL.DESCRIPTION">Description</label>
64         <input
65           type="text"
66           name="description"
67           ng-model="vm.mailSubstatus.description"
68         />
69
70         <div
71           ng-messages="mailSubstatusForm['description'].$error"
72           ng-show="mailSubstatusForm['description'].$touched"
73           role="alert"
74         >
75           <div ng-message="required">
76             <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED"
77               >Description field is required</span
78             >
79           </div>
80         </div>
81       </md-input-container>
82
83       <div class="error-list">
84         <div
85           ng-repeat="error in vm.errors"
86           class="error"
87           layout="row"
88           layout-align="space-between center"
89         >
90           <div>
91             <span class="message">{{error.message}}</span>
92             <span class="type">({{error.type}})</span>
93           </div>
94           <md-button class="md-icon-button">
95             <md-icon
96               md-font-icon="icon-alert-box"
97               aria-label="alert error"
98               class="s16"
99             ></md-icon>
100           </md-button>
101         </div>
102       </div>
103     </md-dialog-content>
104
105     <md-dialog-actions
106       layout="row"
107       layout-align="space-between center"
108       ng-if="!vm.crudPermissions.readOnly"
109     >
110       <div layout="row" layout-align="start center">
111         <md-button
112           type="submit"
113           ng-if="vm.crudPermissions.canEdit && !vm.newMailSubstatus"
114           ng-click="vm.saveMailSubstatus()"
115           class="send-button md-accent md-raised"
116           ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine"
117           aria-label="SAVE"
118           translate="MAIL.SAVE"
119           translate-attr-aria-label="MAIL.SAVE"
120         >
121           SAVE
122         </md-button>
123
124         <md-button
125           type="submit"
126           ng-if="vm.crudPermissions.canEdit && vm.newMailSubstatus"
127           ng-click="vm.addNewMailSubstatus()"
128           class="send-button md-accent md-raised"
129           ng-disabled="mailSubstatusForm.$invalid"
130           aria-label="ADD"
131           translate="MAIL.ADD_MAILSUBSTATUS"
132           translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS"
133         >
134           ADD MAILSUBSTATUS
135         </md-button>
136       </div>
137       <div layout="row">
138         <md-button
139           class="md-icon-button"
140           ng-if="vm.crudPermissions.canDelete && !vm.newMailSubstatus"
141           ng-click="vm.deleteMailSubstatus($event)"
142           aria-label="DELETE"
143           translate
144           translate-attr-aria-label="MAIL.DELETE"
145         >
146           <md-icon md-font-icon="icon-delete"></md-icon>
147           <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>
148         </md-button>
149       </div>
150     </md-dialog-actions>
151   </form>
152 </md-dialog>