|
1 | 1 | <ng-container *transloco="let t; read: 'draft_history_entry'">
|
2 | 2 | @if (entry != null) {
|
3 |
| - <div class="draft-entry-heading" (click)="headerClicked()" [class.expandable]="!forceDetailsOpen"> |
4 |
| - <div class="entry-description"> |
5 |
| - <span class="drafted-books">{{ i18n.enumerateList(bookNames) }}</span> |
6 |
| - <span class="date">{{ formatDate(entry.additionalInfo?.dateFinished) }}</span> |
7 |
| - </div> |
8 |
| - <span class="spacer"></span> |
9 |
| - <span class="status" [style.color]="getStatus(entry.state).color"> |
10 |
| - <mat-icon class="status-icon">{{ getStatus(entry.state).icons }}</mat-icon> |
11 |
| - {{ t(getStatus(entry.state).text) }} |
12 |
| - </span> |
13 |
| - @if (!forceDetailsOpen && hasDetails) { |
14 |
| - <mat-icon class="expand-icon">expand_{{ detailsOpen ? "less" : "more" }}</mat-icon> |
15 |
| - } |
16 |
| - </div> |
17 |
| - @if (detailsOpen && hasDetails) { |
| 3 | + <mat-expansion-panel |
| 4 | + [disabled]="forceDetailsOpen || !hasDetails" |
| 5 | + [expanded]="forceDetailsOpen" |
| 6 | + [hideToggle]="forceDetailsOpen || !hasDetails" |
| 7 | + > |
| 8 | + <mat-expansion-panel-header [collapsedHeight]="'auto'" [expandedHeight]="'auto'"> |
| 9 | + <mat-panel-title> |
| 10 | + <span class="drafted-books">{{ i18n.enumerateList(bookNames) }}</span> |
| 11 | + <span class="date">{{ formatDate(entry.additionalInfo?.dateFinished) }}</span> |
| 12 | + </mat-panel-title> |
| 13 | + <mat-panel-description> |
| 14 | + <span class="status" [ngClass]="getStatus(entry.state).color"> |
| 15 | + <mat-icon class="status-icon">{{ getStatus(entry.state).icons }}</mat-icon> |
| 16 | + {{ t(getStatus(entry.state).text) }} |
| 17 | + </span> |
| 18 | + </mat-panel-description> |
| 19 | + </mat-expansion-panel-header> |
18 | 20 | <div class="draft-entry-body">
|
19 |
| - <ng-container *ngIf="canDownloadBuild"> |
| 21 | + @if (canDownloadBuild) { |
20 | 22 | <p>{{ t("click_book_to_preview") }}</p>
|
21 | 23 | <p class="book-buttons">
|
22 |
| - <app-draft-preview-books [build]="entry"></app-draft-preview-books> |
23 |
| - </p> |
24 |
| - <app-draft-download-button [build]="entry" [flat]="true"></app-draft-download-button> |
25 |
| - </ng-container> |
26 |
| - <ng-container *ngIf="hasTrainingData"> |
27 |
| - <p *ngIf="canDownloadBuild"> |
28 |
| - <a |
29 |
| - href="javascript:;" |
30 |
| - (click)="$event.preventDefault(); trainingDataOpen = !trainingDataOpen" |
31 |
| - class="training-data-link" |
32 |
| - > |
33 |
| - <mat-icon>expand_{{ trainingDataOpen ? "less" : "more" }}</mat-icon> |
34 |
| - {{ t(trainingDataOpen ? "hide_model_training_data" : "show_model_training_data") }} |
35 |
| - </a> |
| 24 | + <app-draft-preview-books [build]="entry" /> |
36 | 25 | </p>
|
37 |
| - @if (trainingDataOpen) { |
38 |
| - <p class="training-data"> |
39 |
| - <strong>{{ t("training_data_configuration") }}</strong> |
| 26 | + <app-draft-download-button [build]="entry" [flat]="true" /> |
| 27 | + } |
| 28 | + @if (hasTrainingConfiguration) { |
| 29 | + @if (canDownloadBuild) { |
| 30 | + <p> |
| 31 | + <a |
| 32 | + href="javascript:;" |
| 33 | + (click)="trainingConfigurationOpen = !trainingConfigurationOpen" |
| 34 | + class="training-configuration-link" |
| 35 | + > |
| 36 | + <mat-icon>expand_{{ trainingConfigurationOpen ? "less" : "more" }}</mat-icon> |
| 37 | + {{ |
| 38 | + t( |
| 39 | + trainingConfigurationOpen |
| 40 | + ? "hide_model_training_configuration" |
| 41 | + : "show_model_training_configuration" |
| 42 | + ) |
| 43 | + }} |
| 44 | + </a> |
| 45 | + </p> |
| 46 | + } |
| 47 | + @if (trainingConfigurationOpen) { |
| 48 | + <p> |
| 49 | + <strong>{{ t("training_model_description") }}</strong> |
40 | 50 | </p>
|
41 |
| - <table mat-table [dataSource]="trainingData"> |
| 51 | + <table mat-table [dataSource]="trainingConfiguration"> |
42 | 52 | <ng-container matColumnDef="bookNames">
|
43 | 53 | <th mat-header-cell *matHeaderCellDef></th>
|
44 | 54 | <td mat-cell *matCellDef="let element">{{ i18n.enumerateList(element.bookNames) }}</td>
|
|
59 | 69 | <tr mat-row *matRowDef="let row; columns: columnsToDisplay"></tr>
|
60 | 70 | </table>
|
61 | 71 | }
|
62 |
| - </ng-container> |
| 72 | + } |
63 | 73 | </div>
|
64 |
| - } |
| 74 | + </mat-expansion-panel> |
65 | 75 | }
|
66 | 76 | </ng-container>
|
0 commit comments