feat(compare-authors): add author profile link
This commit is contained in:
@@ -32,7 +32,19 @@
|
||||
<span class="meta-label">Betrachtete Personen:</span>
|
||||
<div class="meta-chip-group">
|
||||
@for (author of summary(); track author.authorId) {
|
||||
<app-chip [color]="author.color">{{ author.name }}</app-chip>
|
||||
<app-chip [color]="author.color">
|
||||
<a
|
||||
class="chip-link"
|
||||
[routerLink]="[
|
||||
'/person',
|
||||
authorProfileId(author.authorId),
|
||||
'overview',
|
||||
]"
|
||||
title="Zur Autor:innen-Seite">
|
||||
{{ author.name }}
|
||||
<mat-icon>open_in_new</mat-icon>
|
||||
</a>
|
||||
</app-chip>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -159,7 +171,19 @@
|
||||
<th class="metric-col">Kennzahl</th>
|
||||
@for (author of summary(); track author.authorId) {
|
||||
<th class="author-col">
|
||||
<app-chip [color]="author.color">{{ author.name }}</app-chip>
|
||||
<app-chip [color]="author.color">
|
||||
<a
|
||||
class="chip-link"
|
||||
[routerLink]="[
|
||||
'/person',
|
||||
authorProfileId(author.authorId),
|
||||
'overview',
|
||||
]"
|
||||
title="Zur Autor:innen-Seite">
|
||||
{{ author.name }}
|
||||
<mat-icon>open_in_new</mat-icon>
|
||||
</a>
|
||||
</app-chip>
|
||||
</th>
|
||||
}
|
||||
</tr>
|
||||
|
||||
@@ -60,6 +60,28 @@ app-chip mat-icon {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.chip-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin: -4px -12px;
|
||||
padding: 4px 12px;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
mat-icon {
|
||||
font-size: 14px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
&:hover mat-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- cards ---- */
|
||||
.card {
|
||||
background: var(--sg-card-bg);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, computed, inject, signal } from '@angular/core';
|
||||
import { DecimalPipe, NgTemplateOutlet } from '@angular/common';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { NgxEchartsDirective } from 'ngx-echarts';
|
||||
@@ -123,6 +123,7 @@ interface SegmentDef {
|
||||
imports: [
|
||||
DecimalPipe,
|
||||
NgTemplateOutlet,
|
||||
RouterLink,
|
||||
MatIconModule,
|
||||
NgxEchartsDirective,
|
||||
AuthorResearchProfileComponent,
|
||||
@@ -474,6 +475,11 @@ export class CompareAuthorsComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
authorProfileId(authorId: string): string {
|
||||
const parts = authorId.split('/');
|
||||
return parts[parts.length - 1];
|
||||
}
|
||||
|
||||
// colours the author names on the chart axes like the legend chips
|
||||
private authorAxisLabel(profiles: AuthorTopicProfile[]) {
|
||||
const rich: Record<string, { color: string; fontWeight: number }> = {};
|
||||
|
||||
Reference in New Issue
Block a user