bitwarden-estensione-browser/apps/web/src/app/organizations/manage/collection-add-edit.compone...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

163 lines
5.7 KiB
HTML
Raw Normal View History

<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="collectionAddEditTitle">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<form
class="modal-content"
#form
(ngSubmit)="submit()"
[appApiAction]="formPromise"
ngNativeValidate
>
2018-07-10 16:06:57 +02:00
<div class="modal-header">
2019-10-11 17:47:41 +02:00
<h2 class="modal-title" id="collectionAddEditTitle">{{ title }}</h2>
2021-12-17 15:57:11 +01:00
<button
type="button"
2019-10-11 17:22:21 +02:00
class="close"
data-dismiss="modal"
appA11yTitle="{{ 'close' | i18n }}"
2021-12-17 15:57:11 +01:00
>
2018-07-10 16:06:57 +02:00
<span aria-hidden="true">&times;</span>
</button>
2021-12-17 15:57:11 +01:00
</div>
2018-07-10 16:06:57 +02:00
<div class="modal-body" *ngIf="loading">
2021-12-17 15:57:11 +01:00
<i
class="bwi bwi-spinner bwi-spin text-muted"
2019-10-11 16:35:24 +02:00
title="{{ 'loading' | i18n }}"
aria-hidden="true"
2021-12-17 15:57:11 +01:00
></i>
2019-10-11 16:35:24 +02:00
<span class="sr-only">{{ "loading" | i18n }}</span>
2021-12-17 15:57:11 +01:00
</div>
2018-07-10 16:06:57 +02:00
<div class="modal-body" *ngIf="!loading">
2019-03-07 21:18:05 +01:00
<div class="form-group">
2018-07-10 16:06:57 +02:00
<label for="name">{{ "name" | i18n }}</label>
2021-12-17 15:57:11 +01:00
<input
id="name"
class="form-control"
type="text"
name="Name"
[(ngModel)]="name"
2021-12-17 15:57:11 +01:00
required
appAutofocus
[disabled]="!this.canSave"
2021-12-17 15:57:11 +01:00
/>
</div>
2019-03-07 21:18:05 +01:00
<div class="form-group">
<label for="externalId">{{ "externalId" | i18n }}</label>
2021-12-17 15:57:11 +01:00
<input
id="externalId"
class="form-control"
type="text"
name="ExternalId"
[(ngModel)]="externalId"
[disabled]="!this.canSave"
2021-12-17 15:57:11 +01:00
/>
2019-03-07 21:18:05 +01:00
<small class="form-text text-muted">{{ "externalIdDesc" | i18n }}</small>
2021-12-17 15:57:11 +01:00
</div>
<ng-container *ngIf="accessGroups">
<h3 class="mt-4 d-flex mb-0">
{{ "groupAccess" | i18n }}
<div class="ml-auto" *ngIf="groups && groups.length && this.canSave">
<button type="button" (click)="selectAll(true)" class="btn btn-link btn-sm py-0">
{{ "selectAll" | i18n }}
2018-07-10 16:06:57 +02:00
</button>
2019-10-11 17:22:21 +02:00
<button type="button" (click)="selectAll(false)" class="btn btn-link btn-sm py-0">
2018-07-10 16:06:57 +02:00
{{ "unselectAll" | i18n }}
</button>
</div>
2021-12-17 15:57:11 +01:00
</h3>
2018-07-10 16:06:57 +02:00
<div *ngIf="!groups || !groups.length">
{{ "noGroupsInList" | i18n }}
</div>
<table class="table table-hover table-list mb-0" *ngIf="groups && groups.length">
2019-10-11 16:35:24 +02:00
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ "name" | i18n }}</th>
<th width="100" class="text-center">{{ "hidePasswords" | i18n }}</th>
2019-03-07 21:18:05 +01:00
<th width="100" class="text-center">{{ "readOnly" | i18n }}</th>
2021-12-17 15:57:11 +01:00
</tr>
</thead>
<tbody>
2019-03-07 21:18:05 +01:00
<tr *ngFor="let g of groups; let i = index">
<td class="table-list-checkbox" (click)="check(g)">
<input
type="checkbox"
2019-02-21 22:50:37 +01:00
[(ngModel)]="g.checked"
2019-03-07 21:18:05 +01:00
name="Groups[{{ i }}].Checked"
[disabled]="g.accessAll || !this.canSave"
appStopProp
2021-12-17 15:57:11 +01:00
/>
2019-03-07 21:18:05 +01:00
</td>
<td (click)="check(g)">
2021-12-17 15:57:11 +01:00
{{ g.name }}
<ng-container *ngIf="g.accessAll">
<i
class="bwi bwi-filter text-muted bwi-fw"
title="{{ 'groupAccessAllItems' | i18n }}"
aria-hidden="true"
></i>
<span class="sr-only">{{ "groupAccessAllItems" | i18n }}</span>
</ng-container>
</td>
<td class="text-center">
2019-02-21 22:50:37 +01:00
<input
type="checkbox"
[(ngModel)]="g.hidePasswords"
name="Groups[{{ i }}].HidePasswords"
[disabled]="!g.checked || g.accessAll || !this.canSave"
/>
</td>
<td class="text-center">
2021-12-17 15:57:11 +01:00
<input
type="checkbox"
[(ngModel)]="g.readOnly"
name="Groups[{{ i }}].ReadOnly"
2019-10-11 16:35:24 +02:00
[disabled]="!g.checked || g.accessAll || !this.canSave"
2021-12-17 15:57:11 +01:00
/>
</td>
</tr>
</tbody>
</table>
2019-10-11 16:35:24 +02:00
</ng-container>
2021-12-17 15:57:11 +01:00
</div>
2019-10-11 16:35:24 +02:00
<div class="modal-footer">
2021-12-17 15:57:11 +01:00
<button
type="submit"
class="btn btn-primary btn-submit"
[disabled]="form.loading"
2019-10-11 16:35:24 +02:00
*ngIf="this.canSave"
2021-12-17 15:57:11 +01:00
>
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
2019-10-11 16:35:24 +02:00
<span>{{ "save" | i18n }}</span>
</button>
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">
2019-10-11 16:35:24 +02:00
{{ "cancel" | i18n }}
</button>
<div class="ml-auto" *ngIf="this.canDelete">
2019-02-21 22:50:37 +01:00
<button
#deleteBtn
type="button"
(click)="delete()"
class="btn btn-outline-danger"
appA11yTitle="{{ 'delete' | i18n }}"
*ngIf="editMode"
[disabled]="deleteBtn.loading"
[appApiAction]="deletePromise"
>
2019-10-11 16:35:24 +02:00
<i
class="bwi bwi-trash bwi-lg bwi-fw"
2019-10-11 16:35:24 +02:00
[hidden]="deleteBtn.loading"
aria-hidden="true"
></i>
2019-02-21 22:50:37 +01:00
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
2019-02-21 22:50:37 +01:00
[hidden]="!deleteBtn.loading"
2019-10-11 16:35:24 +02:00
title="{{ 'loading' | i18n }}"
aria-hidden="true"
></i>
2018-07-10 16:06:57 +02:00
</button>
</div>
2021-12-17 15:57:11 +01:00
</div>
2018-07-10 16:06:57 +02:00
</form>
</div>
</div>