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="!isDragging">
<ng-container *ngIf="selectedItemInLinks && (link.type != tocEntryType.Page) && isLast && (!viewOnly); else selectedWithItems">
<ng-container *ngIf="selectedItemInLinks && (link.type != tocEntryType.Page) && isLast && (!viewOnly)">
<button mat-button class="add-new-entry" style="padding-left: 0px;" (click)="createNewEntry({childType:link.type,parent:parentLink})"> <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 [ngSwitch]="link.type">
<ng-container *ngSwitchCase="tocEntryType.Section"> <ng-container *ngSwitchCase="tocEntryType.Section">
@ -57,8 +56,6 @@
<!-- Create new subsection --> <!-- Create new subsection -->
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-NEW-SUBSECTION' | translate}} {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-NEW-SUBSECTION' | translate}}
</div> </div>
<!-- Subsection + --> <!-- Subsection + -->
</ng-container> </ng-container>
<ng-container *ngSwitchCase="tocEntryType.FieldSet"> <ng-container *ngSwitchCase="tocEntryType.FieldSet">
@ -69,6 +66,31 @@
</ng-container> </ng-container>
</button> </button>
</ng-container> </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> </ng-container>
</div> </div>
</div> </div>