219c31b56bce805de9437b50927ca53d90794e31
[motion-next.git] /
1 <md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">
2   <form name="smsCannedAnswerForm" 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="SMS.KEY">Key</label>
42         <input
43           type=""
44           name="key"
45           ng-model="vm.smsCannedAnswer.key"
46           md-maxlength="255"
47           ng-required="true"
48           autofocus
49         />
50
51         <div
52           ng-messages="smsCannedAnswerForm['key'].$error"
53           ng-show="smsCannedAnswerForm['key'].$touched"
54           role="alert"
55         >
56           <div ng-message="required">
57             <span translate="SMS.ERRORS.KEY_REQUIRED"
58               >Key field is required</span
59             >
60           </div>
61         </div>
62       </md-input-container>
63       <md-input-container class="md-block">
64         <label translate="SMS.VALUE">Value</label>
65         <textarea
66           name="value"
67           ng-model="vm.smsCannedAnswer.value"
68           required
69         ></textarea>
70
71         <div
72           ng-messages="smsCannedAnswerForm['value'].$error"
73           ng-show="smsCannedAnswerForm['value'].$touched"
74           role="alert"
75         >
76           <div ng-message="required">
77             <span translate="SMS.ERRORS.VALUE_REQUIRED"
78               >Value field is required</span
79             >
80           </div>
81         </div>
82       </md-input-container>
83       <md-input-container class="md-block">
84         <label translate="SMS.DESCRIPTION">Description</label>
85         <input
86           type="text"
87           name="description"
88           ng-model="vm.smsCannedAnswer.description"
89         />
90
91         <div
92           ng-messages="smsCannedAnswerForm['description'].$error"
93           ng-show="smsCannedAnswerForm['description'].$touched"
94           role="alert"
95         >
96           <div ng-message="required">
97             <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED"
98               >Description field is required</span
99             >
100           </div>
101         </div>
102       </md-input-container>
103
104       <div class="error-list">
105         <div
106           ng-repeat="error in vm.errors"
107           class="error"
108           layout="row"
109           layout-align="space-between center"
110         >
111           <div>
112             <span class="message">{{error.message}}</span>
113             <span class="type">({{error.type}})</span>
114           </div>
115           <md-button class="md-icon-button">
116             <md-icon
117               md-font-icon="icon-alert-box"
118               aria-label="alert error"
119               class="s16"
120             ></md-icon>
121           </md-button>
122         </div>
123       </div>
124     </md-dialog-content>
125
126     <md-dialog-actions
127       layout="row"
128       layout-align="space-between center"
129       ng-if="!vm.crudPermissions.readOnly"
130     >
131       <div layout="row" layout-align="start center">
132         <md-button
133           type="submit"
134           ng-if="vm.crudPermissions.canEdit && !vm.newSmsCannedAnswer"
135           ng-click="vm.saveSmsCannedAnswer()"
136           class="send-button md-accent md-raised"
137           ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine"
138           aria-label="SAVE"
139           translate="SMS.SAVE"
140           translate-attr-aria-label="SMS.SAVE"
141         >
142           SAVE
143         </md-button>
144
145         <md-button
146           type="submit"
147           ng-if="vm.crudPermissions.canEdit && vm.newSmsCannedAnswer"
148           ng-click="vm.addNewSmsCannedAnswer()"
149           class="send-button md-accent md-raised"
150           ng-disabled="smsCannedAnswerForm.$invalid"
151           aria-label="ADD"
152           translate="SMS.ADD_SMSCANNEDANSWER"
153           translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER"
154         >
155           ADD SMSCANNEDANSWER
156         </md-button>
157       </div>
158       <div layout="row">
159         <md-button
160           class="md-icon-button"
161           ng-if="vm.crudPermissions.canDelete && !vm.newSmsCannedAnswer"
162           ng-click="vm.deleteSmsCannedAnswer($event)"
163           aria-label="DELETE"
164           translate
165           translate-attr-aria-label="SMS.DELETE"
166         >
167           <md-icon md-font-icon="icon-delete"></md-icon>
168           <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>
169         </md-button>
170       </div>
171     </md-dialog-actions>
172   </form>
173 </md-dialog>