2021-02-12 11:14:54 +01:00
|
|
|
<form (ngSubmit)="changeName(newFileName, $event)" #nameForm>
|
2021-04-29 13:52:38 +02:00
|
|
|
<ion-item class="ion-text-wrap item-file" (click)="fileClicked($event)" button> <!-- [class.item-input]="editMode" -->
|
2021-02-23 12:21:12 +01:00
|
|
|
<ion-thumbnail slot="start">
|
2021-04-29 13:52:38 +02:00
|
|
|
<img [src]="fileIcon" [alt]="fileExtension" role="presentation" />
|
2021-02-23 12:21:12 +01:00
|
|
|
</ion-thumbnail>
|
2021-02-12 11:14:54 +01:00
|
|
|
|
|
|
|
<ion-label>
|
|
|
|
<!-- File name and edit button (if editable). -->
|
|
|
|
<h3 *ngIf="!editMode">{{fileName}}</h3>
|
|
|
|
<!-- More data about the file. -->
|
|
|
|
<p *ngIf="size && !editMode">{{ size }}</p>
|
|
|
|
<p *ngIf="timemodified && !editMode">{{ timemodified }}</p>
|
|
|
|
</ion-label>
|
|
|
|
|
|
|
|
<!-- Form to edit the file's name. -->
|
|
|
|
<ion-input type="text" name="filename" [placeholder]="'core.filename' | translate" autocapitalize="none" autocorrect="off"
|
2021-05-10 14:25:19 +02:00
|
|
|
(click)="$event.stopPropagation()" core-auto-focus [(ngModel)]="newFileName" *ngIf="editMode">
|
2021-02-12 11:14:54 +01:00
|
|
|
</ion-input>
|
|
|
|
|
|
|
|
<div class="buttons" slot="end" *ngIf="manage">
|
|
|
|
<ion-button *ngIf="!editMode" fill="clear" [core-suppress-events] (onClick)="activateEdit($event)"
|
|
|
|
[attr.aria-label]="'core.edit' | translate" color="dark">
|
2021-04-27 13:14:31 +02:00
|
|
|
<ion-icon name="fas-pen" slot="icon-only" aria-hidden="true"></ion-icon>
|
2021-02-12 11:14:54 +01:00
|
|
|
</ion-button>
|
|
|
|
|
|
|
|
<ion-button *ngIf="editMode" fill="clear" [attr.aria-label]="'core.save' | translate" color="success" type="submit">
|
2021-04-27 13:14:31 +02:00
|
|
|
<ion-icon name="fas-check" slot="icon-only" aria-hidden="true"></ion-icon>
|
2021-02-12 11:14:54 +01:00
|
|
|
</ion-button>
|
|
|
|
|
|
|
|
<ion-button fill="clear" (click)="deleteFile($event)" [attr.aria-label]="'core.delete' | translate" color="danger">
|
2021-04-27 13:14:31 +02:00
|
|
|
<ion-icon name="fas-trash" slot="icon-only" aria-hidden="true"></ion-icon>
|
2021-02-12 11:14:54 +01:00
|
|
|
</ion-button>
|
|
|
|
</div>
|
|
|
|
</ion-item>
|
|
|
|
</form>
|