<ion-header>
    <ion-toolbar>
        <ion-buttons slot="start">
            <ion-back-button [attr.aria-label]="'core.back' | translate"></ion-back-button>
        </ion-buttons>
        <ion-title>{{ 'core.contentlinks.chooseaccount' | translate }}</ion-title>
    </ion-toolbar>
</ion-header>
<ion-content>
    <core-loading [hideUntil]="loaded">
        <ion-list>
            <ion-item class="ion-text-wrap">
                <p class="item-heading">{{ 'core.contentlinks.chooseaccounttoopenlink' | translate }}</p>
                <p>{{ url }}</p>
            </ion-item>
            <ion-item *ngFor="let site of sites" (click)="siteClicked(site.id)" detail="false">
                <ion-avatar slot="start">
                    <img [src]="site.avatar" core-external-content [siteId]="site.id"
                        alt="{{ 'core.pictureof' | translate:{$a: site.fullName} }}" role="presentation"
                        onError="this.src='assets/img/user-avatar.png'">
                </ion-avatar>
                <h2>{{site.fullName}}</h2>
                <p><core-format-text [text]="site.siteName" clean="true" [siteId]="site.id"></core-format-text></p>
                <p>{{site.siteUrl}}</p>
            </ion-item>
            <ion-item>
                <ion-button expand="block" (click)="cancel()">{{ 'core.login.cancel' | translate }}</ion-button>
            </ion-item>
        </ion-list>
    </core-loading>
</ion-content>
