Skip to content

Commit

Permalink
SF-3170 Show a summary message when no training books are selected (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmyers authored Jan 23, 2025
1 parent 4f60099 commit 855c1cb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,31 +211,35 @@ <h1 class="mat-headline-4">{{ t("summary_title") }}</h1>

<h2>{{ t("summary_training_title") }}</h2>
<mat-card class="confirm-section mat-elevation-z2">
<span class="explanation">{{ t("summary_training") }}</span>
<table mat-table class="confirm-training" [dataSource]="selectedTrainingBooksCollapsed()">
<ng-container matColumnDef="book">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<div class="confirm-books cell-padding-block">
{{ i18n.enumerateList(element.ranges) }}
</div>
</td>
</ng-container>
<ng-container matColumnDef="source">
<th mat-header-cell *matHeaderCellDef>
{{ i18n.getLanguageDisplayName(trainingSources[0].writingSystem.tag) }}
</th>
<td mat-cell *matCellDef="let element">{{ element.sourceName }}</td>
</ng-container>
<ng-container matColumnDef="target">
<th mat-header-cell *matHeaderCellDef>
{{ i18n.getLanguageDisplayName(trainingTargets[0].writingSystem.tag) }}
</th>
<td mat-cell *matCellDef="let element">{{ trainingTargets[0].shortName }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="['book', 'source', 'target']"></tr>
<tr mat-row *matRowDef="let row; columns: ['book', 'source', 'target']"></tr>
</table>
@if (selectedTrainingBooksCollapsed().length === 0) {
<span>{{ t("no_training_books") }}</span>
} @else {
<span class="explanation">{{ t("summary_training") }}</span>
<table mat-table class="confirm-training" [dataSource]="selectedTrainingBooksCollapsed()">
<ng-container matColumnDef="book">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<div class="confirm-books cell-padding-block">
{{ i18n.enumerateList(element.ranges) }}
</div>
</td>
</ng-container>
<ng-container matColumnDef="source">
<th mat-header-cell *matHeaderCellDef>
{{ i18n.getLanguageDisplayName(trainingSources[0].writingSystem.tag) }}
</th>
<td mat-cell *matCellDef="let element">{{ element.sourceName }}</td>
</ng-container>
<ng-container matColumnDef="target">
<th mat-header-cell *matHeaderCellDef>
{{ i18n.getLanguageDisplayName(trainingTargets[0].writingSystem.tag) }}
</th>
<td mat-cell *matCellDef="let element">{{ trainingTargets[0].shortName }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="['book', 'source', 'target']"></tr>
<tr mat-row *matRowDef="let row; columns: ['book', 'source', 'target']"></tr>
</table>
}
</mat-card>

<h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
"loading": "Loading...",
"next": "Next",
"no_available_books": "You have no books available for drafting.",
"no_training_books": "No training books selected",
"overview": "Overview",
"reference_books": "Reference books",
"these_source_books_cannot_be_used_for_training": "The following books cannot be used for training as they are not in the training source text ({{ firstTrainingSource }}).",
Expand Down

0 comments on commit 855c1cb

Please sign in to comment.