<ion-header>
    <ion-toolbar>
        <ion-buttons slot="start">
            <ion-back-button [text]="'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">
                <ion-label>
                    <h3 class="item-heading">{{ 'core.contentlinks.chooseaccounttoopenlink' | translate }}</h3>
                    <p>{{ url }}</p>
                </ion-label>
            </ion-item>
            <ion-item *ngFor="let site of sites" (click)="siteClicked(site.id)" detail="false" button>
                <ion-avatar slot="start">
                    <img [src]="site.avatar" core-external-content [siteId]="site.id"
                        alt="{{ 'core.pictureof' | translate:{$a: site.fullName} }}"
                        onError="this.src='assets/img/user-avatar.png'">
                </ion-avatar>
                <ion-label>
                    <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-label>
            </ion-item>
            <ion-item>
                <ion-label>
                    <ion-button expand="block" (click)="cancel()">{{ 'core.login.cancel' | translate }}</ion-button>
                </ion-label>
            </ion-item>
        </ion-list>
    </core-loading>
</ion-content>
