fix on description-template toc

This commit is contained in:
Sofia Papacharalampous 2024-05-14 12:52:42 +03:00
parent b14e20edff
commit 5256d30f32
1 changed files with 26 additions and 4 deletions

View File

@ -47,8 +47,7 @@
<ng-container *ngIf="!isDragging">
<ng-container *ngIf="selectedItemInLinks && (link.type != tocEntryType.Page) && isLast && (!viewOnly)">
<ng-container *ngIf="selectedItemInLinks && (link.type != tocEntryType.Page) && isLast && (!viewOnly); else selectedWithItems">
<button mat-button class="add-new-entry" style="padding-left: 0px;" (click)="createNewEntry({childType:link.type,parent:parentLink})">
<ng-container [ngSwitch]="link.type">
<ng-container *ngSwitchCase="tocEntryType.Section">
@ -57,8 +56,6 @@
<!-- Create new subsection -->
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-NEW-SUBSECTION' | translate}}
</div>
<!-- Subsection + -->
</ng-container>
<ng-container *ngSwitchCase="tocEntryType.FieldSet">
@ -69,6 +66,31 @@
</ng-container>
</button>
</ng-container>
<ng-template #selectedWithItems>
<ng-container *ngIf="link.id == itemSelected?.id && (!viewOnly)">
<ng-container [ngSwitch]="link.type">
<ng-container *ngSwitchCase="tocEntryType.Page">
<button mat-button class="add-new-entry" style="padding-left: 0px;" (click)="createNewEntry({childType:tocEntryType.Section,parent:link})">
<div class="d-flex" style="align-items: center;">
<mat-icon color="accent" style="font-size: 1.6em;margin-left: -0.3em;">add</mat-icon>
<!-- Create child section -->
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-NEW-SUBSECTION' | translate}}
</div>
</button>
</ng-container>
<ng-container *ngSwitchCase="tocEntryType.Section">
<button mat-button class="add-new-entry" style="padding-left: 0px;" (click)="createNewEntry({childType:tocEntryType.FieldSet,parent:link})">
<div class="d-flex" style="align-items: center;">
<mat-icon color="accent" style="font-size: 1.6em;margin-left: -0.3em;">add</mat-icon>
<!-- Create child subsection -->
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-NEW-SUBSECTION' | translate}}
</div>
</button>
</ng-container>
</ng-container>
</ng-container>
</ng-template>
</ng-container>
</div>
</div>