<ng-container *osPerms="'agenda.can_manage'">
    <ng-container *ngIf="showForm">
        <div [formGroup]="form">
            <p>
                <mat-checkbox formControlName="agenda_create">
                    <span translate>Add to agenda</span>
                </mat-checkbox>
            </p>
        </div>

        <ng-container *ngIf="!!checkbox.value">
            <!-- Visibility -->
            <div>
                <mat-form-field [formGroup]="form">
                    <mat-select formControlName="agenda_type" placeholder="{{ 'Agenda visibility' | translate }}">
                        <mat-option *ngFor="let type of ItemVisibilityChoices" [value]="type.key">
                            <span>{{ type.name | translate }}</span>
                        </mat-option>
                    </mat-select>
                </mat-form-field>
            </div>

            <!-- Parent item -->
            <div *ngIf="itemObserver.value.length > 0">
                <os-search-value-selector
                    ngDefaultControl
                    [formControl]="form.get('agenda_parent_id')"
                    [multiple]="false"
                    [includeNone]="true"
                    listname="{{ 'Parent agenda item' | translate }}"
                    [inputListValues]="itemObserver"
                ></os-search-value-selector>
            </div>
        </ng-container>
    </ng-container>
</ng-container>
