<!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end">
    @if (!courseContentsPage) {
    <ion-button fill="clear" (click)="openModuleSummary()" aria-haspopup="true" [ariaLabel]="'core.info' | translate">
        <ion-icon name="fas-circle-info" slot="icon-only" aria-hidden="true" />
    </ion-button>
    } @else {
    <core-context-menu>
        <core-context-menu-item [priority]="5000" [content]="'core.info' | translate" (action)="openModuleSummary()"
            iconAction="fas-circle-info" />
    </core-context-menu>
    }
</core-navbar-buttons>

<!-- Content. -->
<core-loading [hideUntil]="!showLoading">

    <!-- Activity info. -->
    <core-course-module-info *ngIf="!subfolder" [module]="module" [description]="description" [component]="component"
        [componentId]="componentId" [courseId]="courseId" />

    <ion-list *ngIf="contents && (contents.files.length + contents.folders.length > 0)">
        <ng-container *ngFor="let folder of contents.folders">
            <ion-item class="ion-text-wrap item-file item-directory" (click)="openFolder(folder)" [detail]="true" button>
                <ion-icon name="fas-folder" slot="start" [attr.aria-label]="'core.folder' | translate" />
                <ion-label>
                    <p class="item-heading">{{folder.filename}}</p>
                </ion-label>
            </ion-item>
        </ng-container>
        <ng-container *ngFor="let file of contents.files">
            <core-file [file]="file" [component]="component" [componentId]="componentId" />
        </ng-container>
    </ion-list>

    <core-empty-box *ngIf="!contents || (contents.files.length + contents.folders.length === 0)" icon="far-folder-open"
        [message]=" 'addon.mod_folder.emptyfilelist' | translate" />

</core-loading>

<core-course-module-navigation collapsible-footer appearOnBottom *ngIf="!subfolder" [hidden]="showLoading" [courseId]="courseId"
    [currentModuleId]="module.id" (completionChanged)="onCompletionChange()" />