1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-12 14:56:58 +01:00
bitwarden-browser/apps/web/src/app/send/add-edit.component.html

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

309 lines
11 KiB
HTML
Raw Normal View History

<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="sendAddEditTitle">
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
<form
class="modal-content"
#form
(ngSubmit)="submit()"
[appApiAction]="formPromise"
ngNativeValidate
autocomplete="off"
>
<div class="modal-header">
<h2 class="modal-title" id="sendAddEditTitle">{{ title }}</h2>
<button
type="button"
class="close"
data-dismiss="modal"
appA11yTitle="{{ 'close' | i18n }}"
>
<span aria-hidden="true">&times;</span>
</button>
2021-12-17 15:57:11 +01:00
</div>
<div class="modal-body" *ngIf="send">
<app-callout *ngIf="disableSend">
<span>{{ "sendDisabledWarning" | i18n }}</span>
</app-callout>
<app-callout *ngIf="!disableSend && disableHideEmail">
<span>{{ "sendOptionsPolicyInEffect" | i18n }}</span>
<ul class="mb-0">
<li>{{ "sendDisableHideEmailInEffect" | i18n }}</li>
2021-12-17 15:57:11 +01:00
</ul>
</app-callout>
<div class="row">
<div class="col-6 form-group">
2021-02-25 18:23:52 +01:00
<label for="name">{{ "name" | i18n }}</label>
2021-12-17 15:57:11 +01:00
<input
2021-02-25 18:23:52 +01:00
id="name"
class="form-control"
2021-02-25 18:23:52 +01:00
type="text"
name="Name"
[(ngModel)]="send.name"
2021-12-17 15:57:11 +01:00
required
[readOnly]="disableSend"
2021-12-17 15:57:11 +01:00
/>
2021-02-25 18:23:52 +01:00
<small class="form-text text-muted">{{ "sendNameDesc" | i18n }}</small>
2021-12-17 15:57:11 +01:00
</div>
</div>
<div class="row" *ngIf="!editMode">
<div class="col-6 form-group">
<label>{{ "whatTypeOfSend" | i18n }}</label>
<div class="form-check" *ngFor="let o of typeOptions">
2021-12-17 15:57:11 +01:00
<input
class="form-check-input"
type="radio"
[(ngModel)]="send.type"
name="Type_{{ o.value }}"
id="type_{{ o.value }}"
[value]="o.value"
(change)="typeChanged(o)"
[checked]="send.type === o.value"
2021-12-17 15:57:11 +01:00
/>
<label class="form-check-label" for="type_{{ o.value }}">
2021-12-17 15:57:11 +01:00
{{ o.name }}
</label>
</div>
</div>
</div>
2021-02-25 18:23:52 +01:00
<!-- Text -->
<ng-container *ngIf="send.type === sendType.Text">
<div class="form-group">
<label for="text">{{ "sendTypeText" | i18n }}</label>
<textarea
id="text"
name="Text.Text"
rows="6"
[(ngModel)]="send.text.text"
2021-02-25 18:23:52 +01:00
class="form-control"
[readOnly]="disableSend"
></textarea>
<small class="form-text text-muted">{{ "sendTextDesc" | i18n }}</small>
</div>
<div class="form-group">
<div class="form-check">
<input
class="form-check-input"
type="checkbox"
[(ngModel)]="send.text.hidden"
id="text-hidden"
name="Text.Hidden"
[disabled]="disableSend"
/>
<label class="form-check-label" for="text-hidden">{{
"textHiddenByDefault" | i18n
}}</label>
</div>
2021-12-17 15:57:11 +01:00
</div>
</ng-container>
<!-- File -->
<ng-container *ngIf="send.type === sendType.File">
<div class="form-group">
<div *ngIf="editMode">
<strong class="d-block">{{ "file" | i18n }}</strong>
{{ send.file.fileName }} ({{ send.file.sizeName }})
2021-12-17 15:57:11 +01:00
</div>
<div *ngIf="!editMode">
<label for="file">{{ "file" | i18n }}</label>
<input
type="file"
id="file"
class="form-control-file"
name="file"
2021-12-17 15:57:11 +01:00
required
[disabled]="disableSend"
2021-12-17 15:57:11 +01:00
/>
<small class="form-text text-muted"
>{{ "sendFileDesc" | i18n }} {{ "maxFileSize" | i18n }}</small
2021-12-17 15:57:11 +01:00
>
</div>
</div>
</ng-container>
2021-02-25 18:23:52 +01:00
<h3 class="mt-5">{{ "share" | i18n }}</h3>
<div class="form-group" *ngIf="link">
<label for="link">{{ "sendLinkLabel" | i18n }}</label>
<input
type="text"
2021-12-17 15:57:11 +01:00
readonly
2021-02-25 18:23:52 +01:00
id="link"
name="Link"
[(ngModel)]="link"
class="form-control"
2021-12-17 15:57:11 +01:00
/>
</div>
<div class="form-group">
<div class="form-check">
2021-12-17 15:57:11 +01:00
<input
class="form-check-input"
type="checkbox"
2021-02-25 18:23:52 +01:00
[(ngModel)]="copyLink"
id="copy-link"
name="CopyLink"
2021-12-17 15:57:11 +01:00
/>
<label class="form-check-label" for="copy-link">{{
2021-02-25 18:23:52 +01:00
"copySendLinkOnSave" | i18n
}}</label>
2021-12-17 15:57:11 +01:00
</div>
</div>
<div
2021-02-25 18:23:52 +01:00
id="options-header"
class="section-header d-flex flex-row align-items-center mt-5"
2021-02-25 18:23:52 +01:00
(click)="toggleOptions()"
2021-12-17 15:57:11 +01:00
>
<h3 class="mb-0 mr-2">{{ "options" | i18n }}</h3>
<a class="mb-1" href="#" appStopClick role="button">
<i
class="bwi"
aria-hidden="true"
[ngClass]="{ 'bwi-angle-down': !showOptions, 'bwi-chevron-up': showOptions }"
></i>
2021-12-17 15:57:11 +01:00
</a>
</div>
<div id="options" [hidden]="!showOptions">
<app-send-efflux-dates
[initialDeletionDate]="send.deletionDate"
[initialExpirationDate]="send.expirationDate"
[editMode]="editMode"
[disabled]="disableSend"
(datesChanged)="setDates($event)"
2021-12-17 15:57:11 +01:00
>
</app-send-efflux-dates>
<div class="row">
<div class="col-6 form-group">
<label for="maxAccessCount">{{ "maxAccessCount" | i18n }}</label>
2021-12-17 15:57:11 +01:00
<input
id="maxAccessCount"
class="form-control"
type="number"
name="MaxAccessCount"
[(ngModel)]="send.maxAccessCount"
2021-12-17 15:57:11 +01:00
min="1"
[readOnly]="disableSend"
2021-12-17 15:57:11 +01:00
/>
<div class="form-text text-muted small">{{ "maxAccessCountDesc" | i18n }}</div>
2021-12-17 15:57:11 +01:00
</div>
<div class="col-6 form-group" *ngIf="editMode">
<label for="accessCount">{{ "currentAccessCount" | i18n }}</label>
2021-12-17 15:57:11 +01:00
<input
id="accessCount"
class="form-control"
type="text"
name="AccessCount"
2021-12-17 15:57:11 +01:00
readonly
[(ngModel)]="send.accessCount"
2021-12-17 15:57:11 +01:00
/>
</div>
</div>
<div class="row">
<div class="col-6 form-group">
<label for="password" *ngIf="!hasPassword">{{ "password" | i18n }}</label>
<label for="password" *ngIf="hasPassword">{{ "newPassword" | i18n }}</label>
<div class="input-group">
2021-12-17 15:57:11 +01:00
<input
id="password"
class="form-control text-monospace"
type="{{ showPassword ? 'text' : 'password' }}"
name="Password"
[(ngModel)]="password"
[readOnly]="disableSend"
2021-12-17 15:57:11 +01:00
/>
<div class="input-group-append">
<button
type="button"
class="btn btn-outline-secondary"
appA11yTitle="{{ 'toggleVisibility' | i18n }}"
(click)="togglePasswordVisible()"
>
<i
class="bwi bwi-lg"
aria-hidden="true"
[ngClass]="{ 'bwi-eye': !showPassword, 'bwi-eye-slash': showPassword }"
></i>
</button>
</div>
2021-12-17 15:57:11 +01:00
</div>
<div class="form-text text-muted small">{{ "sendPasswordDesc" | i18n }}</div>
2021-12-17 15:57:11 +01:00
</div>
</div>
<div class="form-group">
<label for="notes">{{ "notes" | i18n }}</label>
2021-12-17 15:57:11 +01:00
<textarea
id="notes"
2021-12-17 15:57:11 +01:00
name="Notes"
rows="6"
[(ngModel)]="send.notes"
class="form-control"
[readOnly]="disableSend"
></textarea>
<div class="form-text text-muted small">{{ "sendNotesDesc" | i18n }}</div>
2021-12-17 15:57:11 +01:00
</div>
<div class="form-group">
<div class="form-check">
2021-12-17 15:57:11 +01:00
<input
class="form-check-input"
type="checkbox"
[(ngModel)]="send.hideEmail"
id="hideEmail"
name="HideEmail"
[disabled]="(disableHideEmail && !send.hideEmail) || disableSend"
2021-12-17 15:57:11 +01:00
/>
<label class="form-check-label" for="hideEmail">
{{ "hideEmail" | i18n }}
2021-12-17 15:57:11 +01:00
</label>
</div>
</div>
<div class="form-group">
<div class="form-check">
2021-12-17 15:57:11 +01:00
<input
class="form-check-input"
type="checkbox"
[(ngModel)]="send.disabled"
id="disabled"
name="Disabled"
[disabled]="disableSend"
2021-12-17 15:57:11 +01:00
/>
<label class="form-check-label" for="disabled">{{ "disableThisSend" | i18n }}</label>
</div>
2021-12-17 15:57:11 +01:00
</div>
</div>
</div>
<div class="modal-footer">
2021-12-17 15:57:11 +01:00
<button
type="submit"
class="btn btn-primary btn-submit manual"
[ngClass]="{ loading: form.loading }"
[disabled]="form.loading || disableSend"
2021-12-17 15:57:11 +01:00
>
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span>{{ "save" | i18n }}</span>
</button>
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">
{{ "cancel" | i18n }}
</button>
<div class="ml-auto" *ngIf="send">
2021-12-17 15:57:11 +01:00
<button
#deleteBtn
type="button"
(click)="delete()"
class="btn btn-outline-danger"
appA11yTitle="{{ 'delete' | i18n }}"
*ngIf="editMode"
[disabled]="deleteBtn.loading"
[appApiAction]="deletePromise"
2021-12-17 15:57:11 +01:00
>
<i
class="bwi bwi-trash bwi-lg bwi-fw"
[hidden]="deleteBtn.loading"
2021-02-25 18:23:52 +01:00
aria-hidden="true"
2021-12-17 15:57:11 +01:00
></i>
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
[hidden]="!deleteBtn.loading"
title="{{ 'loading' | i18n }}"
2021-02-25 18:23:52 +01:00
aria-hidden="true"
2021-12-17 15:57:11 +01:00
></i>
</button>
2021-12-17 15:57:11 +01:00
</div>
</div>
</form>
</div>
</div>