1 <md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">
2 <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>
3 <md-toolbar class="md-accent md-hue-2">
5 class="md-toolbar-tools"
7 layout-align="space-between center"
9 <span class="title">{{ vm.title | translate }}</span>
10 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
12 md-font-icon="icon-close"
13 aria-label="Close dialog"
19 <md-dialog-content ms-scroll>
20 <div class="error-list">
22 ng-repeat="error in vm.errors"
25 layout-align="space-between center"
28 <span class="message">{{error.message}}</span>
29 <span class="type">({{error.type}})</span>
31 <md-button class="md-icon-button">
33 md-font-icon="icon-alert-box"
34 aria-label="alert error"
40 <md-input-container class="md-block">
41 <label translate="CHAT.KEY">Key</label>
45 ng-model="vm.chatCannedAnswer.key"
52 ng-messages="chatCannedAnswerForm['key'].$error"
53 ng-show="chatCannedAnswerForm['key'].$touched"
56 <div ng-message="required">
57 <span translate="CHAT.ERRORS.KEY_REQUIRED"
58 >Key field is required</span
63 <md-input-container class="md-block">
64 <label translate="CHAT.VALUE">Value</label>
67 ng-model="vm.chatCannedAnswer.value"
72 ng-messages="chatCannedAnswerForm['value'].$error"
73 ng-show="chatCannedAnswerForm['value'].$touched"
76 <div ng-message="required">
77 <span translate="CHAT.ERRORS.VALUE_REQUIRED"
78 >Value field is required</span
83 <md-input-container class="md-block">
84 <label translate="CHAT.DESCRIPTION">Description</label>
88 ng-model="vm.chatCannedAnswer.description"
92 ng-messages="chatCannedAnswerForm['description'].$error"
93 ng-show="chatCannedAnswerForm['description'].$touched"
96 <div ng-message="required">
97 <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED"
98 >Description field is required</span
102 </md-input-container>
104 <div class="error-list">
106 ng-repeat="error in vm.errors"
109 layout-align="space-between center"
112 <span class="message">{{error.message}}</span>
113 <span class="type">({{error.type}})</span>
115 <md-button class="md-icon-button">
117 md-font-icon="icon-alert-box"
118 aria-label="alert error"
128 layout-align="space-between center"
129 ng-if="!vm.crudPermissions.readOnly"
131 <div layout="row" layout-align="start center">
134 ng-if="vm.crudPermissions.canEdit && !vm.newChatCannedAnswer"
135 ng-click="vm.saveChatCannedAnswer()"
136 class="send-button md-accent md-raised"
137 ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine"
139 translate="CHAT.SAVE"
140 translate-attr-aria-label="CHAT.SAVE"
147 ng-if="vm.crudPermissions.canEdit && vm.newChatCannedAnswer"
148 ng-click="vm.addNewChatCannedAnswer()"
149 class="send-button md-accent md-raised"
150 ng-disabled="chatCannedAnswerForm.$invalid"
152 translate="CHAT.ADD_CHATCANNEDANSWER"
153 translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER"
160 class="md-icon-button"
161 ng-if="vm.crudPermissions.canDelete && !vm.newChatCannedAnswer"
162 ng-click="vm.deleteChatCannedAnswer($event)"
165 translate-attr-aria-label="CHAT.DELETE"
167 <md-icon md-font-icon="icon-delete"></md-icon>
168 <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>