ea08f3b87932101735c0a8e3e894bed5876691aa
[motion-next.git] /
1 <md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">
2   <form name="voiceRecordingForm" 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="VOICE.RATING">Rating</label>
42         <md-select
43           name="rating"
44           ng-model="vm.voiceRecording.rating"
45           autofocus
46           ng-disabled="!vm.newVoiceRecording && !vm.crudPermissions.canEdit"
47         >
48           <md-option ng-value="null"
49             >{{'VOICE.NO_RATING' | translate}}</md-option
50           >
51           <md-option value="1"
52             ><md-icon
53               md-font-icon="icon-star"
54               style="color: red"
55               ng-repeat="icon in [1]"
56             ></md-icon
57           ></md-option>
58           <md-option value="2"
59             ><md-icon
60               md-font-icon="icon-star"
61               style="color: red"
62               ng-repeat="icon in [1,2]"
63             ></md-icon
64           ></md-option>
65           <md-option value="3"
66             ><md-icon
67               md-font-icon="icon-star"
68               style="color: red"
69               ng-repeat="icon in [1,2,3]"
70             ></md-icon
71           ></md-option>
72           <md-option value="4"
73             ><md-icon
74               md-font-icon="icon-star"
75               style="color: red"
76               ng-repeat="icon in [1,2,3,4]"
77             ></md-icon
78           ></md-option>
79           <md-option value="5"
80             ><md-icon
81               md-font-icon="icon-star"
82               style="color: red"
83               ng-repeat="icon in [1,2,3,4,5]"
84             ></md-icon
85           ></md-option>
86         </md-select>
87         <div
88           ng-messages="voiceRecordingForm['rating'].$error"
89           ng-show="voiceRecordingForm[rating].$touched"
90           role="alert"
91         >
92           <div ng-message="required">
93             <span translate="VOICE.ERRORS.RATING_REQUIRED"
94               >Rating field is required</span
95             >
96           </div>
97         </div>
98       </md-input-container>
99
100       <div class="error-list">
101         <div
102           ng-repeat="error in vm.errors"
103           class="error"
104           layout="row"
105           layout-align="space-between center"
106         >
107           <div>
108             <span class="message">{{error.message}}</span>
109             <span class="type">({{error.type}})</span>
110           </div>
111           <md-button class="md-icon-button">
112             <md-icon
113               md-font-icon="icon-alert-box"
114               aria-label="alert error"
115               class="s16"
116             ></md-icon>
117           </md-button>
118         </div>
119       </div>
120     </md-dialog-content>
121
122     <md-dialog-actions
123       layout="row"
124       layout-align="space-between center"
125       ng-if="!vm.crudPermissions.readOnly"
126     >
127       <div layout="row" layout-align="start center">
128         <md-button
129           type="submit"
130           ng-if="vm.crudPermissions.canEdit && !vm.newVoiceRecording"
131           ng-click="vm.saveVoiceRecording()"
132           class="send-button md-accent md-raised"
133           ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine"
134           aria-label="SAVE"
135           translate="VOICE.SAVE"
136           translate-attr-aria-label="VOICE.SAVE"
137         >
138           SAVE
139         </md-button>
140
141         <md-button
142           type="submit"
143           ng-if="vm.crudPermissions.canEdit && vm.newVoiceRecording"
144           ng-click="vm.addNewVoiceRecording()"
145           class="send-button md-accent md-raised"
146           ng-disabled="voiceRecordingForm.$invalid"
147           aria-label="ADD"
148           translate="VOICE.ADD_VOICERECORDING"
149           translate-attr-aria-label="VOICE.ADD_VOICERECORDING"
150         >
151           ADD VOICERECORDING
152         </md-button>
153       </div>
154       <div layout="row">
155         <md-button
156           class="md-icon-button"
157           ng-if="vm.crudPermissions.canDelete && !vm.newVoiceRecording"
158           ng-click="vm.deleteVoiceRecording($event)"
159           aria-label="DELETE"
160           translate
161           translate-attr-aria-label="VOICE.DELETE"
162         >
163           <md-icon md-font-icon="icon-delete"></md-icon>
164           <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>
165         </md-button>
166       </div>
167     </md-dialog-actions>
168   </form>
169 </md-dialog>