Merge remote-tracking branch 'origin/dev' into work-purpose
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -55,6 +55,7 @@ async def get_author_works(
|
||||
language: list[str] | None = None,
|
||||
institution_id: list[str] | None = None,
|
||||
topic_id: list[str] | None = None,
|
||||
sort: str = "year",
|
||||
client: OpenAlexWorksSearchClient | None = None,
|
||||
) -> WorkPage:
|
||||
search_client = client or OpenAlexWorksSearchClient()
|
||||
@@ -68,6 +69,7 @@ async def get_author_works(
|
||||
language=language,
|
||||
institution_id=institution_id,
|
||||
topic_id=topic_id,
|
||||
sort=sort,
|
||||
)
|
||||
|
||||
elements, total = _parse_full_work_search_response(data)
|
||||
@@ -929,6 +931,7 @@ async def _search_author_works_data(
|
||||
language: list[str] | None = None,
|
||||
institution_id: list[str] | None = None,
|
||||
topic_id: list[str] | None = None,
|
||||
sort: str = "year",
|
||||
) -> dict:
|
||||
return await search_client.search_author_works(
|
||||
author_id,
|
||||
@@ -939,6 +942,7 @@ async def _search_author_works_data(
|
||||
language=language,
|
||||
institution_id=institution_id,
|
||||
topic_id=topic_id,
|
||||
sort=sort,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ class OpenAlexWorksSearchClient:
|
||||
language: list[str] | None = None,
|
||||
institution_id: list[str] | None = None,
|
||||
topic_id: list[str] | None = None,
|
||||
sort: str = "year",
|
||||
) -> dict[str, Any]:
|
||||
indexed_author_id = f"https://openalex.org/{author_id.strip()}"
|
||||
filters = self._work_filters(
|
||||
@@ -73,6 +74,16 @@ class OpenAlexWorksSearchClient:
|
||||
},
|
||||
},
|
||||
})
|
||||
if sort == "citations":
|
||||
sort_clauses = [
|
||||
{"cited_by_count": {"order": "desc", "missing": "_last"}},
|
||||
{"publication_year": {"order": "desc", "missing": "_last"}},
|
||||
]
|
||||
else:
|
||||
sort_clauses = [
|
||||
{"publication_year": {"order": "desc", "missing": "_last"}},
|
||||
{"cited_by_count": {"order": "desc", "missing": "_last"}},
|
||||
]
|
||||
return {
|
||||
"from": (page - 1) * size,
|
||||
"size": size,
|
||||
@@ -83,10 +94,7 @@ class OpenAlexWorksSearchClient:
|
||||
"filter": filters,
|
||||
},
|
||||
},
|
||||
"sort": [
|
||||
{"publication_year": {"order": "desc", "missing": "_last"}},
|
||||
{"cited_by_count": {"order": "desc", "missing": "_last"}},
|
||||
],
|
||||
"sort": sort_clauses,
|
||||
}
|
||||
|
||||
def _work_filters(
|
||||
@@ -130,6 +138,7 @@ class OpenAlexWorksSearchClient:
|
||||
language: list[str] | None = None,
|
||||
institution_id: list[str] | None = None,
|
||||
topic_id: list[str] | None = None,
|
||||
sort: str = "year",
|
||||
) -> dict[str, Any]:
|
||||
if not self.api_key:
|
||||
raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.")
|
||||
@@ -143,6 +152,7 @@ class OpenAlexWorksSearchClient:
|
||||
language=language,
|
||||
institution_id=institution_id,
|
||||
topic_id=topic_id,
|
||||
sort=sort,
|
||||
)
|
||||
return await elasticsearch.search(index=self.index,body=body,cluster=ESCluster.NES,)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
REST API for publication works.
|
||||
"""
|
||||
|
||||
from typing import Annotated, Optional
|
||||
from typing import Annotated, Literal, Optional
|
||||
|
||||
from fastapi import APIRouter
|
||||
from fastapi import Path
|
||||
@@ -54,6 +54,10 @@ async def get_author_works(
|
||||
list[str] | None,
|
||||
Query(description="Filter by OpenAlex topic id. Can be repeated."),
|
||||
] = None,
|
||||
sort: Annotated[
|
||||
Literal["year", "citations"],
|
||||
Query(description="Sort order: by publication year or by citation count."),
|
||||
] = "year",
|
||||
):
|
||||
return await logic.get_author_works(
|
||||
author_id,
|
||||
@@ -64,6 +68,7 @@ async def get_author_works(
|
||||
language=language,
|
||||
institution_id=institution_id,
|
||||
topic_id=topic_id,
|
||||
sort=sort,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,28 @@ def test_author_works_query_searches_authorship_author_id():
|
||||
assert query["query"]["bool"]["filter"] == []
|
||||
|
||||
|
||||
def test_author_works_query_sorts_by_year_by_default():
|
||||
client = OpenAlexWorksSearchClient(api_key="test-key")
|
||||
|
||||
query = client.author_works_query("A5023888391", page=1, size=20)
|
||||
|
||||
assert query["sort"] == [
|
||||
{"publication_year": {"order": "desc", "missing": "_last"}},
|
||||
{"cited_by_count": {"order": "desc", "missing": "_last"}},
|
||||
]
|
||||
|
||||
|
||||
def test_author_works_query_sorts_by_citations():
|
||||
client = OpenAlexWorksSearchClient(api_key="test-key")
|
||||
|
||||
query = client.author_works_query("A5023888391", page=1, size=20, sort="citations")
|
||||
|
||||
assert query["sort"] == [
|
||||
{"cited_by_count": {"order": "desc", "missing": "_last"}},
|
||||
{"publication_year": {"order": "desc", "missing": "_last"}},
|
||||
]
|
||||
|
||||
|
||||
def test_author_works_query_adds_publication_filters():
|
||||
client = OpenAlexWorksSearchClient(api_key="test-key")
|
||||
|
||||
|
||||
@@ -170,13 +170,14 @@ export class WorksService extends BaseService {
|
||||
* @param language Filter by language code. Can be repeated.
|
||||
* @param institutionId Filter by OpenAlex institution id. Can be repeated.
|
||||
* @param topicId Filter by OpenAlex topic id. Can be repeated.
|
||||
* @param sort Sort order: by publication year or by citation count.
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, institutionId?: Array<string>, topicId?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<WorkPage>;
|
||||
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, institutionId?: Array<string>, topicId?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<WorkPage>>;
|
||||
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, institutionId?: Array<string>, topicId?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<WorkPage>>;
|
||||
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, institutionId?: Array<string>, topicId?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, institutionId?: Array<string>, topicId?: Array<string>, sort?: 'year' | 'citations', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<WorkPage>;
|
||||
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, institutionId?: Array<string>, topicId?: Array<string>, sort?: 'year' | 'citations', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<WorkPage>>;
|
||||
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, institutionId?: Array<string>, topicId?: Array<string>, sort?: 'year' | 'citations', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<WorkPage>>;
|
||||
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, institutionId?: Array<string>, topicId?: Array<string>, sort?: 'year' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (authorId === null || authorId === undefined) {
|
||||
throw new Error('Required parameter authorId was null or undefined when calling getAuthorWorks.');
|
||||
}
|
||||
@@ -216,6 +217,8 @@ export class WorksService extends BaseService {
|
||||
<any>element, 'topic_id');
|
||||
})
|
||||
}
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>sort, 'sort');
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
|
||||
@@ -95,6 +95,14 @@
|
||||
>{{ inst.country_code.toUpperCase() }}</span
|
||||
>
|
||||
}
|
||||
@if (institutionPageId() && !loading()) {
|
||||
<mat-icon
|
||||
class="institution-open-icon"
|
||||
(click)="openInstitutionPage($event)"
|
||||
aria-label="Institutionsseite öffnen"
|
||||
>open_in_new</mat-icon
|
||||
>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -162,6 +162,31 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.institution-open-icon {
|
||||
flex-shrink: 0;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-left: 5px;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover .institution-open-icon {
|
||||
opacity: 0.7;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
background: var(--sg-primary);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, input, computed, output } from '@angular/core';
|
||||
import { Component, inject, input, computed, output } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { CustomAuthor, DehydratedInstitution, WorkTopic } from '../../api';
|
||||
@@ -23,6 +23,8 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||
styleUrl: './person-card.component.scss',
|
||||
})
|
||||
export class PersonCardComponent {
|
||||
private readonly router = inject(Router);
|
||||
|
||||
person = input.required<CustomAuthor>();
|
||||
isBookmarked = input<boolean>(false);
|
||||
loading = input<boolean>(false);
|
||||
@@ -66,6 +68,20 @@ export class PersonCardComponent {
|
||||
return newestInstitution;
|
||||
});
|
||||
|
||||
institutionPageId = computed<string | null>(
|
||||
() => this.institution()?.id?.split('/').pop() ?? null,
|
||||
);
|
||||
|
||||
openInstitutionPage(event: Event): void {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
const id = this.institutionPageId();
|
||||
if (!id) return;
|
||||
|
||||
void this.router.navigate(['/institution', id]);
|
||||
}
|
||||
|
||||
isInstitutionActive = computed<boolean>(() => {
|
||||
const active = this.activeInstitutionName().trim().toLowerCase();
|
||||
if (!active) return false;
|
||||
|
||||
@@ -82,6 +82,14 @@
|
||||
filter.countryCode.toUpperCase()
|
||||
}}</span>
|
||||
}
|
||||
@if (findInstitutionPageIdByName(filter.value)) {
|
||||
<mat-icon
|
||||
class="institution-open-icon"
|
||||
(click)="openInstitutionPage(filter.value, $event)"
|
||||
aria-label="Institutionsseite öffnen"
|
||||
>open_in_new</mat-icon
|
||||
>
|
||||
}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -217,6 +217,27 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filter-institution-chip .institution-open-icon {
|
||||
flex-shrink: 0;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-left: 5px;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.filter-institution-chip:hover .institution-open-icon {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.filter-institution-chip .institution-open-icon:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.filter-chip button,
|
||||
.active-topic-filter button,
|
||||
.active-institution-filter button,
|
||||
|
||||
@@ -328,6 +328,41 @@ export class PersonListComponent {
|
||||
return filter.label.replace(/^Institution:\s*/, '');
|
||||
}
|
||||
|
||||
findInstitutionPageIdByName(institutionName: string): string | null {
|
||||
const normalized = institutionName.trim().toLowerCase();
|
||||
if (!normalized) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (const person of this.persons) {
|
||||
const candidates: Array<DehydratedInstitution | undefined> = [
|
||||
...(person.last_known_institutions ?? []),
|
||||
...(person.affiliations ?? []).map((a) => a.institution ?? undefined),
|
||||
];
|
||||
|
||||
for (const inst of candidates) {
|
||||
if (
|
||||
inst?.id &&
|
||||
(inst.display_name ?? '').trim().toLowerCase() === normalized
|
||||
) {
|
||||
return inst.id.split('/').pop() ?? null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
openInstitutionPage(institutionName: string, event: Event): void {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
const id = this.findInstitutionPageIdByName(institutionName);
|
||||
if (!id) return;
|
||||
|
||||
void this.router.navigate(['/institution', id]);
|
||||
}
|
||||
|
||||
private findInstitutionCountryCode(institutionName: string): string | null {
|
||||
const normalized = institutionName.trim().toLowerCase();
|
||||
if (!normalized) {
|
||||
|
||||
@@ -185,6 +185,21 @@
|
||||
</mat-autocomplete>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="sort-field">
|
||||
<mat-icon matPrefix class="filter-prefix-icon">sort</mat-icon>
|
||||
<mat-select
|
||||
[formControl]="sortControl"
|
||||
[panelWidth]="null"
|
||||
aria-label="Sortierung"
|
||||
(selectionChange)="onSortChange()">
|
||||
@for (option of sortOptions; track option.value) {
|
||||
<mat-option [value]="option.value">{{
|
||||
option.label
|
||||
}}</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<button
|
||||
class="reset-filter-btn"
|
||||
mat-stroked-button
|
||||
@@ -308,6 +323,12 @@
|
||||
instCountry.toUpperCase()
|
||||
}}</span>
|
||||
}
|
||||
<mat-icon
|
||||
class="institution-open-icon"
|
||||
(click)="openInstitutionPage(institution.id, $event)"
|
||||
aria-label="Institutionsseite öffnen"
|
||||
>open_in_new</mat-icon
|
||||
>
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
@@ -323,220 +344,6 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- <div class="table-wrap">
|
||||
@if (loading) {
|
||||
<div class="table-status">
|
||||
<mat-spinner diameter="36"></mat-spinner>
|
||||
<span>Publikationen werden geladen …</span>
|
||||
</div>
|
||||
} @else if (publications.length === 0) {
|
||||
<div class="table-status empty-state">
|
||||
Keine Publikationen gefunden.
|
||||
</div>
|
||||
}
|
||||
|
||||
<table
|
||||
mat-table
|
||||
[dataSource]="publications"
|
||||
class="mat-elevation-z2"
|
||||
[class.is-hidden]="loading || publications.length === 0">
|
||||
<ng-container matColumnDef="title">
|
||||
<th mat-header-cell *matHeaderCellDef>Titel</th>
|
||||
<td mat-cell *matCellDef="let publication">
|
||||
<a
|
||||
class="title"
|
||||
[routerLink]="['/publication', publicationKey(publication)]">
|
||||
{{ publication.title || 'Ohne Titel' }}
|
||||
</a>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="year">
|
||||
<th mat-header-cell *matHeaderCellDef>Jahr</th>
|
||||
<td mat-cell *matCellDef="let publication">
|
||||
@if (publication.publication_year) {
|
||||
<button
|
||||
type="button"
|
||||
class="cell-filter-pill"
|
||||
[class.active]="isYearActive(publication.publication_year)"
|
||||
matTooltip="Nach Jahr filtern"
|
||||
matTooltipPosition="above"
|
||||
(click)="toggleYearFilter(publication.publication_year)">
|
||||
{{ publication.publication_year }}
|
||||
</button>
|
||||
} @else {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="type">
|
||||
<th mat-header-cell *matHeaderCellDef>Typ</th>
|
||||
<td mat-cell *matCellDef="let publication">
|
||||
@if (publication.type) {
|
||||
<button
|
||||
type="button"
|
||||
class="type-filter-btn"
|
||||
[class.active]="isTypeActive(publication.type)"
|
||||
matTooltip="Nach Typ filtern"
|
||||
matTooltipPosition="above"
|
||||
(click)="toggleTypeFilter(publication.type)">
|
||||
<app-chip [color]="typeColor(publication.type)">
|
||||
{{ publication.type }}
|
||||
</app-chip>
|
||||
</button>
|
||||
} @else {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="language">
|
||||
<th mat-header-cell *matHeaderCellDef>Sprache / Quelle</th>
|
||||
<td mat-cell *matCellDef="let publication">
|
||||
@if (publication.language) {
|
||||
<button
|
||||
type="button"
|
||||
class="cell-filter-pill"
|
||||
[class.active]="isLanguageActive(publication.language)"
|
||||
matTooltip="Nach Sprache filtern"
|
||||
matTooltipPosition="above"
|
||||
(click)="toggleLanguageFilter(publication.language)">
|
||||
{{ publication.language }}
|
||||
</button>
|
||||
} @else {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="institutions">
|
||||
<th mat-header-cell *matHeaderCellDef>Institutionen</th>
|
||||
<td mat-cell *matCellDef="let publication">
|
||||
@let publicationInstitutions = institutions(publication);
|
||||
@let institutionsExpanded = isInstitutionsExpanded(publication);
|
||||
@let visibleInstitutions =
|
||||
institutionsExpanded
|
||||
? publicationInstitutions
|
||||
: publicationInstitutions.slice(0, 3);
|
||||
<div class="institution-tags" aria-label="Institutionen">
|
||||
@for (
|
||||
institution of visibleInstitutions;
|
||||
track institution.id
|
||||
) {
|
||||
<button
|
||||
type="button"
|
||||
class="publication-institution-tag"
|
||||
[class.active]="isInstitutionActive(institution.id)"
|
||||
[matTooltip]="institution.name"
|
||||
matTooltipPosition="above"
|
||||
[attr.aria-label]="
|
||||
'Nach Institution ' + institution.name + ' filtern'
|
||||
"
|
||||
(click)="filterByInstitution(institution)">
|
||||
<mat-icon class="institution-icon">apartment</mat-icon>
|
||||
<span class="institution-name">{{ institution.name }}</span>
|
||||
@if (institution.country) {
|
||||
<img
|
||||
alt=""
|
||||
class="flag-img"
|
||||
[src]="
|
||||
'https://flagcdn.io/' +
|
||||
institution.country.toLowerCase() +
|
||||
'.svg'
|
||||
"
|
||||
height="10" />
|
||||
<span class="country-code">{{
|
||||
institution.country.toUpperCase()
|
||||
}}</span>
|
||||
}
|
||||
</button>
|
||||
} @empty {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
@if (publicationInstitutions.length > 3) {
|
||||
<button
|
||||
type="button"
|
||||
class="publication-institution-more"
|
||||
[attr.aria-expanded]="institutionsExpanded"
|
||||
(click)="toggleInstitutions(publication)">
|
||||
{{
|
||||
institutionsExpanded
|
||||
? 'weniger'
|
||||
: '+' + (publicationInstitutions.length - 3)
|
||||
}}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="citations">
|
||||
<th mat-header-cell *matHeaderCellDef>Zitationen</th>
|
||||
<td mat-cell *matCellDef="let publication">
|
||||
{{ publication.cited_by_count ?? 0 }}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="topics">
|
||||
<th mat-header-cell *matHeaderCellDef>Themen</th>
|
||||
<td mat-cell *matCellDef="let publication">
|
||||
@let publicationTopics = publication.topics ?? [];
|
||||
@let topicsExpanded = isTopicsExpanded(publication);
|
||||
@let visibleTopics =
|
||||
topicsExpanded
|
||||
? publicationTopics
|
||||
: publicationTopics.slice(0, 3);
|
||||
<div class="topic-chips" aria-label="Themen">
|
||||
@for (topic of visibleTopics; track topic.id) {
|
||||
<app-topic-chip
|
||||
size="mini"
|
||||
[label]="topic.display_name || ''"
|
||||
[description]="topic.description"
|
||||
[subfieldName]="topic.subfield?.display_name"
|
||||
[fieldName]="topic.field?.display_name"
|
||||
[domainName]="topic.domain?.display_name"
|
||||
[color]="getTopicColor(topic)"
|
||||
[disabled]="!topic.id"
|
||||
[active]="isTopicActive(topic)"
|
||||
(chipClick)="filterByTopic(topic)">
|
||||
</app-topic-chip>
|
||||
} @empty {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
@if (publicationTopics.length > 3) {
|
||||
<button
|
||||
type="button"
|
||||
class="publication-topic-more"
|
||||
[attr.aria-expanded]="topicsExpanded"
|
||||
(click)="toggleTopics(publication)">
|
||||
{{
|
||||
topicsExpanded
|
||||
? 'weniger'
|
||||
: '+' + (publicationTopics.length - 3)
|
||||
}}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="table-footer">
|
||||
<span>{{ publicationRange() }}</span>
|
||||
<mat-paginator
|
||||
[length]="total"
|
||||
[pageIndex]="currentPageIndex"
|
||||
[pageSize]="paginationService.selection"
|
||||
[pageSizeOptions]="paginationService.options"
|
||||
(page)="onPage($event)">
|
||||
</mat-paginator>
|
||||
</div> -->
|
||||
|
||||
<app-data-table [columns]="workColumns" [data]="publications" />
|
||||
<app-query-param-paginator
|
||||
[total]="total"
|
||||
|
||||
@@ -4,27 +4,6 @@
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.section-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0 0 6px;
|
||||
font-size: 22px;
|
||||
line-height: 1.2;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.section-heading p {
|
||||
margin: 0;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.publication-filter-stack {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
@@ -54,6 +33,10 @@ h2 {
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
.publication-filters .sort-field {
|
||||
width: 235px;
|
||||
}
|
||||
|
||||
.publication-filters .reset-filter-btn {
|
||||
min-width: 132px;
|
||||
height: 42px;
|
||||
@@ -161,27 +144,18 @@ h2 {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.filter-chip,
|
||||
.filter-meta-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 2px 8px;
|
||||
border: 1px solid var(--sg-border-strong);
|
||||
border-radius: 4px;
|
||||
background: var(--sg-surface-soft);
|
||||
color: var(--sg-text);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.filter-chip {
|
||||
gap: 4px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.filter-meta-chip {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.filter-topic-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -301,6 +275,29 @@ h2 {
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.filter-institution-chip .institution-open-icon,
|
||||
.publication-institution-tag .institution-open-icon {
|
||||
flex-shrink: 0;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-left: 5px;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.filter-institution-chip:hover .institution-open-icon,
|
||||
.publication-institution-tag:hover .institution-open-icon {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.filter-institution-chip .institution-open-icon:hover,
|
||||
.publication-institution-tag .institution-open-icon:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.filter-meta-chip__label,
|
||||
.filter-topic-chip__label {
|
||||
overflow: hidden;
|
||||
@@ -309,7 +306,6 @@ h2 {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.filter-chip button,
|
||||
.active-institution-filter button,
|
||||
.active-meta-filter button {
|
||||
display: flex;
|
||||
@@ -324,7 +320,6 @@ h2 {
|
||||
}
|
||||
}
|
||||
|
||||
.filter-chip button mat-icon,
|
||||
.active-institution-filter button mat-icon,
|
||||
.active-meta-filter button mat-icon {
|
||||
width: 12px;
|
||||
@@ -361,12 +356,6 @@ a.title:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.authors {
|
||||
margin-top: 7px;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
table.is-hidden {
|
||||
display: none;
|
||||
}
|
||||
@@ -508,13 +497,8 @@ table.is-hidden {
|
||||
.mat-column-type,
|
||||
.mat-column-year,
|
||||
.mat-column-language,
|
||||
.mat-column-citations {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mat-mdc-header-cell.mat-column-title,
|
||||
.mat-mdc-header-cell.mat-column-institutions,
|
||||
.mat-mdc-header-cell.mat-column-topics {
|
||||
.mat-column-citations,
|
||||
.mat-mdc-header-cell {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -549,7 +533,6 @@ mat-paginator {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.section-heading,
|
||||
.table-footer {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -113,6 +113,8 @@ interface TopicAutocompleteResponse {
|
||||
results?: TopicAutocompleteOption[] | null;
|
||||
}
|
||||
|
||||
type PublicationSort = 'year' | 'citations';
|
||||
|
||||
interface PublicationFilterQueryState {
|
||||
pageIndex: number;
|
||||
pageSize: number;
|
||||
@@ -121,6 +123,7 @@ interface PublicationFilterQueryState {
|
||||
languages: string[];
|
||||
institutions: InstitutionAutocompleteOption[];
|
||||
topics: TopicAutocompleteOption[];
|
||||
sort: PublicationSort;
|
||||
}
|
||||
|
||||
interface YearlyPurposeCounts {
|
||||
@@ -237,6 +240,14 @@ export class PersonPublicationsComponent implements OnInit {
|
||||
readonly yearSearchControl = new FormControl('', { nonNullable: true });
|
||||
readonly typeSearchControl = new FormControl('', { nonNullable: true });
|
||||
readonly languageSearchControl = new FormControl('', { nonNullable: true });
|
||||
readonly sortControl = new FormControl<PublicationSort>('year', {
|
||||
nonNullable: true,
|
||||
});
|
||||
|
||||
readonly sortOptions: { value: PublicationSort; label: string }[] = [
|
||||
{ value: 'year', label: 'Neueste zuerst' },
|
||||
{ value: 'citations', label: 'Meistzitiert zuerst' },
|
||||
];
|
||||
|
||||
readonly filterForm = new FormGroup({
|
||||
publicationYears: new FormControl<number[]>([], { nonNullable: true }),
|
||||
@@ -258,6 +269,7 @@ export class PersonPublicationsComponent implements OnInit {
|
||||
topicNames: 'publicationTopicName',
|
||||
topicFields: 'publicationTopicField',
|
||||
topicDomains: 'publicationTopicDomain',
|
||||
sort: 'publicationSort',
|
||||
} as const;
|
||||
|
||||
readonly typeOptions = [
|
||||
@@ -466,6 +478,7 @@ export class PersonPublicationsComponent implements OnInit {
|
||||
this.filters().languages,
|
||||
this.selectedInstitutionIds(),
|
||||
this.selectedTopicIds(),
|
||||
this.sortControl.value,
|
||||
)
|
||||
.subscribe({
|
||||
next: (page) => {
|
||||
@@ -502,6 +515,10 @@ export class PersonPublicationsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
onSortChange(): void {
|
||||
this.applyFilters();
|
||||
}
|
||||
|
||||
clearFilters(): void {
|
||||
this.filterForm.reset({
|
||||
publicationYears: [],
|
||||
@@ -716,6 +733,19 @@ export class PersonPublicationsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
openInstitutionPage(
|
||||
institutionId: string | null | undefined,
|
||||
event: Event,
|
||||
): void {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
const id = institutionId?.split('/').pop();
|
||||
if (!id) return;
|
||||
|
||||
void this.router.navigate(['/institution', id]);
|
||||
}
|
||||
|
||||
getSelectedTopicTooltip(topic: TopicAutocompleteOption): string {
|
||||
const workTopic = this.findPublicationTopic(topic.id);
|
||||
|
||||
@@ -1028,6 +1058,8 @@ export class PersonPublicationsComponent implements OnInit {
|
||||
)
|
||||
? topicDomains
|
||||
: null,
|
||||
[this.queryParamKeys.sort]:
|
||||
this.sortControl.value !== 'year' ? this.sortControl.value : null,
|
||||
...overrides,
|
||||
},
|
||||
queryParamsHandling: 'merge',
|
||||
@@ -1077,6 +1109,10 @@ export class PersonPublicationsComponent implements OnInit {
|
||||
field_name: topicFields[index] || undefined,
|
||||
domain_name: topicDomains[index] || undefined,
|
||||
})),
|
||||
sort:
|
||||
queryParams.get(this.queryParamKeys.sort) === 'citations'
|
||||
? 'citations'
|
||||
: 'year',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1087,6 +1123,7 @@ export class PersonPublicationsComponent implements OnInit {
|
||||
this.paginationService.selection = queryState.pageSize;
|
||||
this.selectedInstitutions = queryState.institutions;
|
||||
this.selectedTopics = queryState.topics;
|
||||
this.sortControl.setValue(queryState.sort, { emitEvent: false });
|
||||
this.filterForm.setValue(
|
||||
{
|
||||
publicationYears: queryState.publicationYears,
|
||||
|
||||
@@ -31,12 +31,14 @@
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
@if (worksCount() !== null || citedByCount() !== null) {
|
||||
@if (
|
||||
worksCount() !== null || citedByCount() !== null || h_index() !== null
|
||||
) {
|
||||
<span class="stats-line">
|
||||
@if (worksCount() !== null) {
|
||||
<span class="stat-item">
|
||||
<mat-icon class="stat-icon">menu_book</mat-icon>
|
||||
{{ worksCount() }} Publikationen
|
||||
{{ worksCount() | number }} Publikationen
|
||||
</span>
|
||||
}
|
||||
@if (worksCount() !== null && citedByCount() !== null) {
|
||||
@@ -45,50 +47,66 @@
|
||||
@if (citedByCount() !== null) {
|
||||
<span class="stat-item">
|
||||
<mat-icon class="stat-icon">format_quote</mat-icon>
|
||||
{{ citedByCount() }} Zitationen
|
||||
{{ citedByCount() | number }} Zitationen
|
||||
</span>
|
||||
}
|
||||
@if (
|
||||
(worksCount() !== null || citedByCount() !== null) &&
|
||||
h_index() !== null
|
||||
) {
|
||||
·
|
||||
}
|
||||
@if (h_index() !== null) {
|
||||
<span
|
||||
class="stat-item has-tooltip"
|
||||
[matTooltip]="
|
||||
'Der h-Index beträgt ' +
|
||||
h_index() +
|
||||
': ' +
|
||||
h_index() +
|
||||
' Publikationen wurden jeweils mindestens ' +
|
||||
h_index() +
|
||||
'-mal zitiert.'
|
||||
"
|
||||
matTooltipPosition="right"
|
||||
[matTooltipShowDelay]="250">
|
||||
<mat-icon class="stat-icon">trending_up</mat-icon>
|
||||
h-Index {{ h_index() }}
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
<span>
|
||||
@if (h_index() !== null) {
|
||||
h_index: {{ h_index() }}
|
||||
}
|
||||
@if (displayCareerStage() || orcid()) {
|
||||
<div class="meta-line">
|
||||
@if (displayCareerStage()) {
|
||||
<div class="career-stage-line">
|
||||
<span class="career-stage-label">Career Stage:</span>
|
||||
<span
|
||||
class="career-stage-chip"
|
||||
[matTooltip]="careerStageTooltip()"
|
||||
matTooltipPosition="right"
|
||||
matTooltipClass="career-stage-tooltip"
|
||||
[matTooltipShowDelay]="250">
|
||||
{{ displayCareerStage() }}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
@if (orcid(); as orcidId) {
|
||||
<a
|
||||
class="orcid-chip"
|
||||
[href]="orcidUrl()"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
matTooltip="ORCID-Profil öffnen"
|
||||
matTooltipPosition="right"
|
||||
[matTooltipShowDelay]="250">
|
||||
<mat-icon>verified</mat-icon>
|
||||
{{ orcidId }}
|
||||
</a>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
@if (displayCareerStage()) {
|
||||
<div class="career-stage-line">
|
||||
<span class="career-stage-label">Career Stage:</span>
|
||||
<span
|
||||
class="career-stage-chip"
|
||||
[matTooltip]="careerStageTooltip()"
|
||||
matTooltipPosition="right"
|
||||
matTooltipClass="career-stage-tooltip"
|
||||
[matTooltipShowDelay]="250">
|
||||
{{ displayCareerStage() }}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="profile-contact">
|
||||
<div>
|
||||
<mat-icon>mail</mat-icon>
|
||||
<span>uni-email@uni-due.de</span>
|
||||
</div>
|
||||
@if (orcid()) {
|
||||
<div>
|
||||
<mat-icon class="orcid">verified</mat-icon>
|
||||
<a [href]="orcidUrl()" target="_blank" rel="noopener">{{
|
||||
orcid()
|
||||
}}</a>
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
<mat-icon>language</mat-icon>
|
||||
<a href="https://ude.de/anna-becker" target="_blank" rel="noopener">
|
||||
ude.de/anna-becker
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="sidebar">
|
||||
<div class="bio-card">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
.profile-card {
|
||||
grid-area: profile;
|
||||
display: grid;
|
||||
grid-template-columns: 112px minmax(240px, 1fr) minmax(260px, 360px);
|
||||
grid-template-columns: 112px minmax(240px, 1fr);
|
||||
gap: 36px;
|
||||
align-items: center;
|
||||
}
|
||||
@@ -62,8 +62,11 @@
|
||||
}
|
||||
|
||||
.name-line span {
|
||||
color: var(--sg-text);
|
||||
font-size: 14px;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.name-line h1 {
|
||||
@@ -140,6 +143,18 @@
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.stat-item.has-tooltip {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.meta-line {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px 18px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.career-stage-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -167,34 +182,32 @@
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.profile-contact {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
.orcid-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-height: 24px;
|
||||
padding: 2px 10px;
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: 999px;
|
||||
background: var(--sg-surface-muted);
|
||||
color: var(--sg-text);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.profile-contact div {
|
||||
display: grid;
|
||||
grid-template-columns: 24px 1fr;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.profile-contact mat-icon {
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 20px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.profile-contact .orcid {
|
||||
color: #6cc24a;
|
||||
}
|
||||
|
||||
.profile-contact a {
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
text-decoration: none;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
|
||||
.orcid-chip:hover {
|
||||
border-color: #6cc24a;
|
||||
}
|
||||
|
||||
.orcid-chip mat-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
color: #6cc24a;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
@@ -277,16 +290,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
@container (max-width: 780px) {
|
||||
.profile-card {
|
||||
grid-template-columns: 112px 1fr;
|
||||
}
|
||||
|
||||
.profile-contact {
|
||||
grid-column: 2;
|
||||
}
|
||||
}
|
||||
|
||||
@container (max-width: 720px) {
|
||||
.person-hero {
|
||||
padding: 24px 16px;
|
||||
@@ -297,10 +300,6 @@
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.profile-contact {
|
||||
grid-column: auto;
|
||||
}
|
||||
|
||||
.person-tabs {
|
||||
padding: 0 16px;
|
||||
overflow-x: auto;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
import { Component, computed, inject, signal, DestroyRef } from '@angular/core';
|
||||
import {
|
||||
toSignal,
|
||||
@@ -27,6 +28,7 @@ import { PersonBioResolved } from '../../resolvers/person-bio.resolver';
|
||||
@Component({
|
||||
selector: 'app-person',
|
||||
imports: [
|
||||
DecimalPipe,
|
||||
MatIconModule,
|
||||
MatTabsModule,
|
||||
MatTooltipModule,
|
||||
|
||||
@@ -117,55 +117,99 @@
|
||||
</section>
|
||||
}
|
||||
|
||||
<section class="card">
|
||||
<div class="section-title">
|
||||
<section class="card accordion-card">
|
||||
<button
|
||||
type="button"
|
||||
class="accordion-header"
|
||||
(click)="authorsExpanded = !authorsExpanded"
|
||||
[attr.aria-expanded]="authorsExpanded">
|
||||
<mat-icon>group</mat-icon>
|
||||
<h2>Autorinnen und Autoren</h2>
|
||||
<span>{{ authors().length }}</span>
|
||||
</div>
|
||||
<div class="author-list">
|
||||
@for (authorship of authors(); track authorship.author?.id) {
|
||||
<article>
|
||||
<div class="avatar">
|
||||
{{
|
||||
(
|
||||
authorship.author?.display_name ||
|
||||
authorship.raw_author_name ||
|
||||
'?'
|
||||
).charAt(0)
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
@if (authorship.author?.id; as authorId) {
|
||||
<a
|
||||
[routerLink]="[
|
||||
'/person',
|
||||
authorId.split('/').pop(),
|
||||
'overview',
|
||||
]">
|
||||
{{
|
||||
authorship.author?.display_name ||
|
||||
authorship.raw_author_name ||
|
||||
'Unbekannt'
|
||||
}}
|
||||
</a>
|
||||
} @else {
|
||||
<strong>{{
|
||||
authorship.raw_author_name || 'Unbekannt'
|
||||
}}</strong>
|
||||
}
|
||||
<p>
|
||||
{{ authorship.author_position || 'Mitautor/in' }}
|
||||
@if (authorship.is_corresponding) {
|
||||
· Korrespondenz
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
} @empty {
|
||||
<p class="empty">Keine Angaben vorhanden.</p>
|
||||
<span class="accordion-title">Autorinnen und Autoren</span>
|
||||
<mat-icon
|
||||
class="info-icon"
|
||||
matTooltip="Autorinnen und Autoren dieser Publikation. Klicke auf eine Person, um zu ihrem Profil zu gelangen."
|
||||
matTooltipPosition="above"
|
||||
(click)="$event.stopPropagation()"
|
||||
>info_outline</mat-icon
|
||||
>
|
||||
@if (authors().length) {
|
||||
<span class="count-badge">{{ authors().length }}</span>
|
||||
}
|
||||
</div>
|
||||
<mat-icon class="chevron" [class.rotated]="!authorsExpanded"
|
||||
>expand_more</mat-icon
|
||||
>
|
||||
</button>
|
||||
@if (authorsExpanded) {
|
||||
<div class="accordion-body">
|
||||
<div class="author-list">
|
||||
@for (
|
||||
authorship of pagedAuthors();
|
||||
track authorship.author?.id
|
||||
) {
|
||||
<article>
|
||||
<div class="avatar">
|
||||
{{
|
||||
(
|
||||
authorship.author?.display_name ||
|
||||
authorship.raw_author_name ||
|
||||
'?'
|
||||
).charAt(0)
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
@if (authorship.author?.id; as authorId) {
|
||||
<a
|
||||
[routerLink]="[
|
||||
'/person',
|
||||
authorId.split('/').pop(),
|
||||
'overview',
|
||||
]">
|
||||
{{
|
||||
authorship.author?.display_name ||
|
||||
authorship.raw_author_name ||
|
||||
'Unbekannt'
|
||||
}}
|
||||
</a>
|
||||
} @else {
|
||||
<strong>{{
|
||||
authorship.raw_author_name || 'Unbekannt'
|
||||
}}</strong>
|
||||
}
|
||||
<p>
|
||||
{{ authorship.author_position || 'Mitautor/in' }}
|
||||
@if (authorship.is_corresponding) {
|
||||
· Korrespondenz
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
} @empty {
|
||||
<p class="empty">Keine Angaben vorhanden.</p>
|
||||
}
|
||||
</div>
|
||||
@if (authorsPageCount() > 1) {
|
||||
<div class="list-pagination">
|
||||
<button
|
||||
type="button"
|
||||
class="page-btn"
|
||||
[disabled]="authorsPage === 0"
|
||||
(click)="authorsPage = authorsPage - 1">
|
||||
<mat-icon>chevron_left</mat-icon>
|
||||
</button>
|
||||
<span class="page-indicator"
|
||||
>{{ authorsPage + 1 }} / {{ authorsPageCount() }}</span
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="page-btn"
|
||||
[disabled]="authorsPage === authorsPageCount() - 1"
|
||||
(click)="authorsPage = authorsPage + 1">
|
||||
<mat-icon>chevron_right</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
|
||||
@if (publication.topics?.length) {
|
||||
@@ -182,7 +226,8 @@
|
||||
[subfieldName]="topic.subfield?.display_name"
|
||||
[fieldName]="topic.field?.display_name"
|
||||
[domainName]="topic.domain?.display_name"
|
||||
[color]="getTopicColor(topic)">
|
||||
[color]="getTopicColor(topic)"
|
||||
(chipClick)="findAuthorsForTopic(topic)">
|
||||
</app-topic-chip>
|
||||
}
|
||||
</div>
|
||||
@@ -204,52 +249,71 @@
|
||||
}
|
||||
|
||||
@if (sources().length) {
|
||||
<section class="card">
|
||||
<div class="section-title">
|
||||
<section class="card accordion-card">
|
||||
<button
|
||||
type="button"
|
||||
class="accordion-header"
|
||||
(click)="sourcesExpanded = !sourcesExpanded"
|
||||
[attr.aria-expanded]="sourcesExpanded">
|
||||
<mat-icon>library_books</mat-icon>
|
||||
<h2>Quellen und Versionen</h2>
|
||||
</div>
|
||||
<div class="source-list">
|
||||
@for (
|
||||
location of sources();
|
||||
track location.source?.id || location.landing_page_url
|
||||
) {
|
||||
<article>
|
||||
<div>
|
||||
<strong>{{
|
||||
location.source?.display_name || 'Externe Quelle'
|
||||
}}</strong>
|
||||
<p>
|
||||
{{
|
||||
location.version ||
|
||||
location.source?.type ||
|
||||
'Veröffentlichte Version'
|
||||
}}
|
||||
@if (location.license) {
|
||||
· {{ location.license }}
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
<div class="source-actions">
|
||||
@if (location.is_oa) {
|
||||
<span class="oa-badge">Open Access</span>
|
||||
}
|
||||
@if (
|
||||
location.pdf_url || location.landing_page_url;
|
||||
as sourceUrl
|
||||
) {
|
||||
<a
|
||||
[href]="sourceUrl"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
aria-label="Quelle öffnen">
|
||||
<mat-icon>open_in_new</mat-icon>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
<span class="accordion-title">Quellen und Versionen</span>
|
||||
<mat-icon
|
||||
class="info-icon"
|
||||
matTooltip="Quellen und Versionen, unter denen die Publikation verfügbar ist. Klicke auf das Symbol, um die Quelle zu öffnen."
|
||||
matTooltipPosition="above"
|
||||
(click)="$event.stopPropagation()"
|
||||
>info_outline</mat-icon
|
||||
>
|
||||
<span class="count-badge">{{ sources().length }}</span>
|
||||
<mat-icon class="chevron" [class.rotated]="!sourcesExpanded"
|
||||
>expand_more</mat-icon
|
||||
>
|
||||
</button>
|
||||
@if (sourcesExpanded) {
|
||||
<div class="accordion-body">
|
||||
<div class="source-list">
|
||||
@for (
|
||||
location of sources();
|
||||
track location.source?.id || location.landing_page_url
|
||||
) {
|
||||
<article>
|
||||
<div>
|
||||
<strong>{{
|
||||
location.source?.display_name || 'Externe Quelle'
|
||||
}}</strong>
|
||||
<p>
|
||||
{{
|
||||
location.version ||
|
||||
location.source?.type ||
|
||||
'Veröffentlichte Version'
|
||||
}}
|
||||
@if (location.license) {
|
||||
· {{ location.license }}
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
<div class="source-actions">
|
||||
@if (location.is_oa) {
|
||||
<span class="oa-badge">Open Access</span>
|
||||
}
|
||||
@if (
|
||||
location.pdf_url || location.landing_page_url;
|
||||
as sourceUrl
|
||||
) {
|
||||
<a
|
||||
[href]="sourceUrl"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
aria-label="Quelle öffnen">
|
||||
<mat-icon>open_in_new</mat-icon>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
</main>
|
||||
@@ -299,83 +363,169 @@
|
||||
</section>
|
||||
|
||||
@if (institutions().length) {
|
||||
<section class="card">
|
||||
<div class="section-title">
|
||||
<section class="card accordion-card">
|
||||
<button
|
||||
type="button"
|
||||
class="accordion-header"
|
||||
(click)="institutionsExpanded = !institutionsExpanded"
|
||||
[attr.aria-expanded]="institutionsExpanded">
|
||||
<mat-icon>account_balance</mat-icon>
|
||||
<h2>Institutionen</h2>
|
||||
</div>
|
||||
<div class="compact-list">
|
||||
@for (institution of institutions(); track institution.id) {
|
||||
<div>
|
||||
<a
|
||||
class="institution-link"
|
||||
[routerLink]="[
|
||||
'/institution',
|
||||
institution.id.split('/').pop() ?? '',
|
||||
]">
|
||||
{{ institution.name }}
|
||||
</a>
|
||||
@if (institution.country) {
|
||||
<span class="institution-country">
|
||||
<img
|
||||
alt=""
|
||||
class="flag-img"
|
||||
[src]="
|
||||
'https://flagcdn.io/' +
|
||||
institution.country.toLowerCase() +
|
||||
'.svg'
|
||||
"
|
||||
height="14" />
|
||||
{{ institution.country.toUpperCase() }}
|
||||
</span>
|
||||
} @else if (institution.type) {
|
||||
<span>{{ institution.type }}</span>
|
||||
<span class="accordion-title">Institutionen</span>
|
||||
<mat-icon
|
||||
class="info-icon"
|
||||
matTooltip="Institutionen, denen die Autorinnen und Autoren angehören. Klicke auf eine Institution, um zu ihrer Seite zu gelangen."
|
||||
matTooltipPosition="above"
|
||||
(click)="$event.stopPropagation()"
|
||||
>info_outline</mat-icon
|
||||
>
|
||||
<span class="count-badge">{{ institutions().length }}</span>
|
||||
<mat-icon class="chevron" [class.rotated]="!institutionsExpanded"
|
||||
>expand_more</mat-icon
|
||||
>
|
||||
</button>
|
||||
@if (institutionsExpanded) {
|
||||
<div class="accordion-body">
|
||||
<div class="compact-list">
|
||||
@for (
|
||||
institution of pagedInstitutions();
|
||||
track institution.id
|
||||
) {
|
||||
<div>
|
||||
<a
|
||||
class="institution-link"
|
||||
[routerLink]="[
|
||||
'/institution',
|
||||
institution.id.split('/').pop() ?? '',
|
||||
]">
|
||||
{{ institution.name }}
|
||||
</a>
|
||||
@if (institution.country) {
|
||||
<span class="institution-country">
|
||||
<img
|
||||
alt=""
|
||||
class="flag-img"
|
||||
[src]="
|
||||
'https://flagcdn.io/' +
|
||||
institution.country.toLowerCase() +
|
||||
'.svg'
|
||||
"
|
||||
height="14" />
|
||||
{{ institution.country.toUpperCase() }}
|
||||
</span>
|
||||
} @else if (institution.type) {
|
||||
<span>{{ institution.type }}</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@if (institutionsPageCount() > 1) {
|
||||
<div class="list-pagination">
|
||||
<button
|
||||
type="button"
|
||||
class="page-btn"
|
||||
[disabled]="institutionsPage === 0"
|
||||
(click)="institutionsPage = institutionsPage - 1">
|
||||
<mat-icon>chevron_left</mat-icon>
|
||||
</button>
|
||||
<span class="page-indicator"
|
||||
>{{ institutionsPage + 1 }} /
|
||||
{{ institutionsPageCount() }}</span
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="page-btn"
|
||||
[disabled]="
|
||||
institutionsPage === institutionsPageCount() - 1
|
||||
"
|
||||
(click)="institutionsPage = institutionsPage + 1">
|
||||
<mat-icon>chevron_right</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (publication.funders?.length || publication.awards?.length) {
|
||||
<section class="card">
|
||||
<div class="section-title">
|
||||
<section class="card accordion-card">
|
||||
<button
|
||||
type="button"
|
||||
class="accordion-header"
|
||||
(click)="fundingExpanded = !fundingExpanded"
|
||||
[attr.aria-expanded]="fundingExpanded">
|
||||
<mat-icon>paid</mat-icon>
|
||||
<h2>Förderungen</h2>
|
||||
</div>
|
||||
<div class="compact-list">
|
||||
@for (funder of publication.funders ?? []; track funder.id) {
|
||||
<div>
|
||||
<strong>{{ funder.display_name }}</strong
|
||||
><span>Förderorganisation</span>
|
||||
<span class="accordion-title">Förderungen</span>
|
||||
<mat-icon
|
||||
class="info-icon"
|
||||
matTooltip="Förderorganisationen und Förderungen, die zu dieser Publikation beigetragen haben."
|
||||
matTooltipPosition="above"
|
||||
(click)="$event.stopPropagation()"
|
||||
>info_outline</mat-icon
|
||||
>
|
||||
<span class="count-badge">{{ fundingCount() }}</span>
|
||||
<mat-icon class="chevron" [class.rotated]="!fundingExpanded"
|
||||
>expand_more</mat-icon
|
||||
>
|
||||
</button>
|
||||
@if (fundingExpanded) {
|
||||
<div class="accordion-body">
|
||||
<div class="compact-list">
|
||||
@for (funder of publication.funders ?? []; track funder.id) {
|
||||
<div>
|
||||
<strong>{{ funder.display_name }}</strong
|
||||
><span>Förderorganisation</span>
|
||||
</div>
|
||||
}
|
||||
@for (award of publication.awards ?? []; track award.id) {
|
||||
<div>
|
||||
<strong>{{
|
||||
award.display_name || award.funder_award_id
|
||||
}}</strong
|
||||
><span>{{
|
||||
award.funder_display_name || 'Förderung'
|
||||
}}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@for (award of publication.awards ?? []; track award.id) {
|
||||
<div>
|
||||
<strong>{{
|
||||
award.display_name || award.funder_award_id
|
||||
}}</strong
|
||||
><span>{{ award.funder_display_name || 'Förderung' }}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (externalLinks().length) {
|
||||
<section class="card">
|
||||
<div class="section-title">
|
||||
<section class="card accordion-card">
|
||||
<button
|
||||
type="button"
|
||||
class="accordion-header"
|
||||
(click)="linksExpanded = !linksExpanded"
|
||||
[attr.aria-expanded]="linksExpanded">
|
||||
<mat-icon>link</mat-icon>
|
||||
<h2>Externe Links</h2>
|
||||
</div>
|
||||
<div class="link-list">
|
||||
@for (link of externalLinks(); track link.url) {
|
||||
<a [href]="link.url" target="_blank" rel="noopener">
|
||||
<span>{{ link.label }}</span>
|
||||
<mat-icon>north_east</mat-icon>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
<span class="accordion-title">Externe Links</span>
|
||||
<mat-icon
|
||||
class="info-icon"
|
||||
matTooltip="Externe Links zur Publikation, z. B. DOI oder Open-Access-Version. Klicke auf einen Link, um ihn in einem neuen Tab zu öffnen."
|
||||
matTooltipPosition="above"
|
||||
(click)="$event.stopPropagation()"
|
||||
>info_outline</mat-icon
|
||||
>
|
||||
<span class="count-badge">{{ externalLinks().length }}</span>
|
||||
<mat-icon class="chevron" [class.rotated]="!linksExpanded"
|
||||
>expand_more</mat-icon
|
||||
>
|
||||
</button>
|
||||
@if (linksExpanded) {
|
||||
<div class="accordion-body">
|
||||
<div class="link-list">
|
||||
@for (link of externalLinks(); track link.url) {
|
||||
<a [href]="link.url" target="_blank" rel="noopener">
|
||||
<span>{{ link.label }}</span>
|
||||
<mat-icon>north_east</mat-icon>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
</aside>
|
||||
|
||||
@@ -188,6 +188,79 @@ aside {
|
||||
box-shadow: var(--sg-shadow-sm);
|
||||
}
|
||||
|
||||
.accordion-card {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.accordion-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
padding: 18px 22px;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
font-family: inherit;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: var(--sg-text);
|
||||
transition: background 0.12s;
|
||||
|
||||
&:hover {
|
||||
background: #f6f9ff;
|
||||
}
|
||||
|
||||
mat-icon {
|
||||
flex-shrink: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 20px;
|
||||
color: var(--sg-text-muted);
|
||||
}
|
||||
}
|
||||
|
||||
.accordion-title {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.count-badge {
|
||||
padding: 2px 7px;
|
||||
border-radius: 999px;
|
||||
background: #e8effe;
|
||||
color: #3b5bd6;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.info-icon {
|
||||
flex-shrink: 0;
|
||||
width: 16px !important;
|
||||
height: 16px !important;
|
||||
font-size: 16px !important;
|
||||
color: var(--sg-text-muted);
|
||||
opacity: 0.7;
|
||||
cursor: default;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.chevron {
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&.rotated {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
|
||||
.accordion-body {
|
||||
padding: 4px 22px 22px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -371,6 +444,50 @@ dd {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.list-pagination {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.page-btn {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: 8px;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
color: var(--sg-text-muted);
|
||||
transition: background 0.12s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: var(--sg-surface-muted);
|
||||
color: var(--sg-text);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.35;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
mat-icon {
|
||||
font-size: 18px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.page-indicator {
|
||||
font-size: 12px;
|
||||
color: var(--sg-text-muted);
|
||||
min-width: 36px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.institution-country {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -445,6 +562,18 @@ dd {
|
||||
padding: 22px 20px;
|
||||
}
|
||||
|
||||
.accordion-card {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.accordion-header {
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
.accordion-body {
|
||||
padding: 4px 20px 20px;
|
||||
}
|
||||
|
||||
.metrics,
|
||||
.author-list {
|
||||
grid-template-columns: 1fr;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { DatePipe, DecimalPipe, UpperCasePipe } from '@angular/common';
|
||||
import { Location } from '@angular/common';
|
||||
import { DatePipe, DecimalPipe, Location } from '@angular/common';
|
||||
|
||||
import { Component, DestroyRef, OnInit, inject } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { finalize } from 'rxjs';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||
import {
|
||||
Authorship,
|
||||
Location as ApiLocation,
|
||||
@@ -40,11 +40,11 @@ interface InstitutionDetail {
|
||||
MatButtonModule,
|
||||
MatIconModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatTooltipModule,
|
||||
RouterLink,
|
||||
TopicChipComponent,
|
||||
UpperCasePipe,
|
||||
WorkTypePipe,
|
||||
LanguageCodePipe
|
||||
LanguageCodePipe,
|
||||
],
|
||||
templateUrl: './publication-detail.component.html',
|
||||
styleUrl: './publication-detail.component.scss',
|
||||
@@ -54,18 +54,33 @@ export class PublicationDetailComponent implements OnInit {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly httpClient = inject(HttpClient);
|
||||
private readonly location = inject(Location);
|
||||
private readonly router = inject(Router);
|
||||
private readonly worksService = inject(WorksService);
|
||||
|
||||
publication: Work | null = null;
|
||||
loading = true;
|
||||
notFound = false;
|
||||
|
||||
authorsExpanded = true;
|
||||
institutionsExpanded = false;
|
||||
sourcesExpanded = false;
|
||||
fundingExpanded = false;
|
||||
linksExpanded = false;
|
||||
|
||||
authorsPage = 0;
|
||||
readonly authorsPageSize = 10;
|
||||
|
||||
institutionsPage = 0;
|
||||
readonly institutionsPageSize = 5;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loading = true;
|
||||
|
||||
this.route.data.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
|
||||
next: ({ publication }) => {
|
||||
this.publication = publication;
|
||||
this.authorsPage = 0;
|
||||
this.institutionsPage = 0;
|
||||
this.loading = false;
|
||||
},
|
||||
error: () => {
|
||||
@@ -79,6 +94,17 @@ export class PublicationDetailComponent implements OnInit {
|
||||
this.location.back();
|
||||
}
|
||||
|
||||
findAuthorsForTopic(topic: WorkTopic): void {
|
||||
const topicName = topic.display_name?.trim();
|
||||
if (!topicName) return;
|
||||
|
||||
// Deep link into the person search with this topic preset as filter,
|
||||
// so matching authors show up directly.
|
||||
void this.router.navigate(['/persons'], {
|
||||
queryParams: { topic: topicName },
|
||||
});
|
||||
}
|
||||
|
||||
getTopicColor(topic: WorkTopic): string {
|
||||
return topicHierarchyColor({
|
||||
id: topic.id,
|
||||
@@ -114,6 +140,28 @@ export class PublicationDetailComponent implements OnInit {
|
||||
return this.publication?.authorships ?? [];
|
||||
}
|
||||
|
||||
pagedAuthors(): Authorship[] {
|
||||
return this.authors().slice(
|
||||
this.authorsPage * this.authorsPageSize,
|
||||
(this.authorsPage + 1) * this.authorsPageSize,
|
||||
);
|
||||
}
|
||||
|
||||
authorsPageCount(): number {
|
||||
return Math.ceil(this.authors().length / this.authorsPageSize);
|
||||
}
|
||||
|
||||
pagedInstitutions(): InstitutionDetail[] {
|
||||
return this.institutions().slice(
|
||||
this.institutionsPage * this.institutionsPageSize,
|
||||
(this.institutionsPage + 1) * this.institutionsPageSize,
|
||||
);
|
||||
}
|
||||
|
||||
institutionsPageCount(): number {
|
||||
return Math.ceil(this.institutions().length / this.institutionsPageSize);
|
||||
}
|
||||
|
||||
institutions(): InstitutionDetail[] {
|
||||
const institutions = new Map<string, InstitutionDetail>();
|
||||
for (const authorship of this.authors()) {
|
||||
@@ -159,6 +207,13 @@ export class PublicationDetailComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
fundingCount(): number {
|
||||
return (
|
||||
(this.publication?.funders?.length ?? 0) +
|
||||
(this.publication?.awards?.length ?? 0)
|
||||
);
|
||||
}
|
||||
|
||||
pages(): string | null {
|
||||
const first = this.publication?.biblio?.first_page;
|
||||
const last = this.publication?.biblio?.last_page;
|
||||
|
||||
Reference in New Issue
Block a user