<!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end">
    <ion-button fill="clear" (click)="openModuleSummary()" aria-haspopup="true" [attr.aria-label]="'core.info' | translate">
        <ion-icon name="fas-circle-info" slot="icon-only" aria-hidden="true"></ion-icon>
    </ion-button>
</core-navbar-buttons>

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

    <!-- Activity info. -->
    <core-course-module-info [module]="module" [description]="description" [component]="component" [componentId]="componentId"
        [courseId]="courseId" (completionChanged)="onCompletionChange()">
    </core-course-module-info>

    <ion-list>
        <ion-item>
            <ion-label>
                <h2>{{ 'addon.mod_imscp.toc' | translate }}</h2>
            </ion-label>
        </ion-item>

        <ion-item class="ion-text-wrap" *ngFor="let item of items" (click)="openImscp(item.href)" button detail="true">
            <ion-label [class.core-bold]="!item.href">
                <p>
                    <span class="ion-padding-start" *ngFor="let i of getNumberForPadding(item.level)"></span>
                    {{item.title}}
                </p>
            </ion-label>
        </ion-item>
    </ion-list>

    <div collapsible-footer appearOnBottom *ngIf="!showLoading" slot="fixed">
        <div class="list-item-limited-width">
            <ion-button class="ion-margin ion-text-wrap" expand="block" (click)="openImscp()">
                <span *ngIf="!hasStarted">{{ 'core.start' | translate }}</span>
                <span *ngIf="hasStarted">{{ 'core.resume' | translate }}</span>
            </ion-button>
        </div>

        <core-course-module-navigation [courseId]="courseId" [currentModuleId]="module.id">
        </core-course-module-navigation>
    </div>
</core-loading>
