<ion-header> <ion-navbar> <ion-title><core-format-text [text]="title"></core-format-text></ion-title> </ion-navbar> </ion-header> <ion-content> <ion-refresher [enabled]="filesLoaded && (showPrivateFiles || showSiteFiles)" (ionRefresh)="refreshData($event)"> <ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content> </ion-refresher> <core-loading [hideUntil]="filesLoaded" *ngIf="showPrivateFiles || showSiteFiles"> <!-- Allow selecting the files to see: private or site. --> <div no-padding *ngIf="showPrivateFiles && showSiteFiles && !path"> <ion-select [(ngModel)]="root" (ngModelChange)="rootChanged()" interface="popover"> <ion-option value="my">{{ 'addon.files.privatefiles' | translate }}</ion-option> <ion-option value="site">{{ 'addon.files.sitefiles' | translate }}</ion-option> </ion-select> </div> <!-- Display info about space used and space left. --> <p class="core-info-card" *ngIf="userQuota && filesInfo && filesInfo.filecount > 0">{{ 'core.quotausage' | translate:{$a: {used: spaceUsed, total: userQuotaReadable} } }}</p> <!-- List of files. --> <ion-list *ngIf="files && files.length > 0"> <div *ngFor="let file of files"> <a *ngIf="file.isdir" ion-item class="item-media" [navPush]="'AddonFilesListPage'" [navParams]="{path: file.link, title: file.filename}"> <img [src]="file.imgPath" alt="" role="presentation" item-start> <p>{{file.filename}}</p> </a> <core-file *ngIf="!file.isdir" [file]="file" [component]="component" [componentId]="file.contextid"></core-file> </div> </ion-list> <!-- Message telling there are no files. --> <core-empty-box *ngIf="!files || !files.length" icon="folder" [message]="'addon.files.emptyfilelist' | translate"></core-empty-box> </core-loading> <!-- Upload a private file. --> <ion-fab bottom right *ngIf="showUpload && root != 'site' && !path"> <button ion-fab (click)="uploadFile()" [attr.aria-label]="'core.fileuploader.uploadafile' | translate"> <ion-icon name="add"></ion-icon> </button> </ion-fab> </ion-content>