|
1 |
| -<form autocomplete="off" #createRoleForm="ngForm" (ngSubmit)="save()"> |
2 |
| - <h1 mat-dialog-title>{{ "CreateNewRole" | localize }}</h1> |
3 |
| - <mat-dialog-content style="width:600px;height:300px;"> |
4 |
| - <mat-tab-group> |
5 |
| - <mat-tab [label]="'Details' | localize"> |
6 |
| - <br /> |
7 |
| - <div class="row-fluid"> |
8 |
| - <div class="col-md-12"> |
9 |
| - <mat-form-field> |
10 |
| - <input |
11 |
| - matInput |
12 |
| - name="Name" |
13 |
| - [placeholder]="'Name' | localize" |
14 |
| - [(ngModel)]="role.name" |
15 |
| - required |
16 |
| - minlength="2" |
17 |
| - maxlength="32" |
18 |
| - /> |
19 |
| - </mat-form-field> |
20 |
| - <mat-form-field> |
21 |
| - <input |
22 |
| - matInput |
23 |
| - name="DisplayName" |
24 |
| - [placeholder]="'DisplayName' | localize" |
25 |
| - [(ngModel)]="role.displayName" |
26 |
| - required |
27 |
| - minlength="2" |
28 |
| - maxlength="32" |
29 |
| - /> |
30 |
| - </mat-form-field> |
31 |
| - <mat-form-field> |
32 |
| - <textarea |
33 |
| - matInput |
34 |
| - name="Description" |
35 |
| - [placeholder]="'RoleDescription' | localize" |
36 |
| - [(ngModel)]="role.description" |
37 |
| - ></textarea> |
38 |
| - </mat-form-field> |
| 1 | +<form |
| 2 | + class="form-horizontal" |
| 3 | + autocomplete="off" |
| 4 | + #createRoleForm="ngForm" |
| 5 | + (ngSubmit)="save()" |
| 6 | +> |
| 7 | + <abp-modal-header |
| 8 | + [title]="'CreateNewRole' | localize" |
| 9 | + (onCloseClick)="bsModalRef.hide()" |
| 10 | + ></abp-modal-header> |
| 11 | + <div class="modal-body"> |
| 12 | + <tabset> |
| 13 | + <tab [heading]="'Details' | localize" class="pt-3 px-2"> |
| 14 | + <div class="form-group row required"> |
| 15 | + <label class="col-md-3 col-form-label" for="name"> |
| 16 | + {{ "Name" | localize }} |
| 17 | + </label> |
| 18 | + <div class="col-md-9"> |
| 19 | + <input |
| 20 | + type="text" |
| 21 | + class="form-control" |
| 22 | + name="name" |
| 23 | + id="name" |
| 24 | + required |
| 25 | + minlength="2" |
| 26 | + maxlength="32" |
| 27 | + [(ngModel)]="role.name" |
| 28 | + #nameModel="ngModel" |
| 29 | + #nameEl |
| 30 | + /> |
| 31 | + <abp-validation-summary |
| 32 | + [control]="nameModel" |
| 33 | + [controlEl]="nameEl" |
| 34 | + ></abp-validation-summary> |
39 | 35 | </div>
|
40 | 36 | </div>
|
41 |
| - </mat-tab> |
42 |
| - <mat-tab [label]="'Permissions' | localize"> |
43 |
| - <br /> |
44 |
| - <div class="row-fluid"> |
45 |
| - <ng-template ngFor let-permission [ngForOf]="permissions"> |
| 37 | + <div class="form-group row required"> |
| 38 | + <label class="col-md-3 col-form-label" for="displayName"> |
| 39 | + {{ "DisplayName" | localize }} |
| 40 | + </label> |
| 41 | + <div class="col-md-9"> |
| 42 | + <input |
| 43 | + type="text" |
| 44 | + class="form-control" |
| 45 | + name="displayName" |
| 46 | + id="displayName" |
| 47 | + required |
| 48 | + minlength="2" |
| 49 | + maxlength="32" |
| 50 | + [(ngModel)]="role.displayName" |
| 51 | + #displayNameModel="ngModel" |
| 52 | + #displayNameEl |
| 53 | + /> |
| 54 | + <abp-validation-summary |
| 55 | + [control]="displayNameModel" |
| 56 | + [controlEl]="displayNameEl" |
| 57 | + ></abp-validation-summary> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + <div class="form-group row mb-0"> |
| 61 | + <label class="col-md-3 col-form-label" for="description"> |
| 62 | + {{ "RoleDescription" | localize }} |
| 63 | + </label> |
| 64 | + <div class="col-md-9"> |
| 65 | + <textarea |
| 66 | + type="text" |
| 67 | + class="form-control" |
| 68 | + name="description" |
| 69 | + id="description" |
| 70 | + [(ngModel)]="role.description" |
| 71 | + > |
| 72 | + </textarea> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + </tab> |
| 76 | + <tab [heading]="'Permissions' | localize" class="pt-3 px-2"> |
| 77 | + <div class="form-group row mb-0"> |
| 78 | + <ng-container *ngFor="let permission of permissions; let i = index"> |
46 | 79 | <div class="col-md-6">
|
47 |
| - <div class="checkbox-wrapper"> |
48 |
| - <mat-checkbox |
| 80 | + <div class="custom-control custom-checkbox"> |
| 81 | + <input |
| 82 | + type="checkbox" |
| 83 | + class="custom-control-input" |
| 84 | + [id]="'permission_' + i" |
49 | 85 | [checked]="isPermissionChecked(permission.name)"
|
50 |
| - [disabled]="role.isStatic" |
51 | 86 | (change)="onPermissionChange(permission, $event)"
|
52 |
| - > |
| 87 | + /> |
| 88 | + <label class="custom-control-label" [for]="'permission_' + i"> |
53 | 89 | {{ permission.displayName }}
|
54 |
| - </mat-checkbox> |
| 90 | + </label> |
55 | 91 | </div>
|
56 | 92 | </div>
|
57 |
| - </ng-template> |
| 93 | + </ng-container> |
58 | 94 | </div>
|
59 |
| - </mat-tab> |
60 |
| - </mat-tab-group> |
61 |
| - </mat-dialog-content> |
62 |
| - <div mat-dialog-actions align="end"> |
63 |
| - <button mat-button type="button" [disabled]="saving" (click)="close(false)"> |
64 |
| - {{ "Cancel" | localize }} |
65 |
| - </button> |
66 |
| - <button |
67 |
| - mat-flat-button |
68 |
| - type="submit" |
69 |
| - flex="15" |
70 |
| - color="primary" |
71 |
| - [disabled]="!createRoleForm.form.valid || saving" |
72 |
| - > |
73 |
| - {{ "Save" | localize }} |
74 |
| - </button> |
| 95 | + </tab> |
| 96 | + </tabset> |
75 | 97 | </div>
|
| 98 | + <abp-modal-footer |
| 99 | + [cancelDisabled]="saving" |
| 100 | + [saveDisabled]="!createRoleForm.form.valid || saving" |
| 101 | + (onCancelClick)="bsModalRef.hide()" |
| 102 | + ></abp-modal-footer> |
76 | 103 | </form>
|
0 commit comments