1 <md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">
2 <form name="cannedAnswerForm" 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="TOOLS.KEY">Key</label>
45 ng-model="vm.cannedAnswer.key"
52 ng-messages="cannedAnswerForm['key'].$error"
53 ng-show="cannedAnswerForm['key'].$touched"
56 <div ng-message="required">
57 <span translate="TOOLS.ERRORS.KEY_REQUIRED"
58 >Key field is required</span
61 <div ng-message="md-maxlength">
63 translate="TOOLS.ERRORS.KEY_MAX_LENGTH"
64 translate-values="{max: 255}"
65 >Key must have a maximum length equal to 255</span
70 <md-input-container class="md-block">
71 <label translate="TOOLS.VALUE">Value</label>
74 ng-model="vm.cannedAnswer.value"
79 ng-messages="cannedAnswerForm['value'].$error"
80 ng-show="cannedAnswerForm['value'].$touched"
83 <div ng-message="required">
84 <span translate="TOOLS.ERRORS.VALUE_REQUIRED"
85 >Value field is required</span
90 <md-input-container class="md-block">
91 <label translate="TOOLS.DESCRIPTION">Description</label>
95 ng-model="vm.cannedAnswer.description"
99 ng-messages="cannedAnswerForm['description'].$error"
100 ng-show="cannedAnswerForm['description'].$touched"
103 <div ng-message="required">
104 <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED"
105 >Description field is required</span
109 </md-input-container>
111 <div class="error-list">
113 ng-repeat="error in vm.errors"
116 layout-align="space-between center"
119 <span class="message">{{error.message}}</span>
120 <span class="type">({{error.type}})</span>
122 <md-button class="md-icon-button">
124 md-font-icon="icon-alert-box"
125 aria-label="alert error"
135 layout-align="space-between center"
136 ng-if="!vm.crudPermissions.readOnly"
138 <div layout="row" layout-align="start center">
141 ng-if="vm.crudPermissions.canEdit && !vm.newCannedAnswer"
142 ng-click="vm.saveCannedAnswer()"
143 class="send-button md-accent md-raised"
144 ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine"
146 translate="TOOLS.SAVE"
147 translate-attr-aria-label="TOOLS.SAVE"
154 ng-if="vm.crudPermissions.canEdit && vm.newCannedAnswer"
155 ng-click="vm.addNewCannedAnswer()"
156 class="send-button md-accent md-raised"
157 ng-disabled="cannedAnswerForm.$invalid"
159 translate="TOOLS.ADD_CANNEDANSWER"
160 translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER"
167 class="md-icon-button"
168 ng-if="vm.crudPermissions.canDelete && !vm.newCannedAnswer"
169 ng-click="vm.deleteCannedAnswer($event)"
172 translate-attr-aria-label="TOOLS.DELETE"
174 <md-icon md-font-icon="icon-delete"></md-icon>
175 <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>