enabled project detail row only for projects where highlighted content is persistent

This commit is contained in:
2026-08-16 21:38:01 +02:00
parent 17100024e5
commit 8a418a99b4
6 changed files with 231 additions and 227 deletions
@@ -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>