062e07087218c02a289a5704d99a9ca7d99e64c8
[motion-next.git] /
1 <md-dialog
2   class="openchannelCannedAnswer-dialog"
3   aria-label="New OpenchannelCannedAnswer"
4 >
5   <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>
6     <md-toolbar class="md-accent md-hue-2">
7       <div
8         class="md-toolbar-tools"
9         layout="row"
10         layout-align="space-between center"
11       >
12         <span class="title">{{ vm.title | translate }}</span>
13         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
14           <md-icon
15             md-font-icon="icon-close"
16             aria-label="Close dialog"
17           ></md-icon>
18         </md-button>
19       </div>
20     </md-toolbar>
21
22     <md-dialog-content ms-scroll>
23       <div class="error-list">
24         <div
25           ng-repeat="error in vm.errors"
26           class="error"
27           layout="row"
28           layout-align="space-between center"
29         >
30           <div>
31             <span class="message">{{error.message}}</span>
32             <span class="type">({{error.type}})</span>
33           </div>
34           <md-button class="md-icon-button">
35             <md-icon
36               md-font-icon="icon-alert-box"
37               aria-label="alert error"
38               class="s16"
39             ></md-icon>
40           </md-button>
41         </div>
42       </div>
43       <md-input-container class="md-block">
44         <label translate="OPENCHANNEL.KEY">Key</label>
45         <input
46           type=""
47           name="key"
48           ng-model="vm.openchannelCannedAnswer.key"
49           md-maxlength="255"
50           ng-required="true"
51           autofocus
52         />
53
54         <div
55           ng-messages="openchannelCannedAnswerForm['key'].$error"
56           ng-show="openchannelCannedAnswerForm['key'].$touched"
57           role="alert"
58         >
59           <div ng-message="required">
60             <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED"
61               >Key field is required</span
62             >
63           </div>
64         </div>
65       </md-input-container>
66       <md-input-container class="md-block">
67         <label translate="OPENCHANNEL.VALUE">Value</label>
68         <textarea
69           name="value"
70           ng-model="vm.openchannelCannedAnswer.value"
71           required
72         ></textarea>
73
74         <div
75           ng-messages="openchannelCannedAnswerForm['value'].$error"
76           ng-show="openchannelCannedAnswerForm['value'].$touched"
77           role="alert"
78         >
79           <div ng-message="required">
80             <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED"
81               >Value field is required</span
82             >
83           </div>
84         </div>
85       </md-input-container>
86       <md-input-container class="md-block">
87         <label translate="OPENCHANNEL.DESCRIPTION">Description</label>
88         <input
89           type="text"
90           name="description"
91           ng-model="vm.openchannelCannedAnswer.description"
92         />
93
94         <div
95           ng-messages="openchannelCannedAnswerForm['description'].$error"
96           ng-show="openchannelCannedAnswerForm['description'].$touched"
97           role="alert"
98         >
99           <div ng-message="required">
100             <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED"
101               >Description field is required</span
102             >
103           </div>
104         </div>
105       </md-input-container>
106
107       <div class="error-list">
108         <div
109           ng-repeat="error in vm.errors"
110           class="error"
111           layout="row"
112           layout-align="space-between center"
113         >
114           <div>
115             <span class="message">{{error.message}}</span>
116             <span class="type">({{error.type}})</span>
117           </div>
118           <md-button class="md-icon-button">
119             <md-icon
120               md-font-icon="icon-alert-box"
121               aria-label="alert error"
122               class="s16"
123             ></md-icon>
124           </md-button>
125         </div>
126       </div>
127     </md-dialog-content>
128
129     <md-dialog-actions
130       layout="row"
131       layout-align="space-between center"
132       ng-if="!vm.crudPermissions.readOnly"
133     >
134       <div layout="row" layout-align="start center">
135         <md-button
136           type="submit"
137           ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelCannedAnswer"
138           ng-click="vm.saveOpenchannelCannedAnswer()"
139           class="send-button md-accent md-raised"
140           ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine"
141           aria-label="SAVE"
142           translate="OPENCHANNEL.SAVE"
143           translate-attr-aria-label="OPENCHANNEL.SAVE"
144         >
145           SAVE
146         </md-button>
147
148         <md-button
149           type="submit"
150           ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelCannedAnswer"
151           ng-click="vm.addNewOpenchannelCannedAnswer()"
152           class="send-button md-accent md-raised"
153           ng-disabled="openchannelCannedAnswerForm.$invalid"
154           aria-label="ADD"
155           translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER"
156           translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER"
157         >
158           ADD OPENCHANNELCANNEDANSWER
159         </md-button>
160       </div>
161       <div layout="row">
162         <md-button
163           class="md-icon-button"
164           ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelCannedAnswer"
165           ng-click="vm.deleteOpenchannelCannedAnswer($event)"
166           aria-label="DELETE"
167           translate
168           translate-attr-aria-label="OPENCHANNEL.DELETE"
169         >
170           <md-icon md-font-icon="icon-delete"></md-icon>
171           <md-tooltip
172             ><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip
173           >
174         </md-button>
175       </div>
176     </md-dialog-actions>
177   </form>
178 </md-dialog>