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

156 lines
4.8 KiB
HTML

<app-data-table
[columns]="columns()"
[data]="projects()"
[queryParamSortKey]="queryParamKeys.sortBy"
[queryParamSortDirectionKey]="queryParamKeys.sortDirection" />
<app-query-param-paginator
[total]="total()"
queryParamPageKey="page"
queryParamSizeKey="size"
[pageSizeOptions]="[10, 25, 50]" />
<ng-template #projectTypeTmp let-project>
@if (project.project_type) {
<button
type="button"
class="type-filter-btn"
[class.active]="isTypeActive(project.project_type)"
matTooltip="Nach Typ filtern"
matTooltipPosition="above"
(click)="toggleTypeFilter(project.project_type)">
<app-chip [color]="getProjectTypeColor(project.project_type)">
{{ getProjectTypeLabel(project) }}
</app-chip>
</button>
} @else {
<span class="empty-text">-</span>
}
</ng-template>
<ng-template #fundingStartTmp let-element>
{{ getStartDate(element) | date: 'dd.MM.yyyy' }}
</ng-template>
<ng-template #fundingEndTmp let-element>
{{ getEndDate(element) | date: 'dd.MM.yyyy' }}
</ng-template>
<ng-template #fundingAmountTmp let-element>
{{ getFundingAmount(element) | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }}
</ng-template>
<ng-template #authorsTmp let-project>
@let projectAuthors = getProjectAuthors(project);
@let isExpanded = isProjectAuthorsExpanded(project);
@let visibleAuthors =
isExpanded ? projectAuthors : projectAuthors.slice(0, 3);
<div class="author-tags" aria-label="Autoren" style="padding: 0.5rem 0">
@for (author of visibleAuthors; track getAuthorTrackId(author, $index)) {
<app-author-chip
size="mini"
[author]="author"
[showIcon]="true"
[isSelected]="isAuthorActive(author.id!)"
[isClickable]="authorFilterEnabled()"
(handleChipClick)="filterByAuthor($event!)" />
} @empty {
<span class="empty-text">-</span>
}
@if (projectAuthors.length > 3) {
<button
type="button"
class="publication-institution-more"
[attr.aria-expanded]="isExpanded"
(click)="toggleProjectAuthorsExpansion(project)">
{{ isExpanded ? 'weniger' : '+' + (projectAuthors.length - 3) }}
</button>
}
</div>
</ng-template>
<ng-template #organizationsTmp let-project>
@let organizations = getProjectOrganizations(project);
@let isExpanded = isProjectOrganizationsExpanded(project);
@let visibleOrganizations =
isExpanded ? organizations : organizations.slice(0, 3);
<div
class="institution-tags"
aria-label="Organisationen"
style="padding: 0.5rem 0">
@for (
organization of visibleOrganizations;
track getOrganizationId(organization)
) {
<button
type="button"
class="publication-institution-tag"
[class.active]="isOrganizationActive(getOrganizationId(organization))"
[matTooltip]="getOrganizationTooltipText(organization)"
matTooltipPosition="above"
[attr.aria-label]="getOrganizationTooltipText(organization)"
(click)="filterByOrganization(organization)">
<mat-icon class="institution-icon">apartment</mat-icon>
<span class="institution-name">
{{ getOrganizationName(organization) }}
</span>
</button>
} @empty {
<span class="empty-text">-</span>
}
@if (organizations.length > 3) {
<button
type="button"
class="publication-institution-more"
[attr.aria-expanded]="isExpanded"
(click)="toggleProjectOrganizationsExpansion(project)">
{{ isExpanded ? 'weniger' : '+' + (organizations.length - 3) }}
</button>
}
</div>
</ng-template>
<ng-template #topicsTmp let-project>
@let projectTopics = getProjectTopics(project);
@let isExpanded = isProjectTopicsExpanded(project);
@let visibleTopics = isExpanded ? projectTopics : projectTopics.slice(0, 3);
<div class="topic-chips" aria-label="Themen" style="padding: 0.5rem 0">
@for (topic of visibleTopics; track topic.id ?? $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) {
<button
type="button"
class="publication-institution-more"
[attr.aria-expanded]="isExpanded"
(click)="toggleProjectTopicsExpansion(project)">
{{ isExpanded ? 'weniger' : '+' + (projectTopics.length - 3) }}
</button>
}
</div>
</ng-template>
<ng-template #actionsTmp let-element>
<a
[routerLink]="['/projects/eu', element.id]"
target="_blank"
mat-icon-button
color="primary">
<mat-icon>open_in_new</mat-icon>
</a>
</ng-template>