<ion-header>
    <ion-toolbar>
        <ion-buttons slot="start">
            <ion-back-button [text]="'core.back' | translate"></ion-back-button>
        </ion-buttons>
        <ion-title>
            <h1>
                <core-format-text [text]="title" contextLevel="module" [contextInstanceId]="moduleId" [courseId]="courseId">
                </core-format-text>
            </h1>
        </ion-title>
        <ion-buttons slot="end">
            <ion-button *ngIf="entry" fill="clear" (click)="save($event)">
                {{ 'core.save' | translate }}
            </ion-button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>
<ion-content>
    <core-loading [hideUntil]="loaded">
        <core-group-selector [groupInfo]="groupInfo" [(selected)]="selectedGroup" (selectedChange)="setGroup(selectedGroup)"
            [courseId]="database?.course">
        </core-group-selector>

        <div class="addon-data-contents {{cssClass}}" *ngIf="database">
            <core-style [css]="database.csstemplate" prefix=".{{cssClass}}"></core-style>

            <form (ngSubmit)="save($event)" [formGroup]="editForm" #editFormEl>
                <core-compile-html [text]="editFormRender" [jsData]="jsData" [extraImports]="extraImports"></core-compile-html>
            </form>
        </div>
    </core-loading>
</ion-content>
