df50a9671b786c3aad2102abaa9ab6b8d05cfc69
[motion-next.git] /
1 <md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">
2   <form name="deskConfigurationForm" 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="INTEGRATIONS.NAME">Name</label>
42         <input
43           type=""
44           name="name"
45           ng-model="vm.deskConfiguration.name"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="deskConfigurationForm['name'].$error"
52           ng-show="deskConfigurationForm['name'].$touched"
53           role="alert"
54         >
55           <div ng-message="required">
56             <span translate="INTEGRATIONS.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="INTEGRATIONS.CHANNEL">Channel</label>
64         <md-select
65           name="channel"
66           ng-model="vm.deskConfiguration.channel"
67           required
68         >
69           <md-option ng-value="'voice'">
70             {{ 'INTEGRATIONS.VOICE' | translate }}
71           </md-option>
72         </md-select>
73         <div
74           ng-messages="deskConfigurationForm['channel'].$error"
75           ng-show="deskConfigurationForm['channel'].$touched"
76           role="alert"
77         >
78           <div ng-message="required">
79             <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED"
80               >Channel field is required</span
81             >
82           </div>
83         </div>
84       </md-input-container>
85       <md-input-container class="md-block">
86         <label translate="INTEGRATIONS.TYPE">Type</label>
87         <md-select name="type" ng-model="vm.deskConfiguration.type" required>
88           <md-option ng-value="'inbound'">
89             {{ 'INTEGRATIONS.INBOUND_IN_QUEUE' | translate }}
90           </md-option>
91
92           <md-option ng-value="'outbound'">
93             {{ 'INTEGRATIONS.OUTBOUND_CALL' | translate }}
94           </md-option>
95         </md-select>
96         <div
97           ng-messages="deskConfigurationForm['type'].$error"
98           ng-show="deskConfigurationForm['type'].$touched"
99           role="alert"
100         >
101           <div ng-message="required">
102             <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED"
103               >Type field is required</span
104             >
105           </div>
106         </div>
107       </md-input-container>
108
109       <div class="error-list">
110         <div
111           ng-repeat="error in vm.errors"
112           class="error"
113           layout="row"
114           layout-align="space-between center"
115         >
116           <div>
117             <span class="message">{{error.message}}</span>
118             <span class="type">({{error.type}})</span>
119           </div>
120           <md-button class="md-icon-button">
121             <md-icon
122               md-font-icon="icon-alert-box"
123               aria-label="alert error"
124               class="s16"
125             ></md-icon>
126           </md-button>
127         </div>
128       </div>
129     </md-dialog-content>
130
131     <md-dialog-actions
132       layout="row"
133       layout-align="space-between center"
134       ng-if="!vm.crudPermissions.readOnly"
135     >
136       <div layout="row" layout-align="start center">
137         <md-button
138           type="submit"
139           ng-if="vm.crudPermissions.canEdit && !vm.newDeskConfiguration"
140           ng-click="vm.saveDeskConfiguration()"
141           class="send-button md-accent md-raised"
142           ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine"
143           aria-label="SAVE"
144           translate="INTEGRATIONS.SAVE"
145           translate-attr-aria-label="INTEGRATIONS.SAVE"
146         >
147           SAVE
148         </md-button>
149
150         <md-button
151           type="submit"
152           ng-if="vm.crudPermissions.canEdit && vm.newDeskConfiguration"
153           ng-click="vm.addNewDeskConfiguration()"
154           class="send-button md-accent md-raised"
155           ng-disabled="deskConfigurationForm.$invalid"
156           aria-label="ADD"
157           translate="INTEGRATIONS.ADD_DESKCONFIGURATION"
158           translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION"
159         >
160           ADD DESKCONFIGURATION
161         </md-button>
162       </div>
163       <div layout="row">
164         <md-button
165           class="md-icon-button"
166           ng-if="vm.crudPermissions.canDelete && !vm.newDeskConfiguration"
167           ng-click="vm.deleteDeskConfiguration($event)"
168           aria-label="DELETE"
169           translate
170           translate-attr-aria-label="INTEGRATIONS.DELETE"
171         >
172           <md-icon md-font-icon="icon-delete"></md-icon>
173           <md-tooltip
174             ><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip
175           >
176         </md-button>
177       </div>
178     </md-dialog-actions>
179   </form>
180 </md-dialog>