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