3c8229a1c56585cc4cdb177bcfebab7d5cf891ae
[motion-next.git] /
1 <md-dialog class="disposition-dialog" aria-label="disposition">
2   <form name="transferForm" class="md-inline-form" novalidate>
3     <md-toolbar class="md-background-bg">
4       <div
5         class="md-toolbar-tools"
6         layout="row"
7         layout-align="space-between center"
8       >
9         <span class="title" translate="DASHBOARDS.TRANSFER"></span>
10         <md-button class="md-icon-button" ng-click="vm.closeDialog(false)">
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
41       <md-input-container class="md-block">
42         <label translate="DASHBOARDS.TYPE">Type</label>
43         <md-select name="type" ng-model="vm.transfer.type" required>
44           <md-option ng-value="'queue'" ng-if="vm.account.queueTransfer"
45             >Queue</md-option
46           >
47           <md-option ng-value="'agent'" ng-if="vm.account.agentTransfer"
48             >Agent</md-option
49           >
50         </md-select>
51         <div
52           ng-messages="transferForm.type.$error"
53           ng-show="transferForm.type.$touched"
54           role="alert"
55         >
56           <div ng-message="required">
57             <span translate="DASHBOARDS.ERRORS.TYPE_REQUIRED"
58               >Type field is required</span
59             >
60           </div>
61         </div>
62       </md-input-container>
63
64       <md-input-container class="md-block" ng-if="vm.transfer.type === 'queue'">
65         <label translate="DASHBOARDS.QUEUES">Queues</label>
66         <md-select name="queue" ng-model="vm.transfer.id" required>
67           <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows"
68             >{{ queue.name }}</md-option
69           >
70         </md-select>
71         <div
72           ng-messages="transferForm.queue.$error"
73           ng-show="transferForm.queue.$touched"
74           role="alert"
75         >
76           <div ng-message="required">
77             <span translate="DASHBOARDS.ERRORS.QUEUE_REQUIRED"
78               >Queue field is required</span
79             >
80           </div>
81         </div>
82       </md-input-container>
83
84       <md-input-container class="md-block" ng-if="vm.transfer.type === 'agent'">
85         <label translate="DASHBOARDS.AGENTS">Agents</label>
86         <md-select name="agent" ng-model="vm.transfer.id" required>
87           <md-option
88             ng-value="agent.id"
89             ng-repeat="agent in vm.agents.rows"
90             ng-if="vm.currentUser.id != agent.id"
91             >{{ agent.name }}</md-option
92           >
93         </md-select>
94         <div
95           ng-messages="transferForm.agent.$error"
96           ng-show="transferForm.agent.$touched"
97           role="alert"
98         >
99           <div ng-message="required">
100             <span translate="DASHBOARDS.ERRORS.AGENT_REQUIRED"
101               >Agent 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 ng-if="!vm.interaction.closed || !vm.interaction.disposition" layout="row" layout-align="space-between center"> -->
130     <md-dialog-actions layout="row" layout-align="space-between center">
131       <div layout="row" layout-align="start center">
132         <md-button
133           type="submit"
134           ng-click="vm.onTransfer(true)"
135           ng-disabled="transferForm.$pristine"
136           class="send-button md-accent md-raised"
137           aria-label="DASHBOARDS.TRANSFER"
138           translate="DASHBOARDS.TRANSFER"
139           translate-attr-aria-label="DASHBOARDS.TRANSFER"
140         >
141           TRANSFER
142         </md-button>
143       </div>
144     </md-dialog-actions>
145   </form>
146 </md-dialog>