131 lines
4.3 KiB
HTML
131 lines
4.3 KiB
HTML
<div class="compare-layout">
|
||
<header class="compare-header">
|
||
<h1>Autoren-Vergleich</h1>
|
||
|
||
<div class="compare-meta">
|
||
@if (keywords().length > 0) {
|
||
<span class="meta-chip">
|
||
<mat-icon>topic</mat-icon>
|
||
{{ keywords().join(', ') }}
|
||
</span>
|
||
}
|
||
@if (timespan(); as span) {
|
||
<span class="meta-chip">
|
||
<mat-icon>date_range</mat-icon>
|
||
{{ span.from }}–{{ span.to }}
|
||
</span>
|
||
}
|
||
</div>
|
||
|
||
@if (hasData()) {
|
||
<ul class="author-legend">
|
||
@for (author of summary(); track author.authorId) {
|
||
<li class="legend-item">
|
||
<span
|
||
class="legend-swatch"
|
||
[style.background]="author.color"></span>
|
||
<span class="legend-name">{{ author.name }}</span>
|
||
</li>
|
||
}
|
||
</ul>
|
||
}
|
||
</header>
|
||
|
||
@if (loading()) {
|
||
<p class="compare-hint">Lädt…</p>
|
||
} @else if (!hasData()) {
|
||
<p class="compare-hint">Keine Daten für die ausgewählten Autoren.</p>
|
||
} @else {
|
||
<!-- section 1: stats over the topic-filtered works -->
|
||
<section class="card">
|
||
<h2 class="card-title">Kennzahlen zu den Keywords</h2>
|
||
<p class="card-sub">
|
||
Bester Wert je Zeile ist hervorgehoben. „–“ bedeutet, dass der Wert für
|
||
diese:n Autor:in nicht vorliegt.
|
||
</p>
|
||
<ng-container
|
||
[ngTemplateOutlet]="statsTable"
|
||
[ngTemplateOutletContext]="{ rows: topicRows() }" />
|
||
</section>
|
||
|
||
<!-- section 2: author-level stats, independent of the keywords and time -->
|
||
<section class="card">
|
||
<h2 class="card-title">Kennzahlen zur Person</h2>
|
||
<p class="card-sub">Unabhängig von den Keywords und Zeitraum.</p>
|
||
<ng-container
|
||
[ngTemplateOutlet]="statsTable"
|
||
[ngTemplateOutletContext]="{ rows: staticRows() }" />
|
||
</section>
|
||
}
|
||
</div>
|
||
|
||
<ng-template #statsTable let-rows="rows">
|
||
<div class="table-scroll">
|
||
<table class="compare-table">
|
||
<thead>
|
||
<tr>
|
||
<th class="metric-col">Kennzahl</th>
|
||
@for (author of summary(); track author.authorId) {
|
||
<th class="author-col">
|
||
<span class="th-name">
|
||
<span
|
||
class="legend-swatch"
|
||
[style.background]="author.color"></span>
|
||
{{ author.name }}
|
||
</span>
|
||
</th>
|
||
}
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@for (row of rows; track row.label) {
|
||
<tr>
|
||
<th scope="row" class="metric-col">
|
||
<span class="metric-label">{{ row.label }}</span>
|
||
<span class="metric-hint">{{ row.hint }}</span>
|
||
@if (row.kind === 'positions') {
|
||
<span class="position-legend">
|
||
<span class="pos pos-first">Erst</span>
|
||
<span class="pos-sep">|</span>
|
||
<span class="pos pos-middle">Mittel</span>
|
||
<span class="pos-sep">|</span>
|
||
<span class="pos pos-last">Letzt</span>
|
||
</span>
|
||
}
|
||
</th>
|
||
@if (row.kind === 'positions') {
|
||
@for (pc of row.positionCells; track $index) {
|
||
<td class="value-cell position-cell">
|
||
<span class="pos pos-first">
|
||
{{ pc.first === null ? '–' : (pc.first | number) }}
|
||
</span>
|
||
<span class="pos-sep">|</span>
|
||
<span class="pos pos-middle">
|
||
{{ pc.middle === null ? '–' : (pc.middle | number) }}
|
||
</span>
|
||
<span class="pos-sep">|</span>
|
||
<span class="pos pos-last">
|
||
{{ pc.last === null ? '–' : (pc.last | number) }}
|
||
</span>
|
||
</td>
|
||
}
|
||
} @else {
|
||
@for (cell of row.cells; track $index) {
|
||
<td class="value-cell" [class.best]="cell.best">
|
||
@if (cell.raw === null) {
|
||
<span class="value-empty">–</span>
|
||
} @else if (row.decimals) {
|
||
{{ cell.raw | number: '1.2-2' }}
|
||
} @else {
|
||
{{ cell.raw | number }}
|
||
}
|
||
</td>
|
||
}
|
||
}
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</ng-template>
|