84c96639ec9dd196d8ebc91cd2c81be641f9375f
[motion-next.git] /
1 <md-dialog class="userProfile-dialog" aria-label="Clone UserProfile">
2   <form name="userProfileForm" 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="STAFF.NAME">Name</label>
42         <input
43           type="text"
44           name="name"
45           ng-model="vm.userProfile.name"
46           ng-required="true"
47           autofocus
48           ng-disabled="!vm.newUserProfile"
49         />
50
51         <div
52           ng-messages="userProfileForm['name'].$error"
53           ng-show="userProfileForm['name'].$touched"
54           role="alert"
55         >
56           <div ng-message="required">
57             <span translate="STAFF.ERRORS.NAME_REQUIRED"
58               >Name field is required</span
59             >
60           </div>
61         </div>
62       </md-input-container>
63       <md-input-container class="md-block">
64         <label translate="STAFF.DESCRIPTION">Description</label>
65         <input
66           type="text"
67           name="description"
68           ng-model="vm.userProfile.description"
69         />
70
71         <div
72           ng-messages="userProfileForm['description'].$error"
73           ng-show="userProfileForm['description'].$touched"
74           role="alert"
75         >
76           <div ng-message="required">
77             <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED"
78               >Description field is required</span
79             >
80           </div>
81         </div>
82       </md-input-container>
83       <md-input-container class="md-block">
84         <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>
85         <md-select
86           name="crudPermissions"
87           ng-model="vm.userProfile.crudPermissions"
88           multiple
89           required
90         >
91           <md-option ng-value="'r'" disabled>
92             {{ 'STAFF.READ_PERMISSION' | translate }}
93           </md-option>
94
95           <md-option ng-value="'e'">
96             {{ 'STAFF.EDIT_PERMISSION' | translate }}
97           </md-option>
98
99           <md-option ng-value="'d'">
100             {{ 'STAFF.DELETE_PERMISSION' | translate }}
101           </md-option>
102         </md-select>
103         <div
104           ng-messages="userProfileForm['crudPermissions'].$error"
105           ng-show="userProfileForm['crudPermissions'].$touched"
106           role="alert"
107         >
108           <div ng-message="required">
109             <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED"
110               >CrudPermissions field is required</span
111             >
112           </div>
113         </div>
114       </md-input-container>
115
116       <div class="error-list">
117         <div
118           ng-repeat="error in vm.errors"
119           class="error"
120           layout="row"
121           layout-align="space-between center"
122         >
123           <div>
124             <span class="message">{{error.message}}</span>
125             <span class="type">({{error.type}})</span>
126           </div>
127           <md-button class="md-icon-button">
128             <md-icon
129               md-font-icon="icon-alert-box"
130               aria-label="alert error"
131               class="s16"
132             ></md-icon>
133           </md-button>
134         </div>
135       </div>
136     </md-dialog-content>
137
138     <md-dialog-actions layout="row" layout-align="space-between center">
139       <md-button
140         type="submit"
141         ng-click="vm.cloneUserProfile()"
142         class="send-button md-accent md-raised"
143         ng-disabled="userProfileForm.$invalid"
144         aria-label="CLONE"
145         translate="STAFF.CLONE_USERPROFILE"
146         translate-attr-aria-label="STAFF.CLONE_USERPROFILE"
147       >
148         CLONE USERPROFILE
149       </md-button>
150     </md-dialog-actions>
151   </form>
152 </md-dialog>