enabled project detail row only for projects where highlighted content is persistent
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<app-data-table
|
||||
[columns]="columns"
|
||||
[data]="elements()"
|
||||
[detailTemplate]="expandedProject"
|
||||
[detailTemplate]="highlightRowEnabled() ? expandedProject : null"
|
||||
[queryParamSortKey]="queryParamKeys.sortBy"
|
||||
[queryParamSortDirectionKey]="queryParamKeys.sortDirection" />
|
||||
|
||||
@@ -108,59 +108,60 @@
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #expandedProject let-project>
|
||||
<section class="project-panel" aria-label="Weitere Projektdetails">
|
||||
<div class="project-panel__content">
|
||||
@if (project.highlight?.topic.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.topic"
|
||||
[highlights]="
|
||||
getHighlightTerms(extractHighlightTerms(project.highlight?.topic))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (project.highlight) {
|
||||
@let highlight = project.highlight;
|
||||
<section class="project-panel" aria-label="Weitere Projektdetails">
|
||||
<div class="project-panel__content">
|
||||
@if (highlight.topic.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.topic"
|
||||
[highlights]="
|
||||
getHighlightTerms(extractHighlightTerms(highlight.topic))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
|
||||
@if (project.highlight?.recipient.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Zuwendungsempfänger</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.recipient"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(project.highlight?.recipient)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (project.highlight?.joint_project.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Verbundprojekt</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.joint_project"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(project.highlight?.joint_project)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (project.highlight?.executing_agency.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Ausführende Stelle</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.executing_agency"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(project.highlight?.executing_agency)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
@if (highlight.recipient.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Zuwendungsempfänger</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.recipient"
|
||||
[highlights]="
|
||||
getHighlightTerms(extractHighlightTerms(highlight.recipient))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (highlight.joint_project.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Verbundprojekt</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.joint_project"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(highlight.joint_project)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (highlight.executing_agency.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Ausführende Stelle</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.executing_agency"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(highlight.executing_agency)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
}
|
||||
</ng-template>
|
||||
|
||||
@@ -66,7 +66,9 @@ export class BundProjectTableComponent implements OnInit {
|
||||
topicFilterEnabled = input<boolean>(false);
|
||||
|
||||
elements = computed(() => this.page().elements ?? []);
|
||||
|
||||
highlightRowEnabled = computed(() => {
|
||||
return this.elements()[0]?.highlight ? true : false;
|
||||
});
|
||||
queryParamMap = toSignal(this.activatedRoute.queryParamMap, {
|
||||
initialValue: this.activatedRoute.snapshot.queryParamMap,
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<app-data-table
|
||||
[columns]="columns"
|
||||
[data]="elements()"
|
||||
[detailTemplate]="expandedProject"
|
||||
[detailTemplate]="highlightRowEnabled() ? expandedProject : null"
|
||||
[queryParamSortKey]="queryParamKeys.sortBy"
|
||||
[queryParamSortDirectionKey]="queryParamKeys.sortDirection" />
|
||||
|
||||
@@ -63,108 +63,107 @@
|
||||
</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>
|
||||
@if (project.highlight) {
|
||||
@let highlight = project.highlight;
|
||||
<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 (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(highlight.title_de))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@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(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(highlight.title_en))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
|
||||
@if (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(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);
|
||||
|
||||
@@ -64,7 +64,9 @@ export class DfgProjectTableComponent implements OnInit {
|
||||
topicFilterEnabled = input<boolean>(false);
|
||||
|
||||
elements = computed(() => this.page().elements ?? []);
|
||||
|
||||
highlightRowEnabled = computed(() => {
|
||||
return this.elements()[0]?.highlight ? true : false;
|
||||
});
|
||||
queryParamMap = toSignal(this.activatedRoute.queryParamMap, {
|
||||
initialValue: this.activatedRoute.snapshot.queryParamMap,
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<app-data-table
|
||||
[columns]="columns()"
|
||||
[data]="projects()"
|
||||
[detailTemplate]="expandedProject"
|
||||
[detailTemplate]="highlightRowEnabled() ? expandedProject : null"
|
||||
[queryParamSortKey]="queryParamKeys.sortBy"
|
||||
[queryParamSortDirectionKey]="queryParamKeys.sortDirection" />
|
||||
|
||||
@@ -148,72 +148,69 @@
|
||||
</a>
|
||||
</ng-template>
|
||||
<ng-template #expandedProject let-project>
|
||||
<section class="project-panel" aria-label="Weitere Projektdetails">
|
||||
<div class="project-panel__content">
|
||||
@if (project.highlight?.title.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"
|
||||
[highlights]="
|
||||
getHighlightTerms(extractHighlightTerms(project.highlight?.title))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (project.highlight) {
|
||||
@let highlight = project.highlight;
|
||||
<section class="project-panel" aria-label="Weitere Projektdetails">
|
||||
<div class="project-panel__content">
|
||||
@if (highlight.title.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"
|
||||
[highlights]="
|
||||
getHighlightTerms(extractHighlightTerms(highlight.title))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
|
||||
@if (project.highlight?.objective.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.objective"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(project.highlight?.objective)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (project.highlight?.acronym.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Akronym</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.acronym"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(project.highlight?.acronym)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (project.highlight?.cordis_topic_text.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Cordis-Thema</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.cordis_topic_text"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(project.highlight?.cordis_topic_text)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (project.highlight?.keywords.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Schlüsselwörter</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.keywords"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(project.highlight?.keywords)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
@if (highlight.objective.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.objective"
|
||||
[highlights]="
|
||||
getHighlightTerms(extractHighlightTerms(highlight.objective))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (highlight.acronym.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Akronym</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.acronym"
|
||||
[highlights]="
|
||||
getHighlightTerms(extractHighlightTerms(highlight.acronym))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (highlight.cordis_topic_text.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Cordis-Thema</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.cordis_topic_text"
|
||||
[highlights]="
|
||||
getHighlightTerms(
|
||||
extractHighlightTerms(highlight.cordis_topic_text)
|
||||
)
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
@if (highlight.keywords.length > 0) {
|
||||
<article class="panel-field panel-field--full">
|
||||
<h4 class="panel-field__label">Schlüsselwörter</h4>
|
||||
<app-highlighted-text
|
||||
class="panel-field__text"
|
||||
[content]="project.keywords"
|
||||
[highlights]="
|
||||
getHighlightTerms(extractHighlightTerms(highlight.keywords))
|
||||
" />
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
}
|
||||
</ng-template>
|
||||
|
||||
@@ -84,6 +84,9 @@ export class EuProjectTableComponent {
|
||||
return this.page()?.total ?? 0;
|
||||
});
|
||||
|
||||
highlightRowEnabled = computed(() => {
|
||||
return this.projects()[0]?.highlight ? true : false;
|
||||
});
|
||||
queryParamMap = toSignal(this.activatedRoute.queryParamMap, {
|
||||
initialValue: this.activatedRoute.snapshot.queryParamMap,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user