Files
smartguide/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html
T

262 lines
8.9 KiB
HTML

<app-data-table
[columns]="columns"
[data]="elements()"
[detailTemplate]="expandedProject"
[queryParamSortKey]="queryParamKeys.sortBy"
[queryParamSortDirectionKey]="queryParamKeys.sortDirection" />
<app-query-param-paginator
[total]="total()"
queryParamPageKey="page"
queryParamSizeKey="size"
[pageSizeOptions]="[10, 25, 50]" />
<ng-template #titleTmp let-element>
<span class="panel-field__text">{{ element.title_de }}</span>
</ng-template>
<ng-template #fundingEndTmp let-element>
<span>
{{
element.funding_end == '2999' || element.funding_end == null
? 'laufend'
: element.funding_end
}}</span
>
</ng-template>
<ng-template #actionsTmp let-element>
<a
[routerLink]="['/projects/dfg', element.id]"
target="_blank"
mat-icon-button
color="primary">
<mat-icon>open_in_new</mat-icon>
</a>
</ng-template>
<ng-template #detailRowTmp let-project>
@let classifications = getProjectClassifications(project);
@let isClassificationsExpanded = isProjectClassificationsExpanded(project);
@let visibleClassifications =
isClassificationsExpanded ? classifications : classifications.slice(0, 3);
<div
class="classification-tags"
aria-label="Fachsystematik"
style="padding: 0.5rem 0.5rem">
@for (classification of visibleClassifications; track $index) {
<span
class="publication-institution-tag classification-tag"
[matTooltip]="getClassificationTooltipText(classification)"
matTooltipPosition="above">
<mat-icon class="institution-icon">category</mat-icon>
<span class="institution-name">
{{ getClassificationFullChain(classification) }}</span
>
</span>
} @empty {
<span class="empty-text">-</span>
}
@if (classifications.length > 3) {
<app-chip-overflow-toggle
[expanded]="isClassificationsExpanded"
[hiddenCount]="classifications.length - 3"
(toggle)="toggleProjectClassificationsExpansion(project)" />
}
</div>
</ng-template>
<ng-template #expandedProject let-project>
<section class="project-panel" aria-label="Weitere Projektdetails">
<header class="project-panel__header">
<div class="language-toggle" role="group" aria-label="Sprache wählen">
<button
[disabled]="!hasDePanelContent(project)"
type="button"
class="language-toggle__button"
[class.active]="getPanelLanguage(project) === 'de'"
(click)="setPanelLanguage(project, 'de')">
DE
</button>
<button
[disabled]="!hasEnPanelContent(project)"
type="button"
class="language-toggle__button"
[class.active]="getPanelLanguage(project) === 'en'"
(click)="setPanelLanguage(project, 'en')">
EN
</button>
</div>
</header>
<mat-divider />
<div class="project-panel__content">
@if (getPanelLanguage(project) === 'de') {
@if (project.highlight?.title_de.length > 0) {
<article class="panel-field panel-field--full">
<h4 class="panel-field__label">Titel</h4>
<app-highlighted-text
class="panel-field__text"
[content]="project.title_de"
[highlights]="
getHighlightTerms(
extractHighlightTerms(project.highlight?.title_de)
)
" />
</article>
}
@if (project.highlight?.abstract_de.length > 0) {
<article class="panel-field panel-field--full">
<h4 class="panel-field__label">Zusammenfassung</h4>
<app-highlighted-text
class="panel-field__text"
[content]="project.abstract_de"
[highlights]="
getHighlightTerms(
extractHighlightTerms(project.highlight?.abstract_de)
)
" />
</article>
}
} @else {
@if (project.highlight?.title_en.length > 0) {
<article class="panel-field panel-field--full">
<h4 class="panel-field__label">Title</h4>
<app-highlighted-text
class="panel-field__text"
[content]="project.title_en"
[highlights]="
getHighlightTerms(
extractHighlightTerms(project.highlight?.title_en)
)
" />
</article>
}
@if (project.highlight?.abstract_en.length > 0) {
<article class="panel-field panel-field--full">
<h4 class="panel-field__label">Abstract</h4>
<app-highlighted-text
class="panel-field__text"
[content]="project.abstract_en"
[highlights]="
getHighlightTerms(
extractHighlightTerms(project.highlight?.abstract_en)
)
" />
</article>
}
}
@if (project.highlight.subject_classifications?.length > 0) {
<article class="panel-field panel-field--full">
<h4 class="panel-field__label">Fachsystematik</h4>
@for (
classification of getProjectClassifications(project);
track $index
) {
<app-highlighted-text
class="panel-field__text"
[content]="getClassificationFullChain(classification)"
[highlights]="
getHighlightTerms(
getClassificationHighlightTerms(project, $index)
)
" />
} @empty {
<span class="empty-text">-</span>
}
</article>
}
</div>
</section>
</ng-template>
<ng-template #authorsTmp let-project>
@let projectAuthors = getProjectAuthors(project);
@let isProjectAuthorsExpanded = isProjectPersonsExpanded(project);
@let visibleAuthors =
isProjectAuthorsExpanded ? projectAuthors : projectAuthors.slice(0, 3);
<div class="author-tags" aria-label="Autoren" style="padding: 0.5rem 0">
@for (author of visibleAuthors; track author.person_id + $index) {
<button
type="button"
class="publication-institution-tag"
[class.active]="isAuthorActive(author.person_id!)"
[matTooltip]="getAuthorTooltipText(author)"
matTooltipPosition="above"
[attr.aria-label]="getAuthorTooltipText(author)"
(click)="filterByAuthor(author.person_id!)">
<mat-icon class="institution-icon">person</mat-icon>
<span class="institution-name">{{ author.full_name }}</span>
</button>
} @empty {
<span class="empty-text">-</span>
}
@if (projectAuthors.length > 3) {
<app-chip-overflow-toggle
[expanded]="isProjectAuthorsExpanded"
[hiddenCount]="projectAuthors.length - 3"
(toggle)="toggleProjectAuthorsExpansion(project)" />
}
</div>
</ng-template>
<ng-template #institutionsTmp let-project>
@let institutions = getProjectInstitutions(project);
<div
class="institution-tags"
aria-label="Institutionen"
style="padding: 0.5rem 0">
@for (
institution of isProjectInstitutionsExpanded(project)
? institutions
: institutions.slice(0, 3);
track getProjectInstitutionId(institution)
) {
<button
type="button"
class="publication-institution-tag"
[class.active]="isInstitutionActive(institution.id!)"
[matTooltip]="getInstitutionTooltipText(institution)"
matTooltipPosition="above"
[attr.aria-label]="getInstitutionTooltipText(institution)"
(click)="filterByInstitution(institution)">
<mat-icon class="institution-icon">apartment</mat-icon>
<span class="institution-name">{{
institution.institute_name_de || institution.institute_name_en
}}</span>
</button>
} @empty {
<span class="empty-text">-</span>
}
@if (institutions.length > 3) {
<app-chip-overflow-toggle
[expanded]="isProjectInstitutionsExpanded(project)"
[hiddenCount]="institutions.length - 3"
(toggle)="toggleProjectInstitutionsExpansion(project)" />
}
</div>
</ng-template>
<ng-template #topicsTmp let-project>
@let projectTopics = getProjectTopics(project);
@let isTopicsExpanded = isProjectTopicsExpanded(project);
@let visibleTopics =
isTopicsExpanded ? projectTopics : projectTopics.slice(0, 3);
<div class="topic-chips" aria-label="Themen" style="padding: 0.5rem 0">
@for (topic of visibleTopics; track $index) {
<app-topic-chip-2
size="mini"
[topic]="topic"
[showIcon]="false"
[isSelected]="isTopicActive(topic)"
[isClickable]="topicFilterEnabled()"
(handleChipClick)="filterByTopic(topic)" />
} @empty {
<span class="empty-text">-</span>
}
@if (projectTopics.length > 3) {
<app-chip-overflow-toggle
[expanded]="isTopicsExpanded"
[hiddenCount]="projectTopics.length - 3"
(toggle)="toggleProjectTopicsExpansion(project)" />
}
</div>
</ng-template>