2020-11-04 20:49:08 +01:00
|
|
|
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="sendAddEditTitle">
|
|
|
|
<div class="modal-dialog 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">×</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body" *ngIf="send">
|
2021-02-04 20:08:16 +01:00
|
|
|
<app-callout *ngIf="disableSend">
|
|
|
|
<span>{{'sendDisabledWarning' | i18n}}</span>
|
|
|
|
</app-callout>
|
2020-11-04 20:49:08 +01:00
|
|
|
<div class="row" *ngIf="!editMode">
|
|
|
|
<div class="col-6 form-group">
|
|
|
|
<label for="type">{{'whatTypeOfSend' | i18n}}</label>
|
2021-01-07 23:13:25 +01:00
|
|
|
<select id="type" name="Type" [(ngModel)]="send.type" class="form-control" appAutofocus
|
|
|
|
(change)='typeChanged()'>
|
2020-11-04 20:49:08 +01:00
|
|
|
<option *ngFor="let o of typeOptions" [ngValue]="o.value">{{o.name}}</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6 form-group">
|
|
|
|
<label for="name">{{'name' | i18n}}</label>
|
2021-02-04 20:08:16 +01:00
|
|
|
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="send.name" required [readOnly]="disableSend">
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 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-04 20:08:16 +01:00
|
|
|
class="form-control" [readOnly]="disableSend"></textarea>
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-check">
|
|
|
|
<input class="form-check-input" type="checkbox" [(ngModel)]="send.text.hidden"
|
2021-02-04 20:08:16 +01:00
|
|
|
id="text-hidden" name="Text.Hidden" [disabled]="disableSend">
|
2021-01-07 23:13:25 +01:00
|
|
|
<label class="form-check-label" for="text-hidden">{{'textHiddenByDefault' | i18n}}</label>
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
</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}})
|
|
|
|
</div>
|
|
|
|
<div *ngIf="!editMode">
|
|
|
|
<label for="file">{{'file' | i18n}}</label>
|
2021-02-04 20:08:16 +01:00
|
|
|
<input type="file" id="file" class="form-control-file" name="file" required [disabled]="disableSend">
|
2020-11-04 20:49:08 +01:00
|
|
|
<small class="form-text text-muted">{{'maxFileSize' | i18n}}</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</ng-container>
|
2021-01-05 20:45:23 +01:00
|
|
|
<h3 class="mt-5">{{'options' | i18n}}</h3>
|
2020-11-04 20:49:08 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-6 form-group">
|
|
|
|
<label for="deletionDate">{{'deletionDate' | i18n}}</label>
|
2021-01-05 20:45:23 +01:00
|
|
|
<div *ngIf="!editMode">
|
|
|
|
<select id="deletionDate" name="DeletionDateSelect" [(ngModel)]="deletionDateSelect"
|
|
|
|
class="form-control" required>
|
|
|
|
<option *ngFor="let o of deletionDateOptions" [ngValue]="o.value">{{o.name}}</option>
|
|
|
|
</select>
|
|
|
|
<input id="deletionDateCustom" class="form-control mt-1" type="datetime-local"
|
2021-01-07 23:13:25 +01:00
|
|
|
name="DeletionDate" [(ngModel)]="deletionDate" required *ngIf="deletionDateSelect === 0"
|
2021-02-04 20:08:16 +01:00
|
|
|
placeholder="MM/DD/YYYY HH:MM AM/PM" [readOnly]="disableSend">
|
2021-01-05 20:45:23 +01:00
|
|
|
</div>
|
|
|
|
<div *ngIf="editMode">
|
|
|
|
<input id="deletionDate" class="form-control" type="datetime-local" name="DeletionDate"
|
2021-02-04 20:08:16 +01:00
|
|
|
[(ngModel)]="deletionDate" required placeholder="MM/DD/YYYY HH:MM AM/PM" [readOnly]="disableSend">
|
2021-01-05 20:45:23 +01:00
|
|
|
</div>
|
2021-01-07 23:13:25 +01:00
|
|
|
<div class="form-text text-muted small">{{'deletionDateDesc' | i18n}}</div>
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
<div class="col-6 form-group">
|
|
|
|
<div class="d-flex">
|
|
|
|
<label for="expirationDate">{{'expirationDate' | i18n}}</label>
|
2021-01-05 20:45:23 +01:00
|
|
|
<a href="#" appStopClick (click)="clearExpiration()" class="ml-auto" *ngIf="editMode">
|
2020-11-04 20:49:08 +01:00
|
|
|
{{'clear' | i18n}}
|
|
|
|
</a>
|
|
|
|
</div>
|
2021-01-05 20:45:23 +01:00
|
|
|
<div *ngIf="!editMode">
|
|
|
|
<select id="expirationDate" name="ExpirationDateSelect" [(ngModel)]="expirationDateSelect"
|
|
|
|
class="form-control" required>
|
|
|
|
<option *ngFor="let o of expirationDateOptions" [ngValue]="o.value">{{o.name}}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
<input id="expirationDateCustom" class="form-control mt-1" type="datetime-local"
|
|
|
|
name="ExpirationDate" [(ngModel)]="expirationDate" required
|
2021-02-04 20:08:16 +01:00
|
|
|
*ngIf="expirationDateSelect === 0" placeholder="MM/DD/YYYY HH:MM AM/PM" [readOnly]="disableSend">
|
2021-01-05 20:45:23 +01:00
|
|
|
</div>
|
|
|
|
<div *ngIf="editMode">
|
|
|
|
<input id="expirationDate" class="form-control" type="datetime-local" name="ExpirationDate"
|
2021-02-04 20:08:16 +01:00
|
|
|
[(ngModel)]="expirationDate" placeholder="MM/DD/YYYY HH:MM AM/PM" [readOnly]="disableSend">
|
2021-01-05 20:45:23 +01:00
|
|
|
</div>
|
2021-01-07 23:13:25 +01:00
|
|
|
<div class="form-text text-muted small">{{'expirationDateDesc' | i18n}}</div>
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6 form-group">
|
|
|
|
<label for="maxAccessCount">{{'maxAccessCount' | i18n}}</label>
|
|
|
|
<input id="maxAccessCount" class="form-control" type="number" name="MaxAccessCount"
|
2021-02-04 20:08:16 +01:00
|
|
|
[(ngModel)]="send.maxAccessCount" min="1" [readOnly]="disableSend">
|
2021-01-07 23:13:25 +01:00
|
|
|
<div class="form-text text-muted small">{{'maxAccessCountDesc' | i18n}}</div>
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
<div class="col-6 form-group" *ngIf="editMode">
|
|
|
|
<label for="accessCount">{{'currentAccessCount' | i18n}}</label>
|
|
|
|
<input id="accessCount" class="form-control" type="number" name="AccessCount" readonly
|
|
|
|
[(ngModel)]="send.accessCount">
|
|
|
|
</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>
|
2021-02-05 20:23:40 +01:00
|
|
|
<div class="input-group">
|
|
|
|
<input id="password" class="form-control text-monospace" type="{{showPassword ? 'text' : 'password'}}"
|
|
|
|
name="Password" [(ngModel)]="password" [readOnly]="disableSend">
|
|
|
|
<div class="input-group-append">
|
|
|
|
<button type="button" class="btn btn-outline-secondary" appA11yTitle="{{'toggleVisibility' | i18n}}"
|
|
|
|
(click)="togglePasswordVisible()">
|
|
|
|
<i class="fa fa-lg" aria-hidden="true"
|
|
|
|
[ngClass]="{'fa-eye': !showPassword, 'fa-eye-slash': showPassword}"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-07 23:13:25 +01:00
|
|
|
<div class="form-text text-muted small">{{'sendPasswordDesc' | i18n}}</div>
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="notes">{{'notes' | i18n}}</label>
|
2021-02-04 20:08:16 +01:00
|
|
|
<textarea id="notes" name="Notes" rows="6" [(ngModel)]="send.notes" class="form-control"
|
|
|
|
[readOnly]="disableSend"></textarea>
|
2021-01-07 23:13:25 +01:00
|
|
|
<div class="form-text text-muted small">{{'sendNotesDesc' | i18n}}</div>
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-check">
|
|
|
|
<input class="form-check-input" type="checkbox" [(ngModel)]="send.disabled" id="disabled"
|
2021-02-04 20:08:16 +01:00
|
|
|
name="Disabled" [disabled]="disableSend">
|
2021-01-04 16:57:53 +01:00
|
|
|
<label class="form-check-label" for="disabled">{{'disableThisSend' | i18n}}</label>
|
2020-11-04 20:49:08 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-07 23:13:25 +01:00
|
|
|
<h3 class="mt-5" *ngIf="link">{{'share' | i18n}}</h3>
|
2020-11-04 20:49:08 +01:00
|
|
|
<div class="form-group" *ngIf="link">
|
|
|
|
<label for="link">{{'sendLink' | i18n}}</label>
|
|
|
|
<input type="text" readonly id="link" name="Link" [(ngModel)]="link" class="form-control">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2021-02-04 20:08:16 +01:00
|
|
|
<button class="btn btn-primary disabled" disabled=true *ngIf="disableSend">
|
|
|
|
<span>{{'save' | i18n}}</span>
|
|
|
|
</button>
|
|
|
|
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading" *ngIf="!disableSend">
|
2020-11-04 20:49:08 +01:00
|
|
|
<i class="fa fa-spinner fa-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">
|
|
|
|
<button #deleteBtn type="button" (click)="delete()" class="btn btn-outline-danger"
|
|
|
|
appA11yTitle="{{'delete' | i18n}}" *ngIf="editMode" [disabled]="deleteBtn.loading"
|
|
|
|
[appApiAction]="deletePromise">
|
|
|
|
<i class="fa fa-trash-o fa-lg fa-fw" [hidden]="deleteBtn.loading" aria-hidden="true"></i>
|
|
|
|
<i class="fa fa-spinner fa-spin fa-lg fa-fw" [hidden]="!deleteBtn.loading"
|
|
|
|
title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|