fix(person-funding): icon-only publication link + return to Förderungen #257

Merged
khalti merged 1 commits from ts-136-patent-to-researchers-v2 into dev 2026-08-01 21:35:49 +02:00
5 changed files with 51 additions and 43 deletions
@@ -121,21 +121,25 @@
<ul class="publication-list">
@for (id of getSelectedPublicationIdsPage(); track id) {
<li class="publication-item" (click)="togglePublication(id)">
<span class="publication-title">{{
getPublicationTitle(id)
}}</span>
@if (expandedPublicationId === id) {
<a
class="publication-more-info"
title="Publikationsdetails öffnen"
[routerLink]="['/publication', getShortPublicationId(id)]"
(click)="$event.stopPropagation()">
<span class="mehr-infos-label">Mehr Infos</span>
<span class="publication-link-icon">
<span class="publication-title">
{{ getPublicationTitle(id) }}
@if (expandedPublicationId === id) {
<a
class="publication-more-info"
title="Publikationsdetails öffnen"
[routerLink]="[
'/publication',
getShortPublicationId(id),
]"
[state]="{
returnUrl: getCurrentUrl(),
returnLabel: 'Förderungen',
}"
(click)="$event.stopPropagation()">
<span class="material-icons">open_in_new</span>
</span>
</a>
}
</a>
}
</span>
</li>
}
</ul>
@@ -331,22 +331,22 @@ app-query-param-paginator {
.publication-more-info {
display: inline-flex;
align-items: center;
gap: 4px;
margin-top: 8px;
padding: 4px 10px;
border: 1px solid var(--sg-border);
border-radius: 999px;
background: var(--sg-surface);
vertical-align: middle;
margin-left: 6px;
color: #1976d2;
cursor: pointer;
text-decoration: none;
transition: all 0.15s ease;
transition: color 0.15s ease;
&:hover,
&:focus-visible {
border-color: #1976d2;
background: rgba(16, 26, 61, 0.04);
color: #0b4f9e;
outline: none;
}
.material-icons {
font-size: 16px;
}
}
.publication-item {
@@ -372,21 +372,3 @@ app-query-param-paginator {
display: block;
}
.mehr-infos-label,
.publication-link-icon {
color: #1976d2;
}
.mehr-infos-label {
font-size: 0.8rem;
font-weight: 600;
}
.publication-link-icon {
display: flex;
align-items: center;
.material-icons {
font-size: 16px;
}
}
@@ -349,6 +349,10 @@ export class PersonFundingComponent implements OnInit {
this.expandedPublicationId = this.expandedPublicationId === id ? null : id;
}
getCurrentUrl(): string {
return this.router.url;
}
getPublicationDetail(publicationId: string): FundingPublicationDetail | null {
const detail = this.selectedFunder?.publication_details?.[publicationId];
if (detail) {
@@ -3,9 +3,9 @@
type="button"
class="back-link"
(click)="navigateBack()"
aria-label="Zurück zu den Publikationen">
[attr.aria-label]="returnAriaLabel">
<mat-icon>arrow_back</mat-icon>
Alle Publikationen
{{ returnLabel }}
</button>
@if (loading) {
@@ -80,9 +80,23 @@ export class PublicationDetailComponent implements OnInit {
institutionsPage = 0;
readonly institutionsPageSize = 5;
returnUrl: string | null = null;
returnLabel = 'Alle Publikationen';
returnAriaLabel = 'Zurück zu den Publikationen';
ngOnInit(): void {
this.loading = true;
const navigationState = this.location.getState() as {
returnUrl?: string;
returnLabel?: string;
} | null;
if (navigationState?.returnUrl) {
this.returnUrl = navigationState.returnUrl;
this.returnLabel = navigationState.returnLabel ?? 'Zurück';
this.returnAriaLabel = `Zurück zu ${this.returnLabel}`;
}
this.route.data.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
next: ({ publication }) => {
this.publication = publication;
@@ -98,6 +112,10 @@ export class PublicationDetailComponent implements OnInit {
}
navigateBack(): void {
if (this.returnUrl) {
this.router.navigateByUrl(this.returnUrl);
return;
}
this.location.back();
}