3592731ff379a371b93e67717c296b74ac229113
[motion-next.git] /
1 <md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">
2   <form name="whatsappAccountFormApp" 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="WHATSAPP.AGENT">Agent</label>
42         <md-select
43           name="agent"
44           ng-model="vm.agent.agent"
45           autofocus
46           required
47           ng-disabled="!vm.crudPermissions.canEdit"
48         >
49           <md-option
50             ng-value="agent.name"
51             ng-repeat="agent in vm.agents"
52             ng-disabled="agent.canSelect === false"
53             >{{ agent.name }}</md-option
54           >
55         </md-select>
56         <div
57           ng-messages="whatsappAccountFormApp['agent'].$error"
58           ng-show="whatsappAccountFormApp['agent'].$touched"
59           role="alert"
60         >
61           <div ng-message="required">
62             <span translate="WHATSAPP.ERRORS.AGENT_REQUIRED"
63               >Agent field is required</span
64             >
65           </div>
66         </div>
67       </md-input-container>
68       <md-input-container class="md-block">
69         <label translate="WHATSAPP.TIMEOUT">Timeout</label>
70         <input
71           type="number"
72           name="timeout"
73           ng-model="vm.agent.timeout"
74           min="0"
75           max="2147483"
76           ng-required="true"
77           ng-disabled="!vm.crudPermissions.canEdit"
78         />
79
80         <div
81           ng-messages="whatsappAccountFormApp['timeout'].$error"
82           ng-show="whatsappAccountFormApp['timeout'].$touched"
83           role="alert"
84         >
85           <div ng-message="required">
86             <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED"
87               >Timeout field is required</span
88             >
89           </div>
90           <div ng-message="min">
91             <span
92               translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
93               >Timeout must be a valid greater or equal than</span
94             >
95             <span>0</span>
96           </div>
97           <div ng-message="max">
98             <span
99               translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO"
100               >Timeout must be a valid greater or equal than</span
101             >
102             <span>2147483</span>
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 layout="row" layout-align="space-between center">
130       <div
131         layout="row"
132         layout-align="start center"
133         ng-if="vm.crudPermissions.canEdit"
134       >
135         <md-button
136           type="submit"
137           ng-click="vm.saveWhatsappAccountApp()"
138           class="send-button md-accent md-raised"
139           ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine"
140           aria-label="SAVE"
141           translate="WHATSAPP.SAVE"
142           translate-attr-aria-label="WHATSAPP.SAVE"
143         >
144           SAVE
145         </md-button>
146       </div>
147     </md-dialog-actions>
148   </form>
149 </md-dialog>