<!-- 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]="displayDescription && description" [component]="component"
        [componentId]="componentId" [courseId]="courseId" (completionChanged)="onCompletionChange()">
    </core-course-module-info>

    <div *ngIf="shouldIframe || (shouldEmbed && isOther)" class="addon-mod_url-embedded-url">
        <core-iframe [src]="url"></core-iframe>
    </div>

    <ion-list *ngIf="url && !shouldIframe && (!shouldEmbed || !isOther)">
        <ion-item *ngIf="shouldEmbed">
            <ion-label>
                <img *ngIf="isImage" [alt]="name" [src]="url">
                <video *ngIf="isVideo" [title]="name" controls controlsList="nodownload">
                    <source [src]="url" [type]="mimetype">
                </video>
                <audio *ngIf="isAudio" [title]="name" controls>
                    <source [src]="url" [type]="mimetype">
                </audio>
            </ion-label>
        </ion-item>
        <ion-item class="ion-text-wrap">
            <ion-label>
                <p class="item-heading">{{ 'addon.mod_url.pointingtourl' | translate }}</p>
                <p>{{ url }}</p>
            </ion-label>
        </ion-item>
    </ion-list>

    <div collapsible-footer appearOnBottom *ngIf="!showLoading" slot="fixed">
        <div class="list-item-limited-width" *ngIf="url && !shouldIframe && (!shouldEmbed || !isOther)">
            <ion-button expand="block" (click)="go()" class="ion-margin ion-text-wrap">
                <ion-icon name="fas-link" slot="start" aria-hidden="true"></ion-icon>
                {{ 'addon.mod_url.accessurl' | translate }}
            </ion-button>
        </div>
        <core-course-module-navigation [courseId]="courseId" [currentModuleId]="module.id">
        </core-course-module-navigation>
    </div>
</core-loading>
