applied generoc table-data-row for project tables

This commit is contained in:
2026-08-17 22:54:14 +02:00
parent 6eb159cc03
commit 9a6bae2df4
9 changed files with 164 additions and 411 deletions
@@ -110,58 +110,64 @@
<ng-template #expandedProject let-project>
@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 (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>
}
<app-table-detail-row>
<div table-detail-header>
<h4 class="panel-field__label">Fundstelle im Projekt</h4>
</div>
</section>
<ng-container table-detail-body>
<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 (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>
</ng-container>
</app-table-detail-row>
}
</ng-template>
@@ -205,97 +205,6 @@
}
}
}
// ------------------------
// Expanded project panel
// ------------------------
.project-panel {
width: 100%;
padding: 12px 16px 14px;
color: var(--sg-text);
background: var(--sg-background);
border-top: 1px solid var(--sg-border);
}
.project-panel__header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}
.project-panel__heading {
display: flex;
align-items: flex-start;
gap: 8px;
> mat-icon {
flex: 0 0 auto;
width: 19px;
height: 19px;
color: var(--sg-primary);
font-size: 19px;
}
h3 {
margin: 0;
font-size: 13px;
font-weight: 700;
line-height: 1.2;
}
p {
margin: 1px 0 0;
color: var(--sg-text-muted);
font-size: 11px;
line-height: 1.3;
}
}
.project-panel__content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
gap: 10px;
}
.panel-field {
min-width: 0;
&--full {
grid-column: 1 / -1;
}
}
.panel-field__label {
color: var(--sg-text-muted);
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.02em;
}
.panel-field__text {
margin: 0;
font-size: 12px;
line-height: 1.5;
overflow-wrap: anywhere;
}
.project-panel__empty {
display: flex;
align-items: center;
gap: 6px;
grid-column: 1 / -1;
color: var(--sg-text-muted);
font-size: 12px;
mat-icon {
width: 16px;
height: 16px;
font-size: 16px;
}
}
// ------------------------
// Responsive adjustments
@@ -32,7 +32,7 @@ import {
HighlightedTextComponent,
HighlightTerm,
} from '../highlighted-text/highlighted-text.component';
import { MatDividerModule } from '@angular/material/divider';
import { TableDetailRowComponent } from '../table-detail-row/table-detail-row.component';
@Component({
selector: 'app-bund-project-table',
imports: [
@@ -49,6 +49,7 @@ import { MatDividerModule } from '@angular/material/divider';
AppTopicChipComponent,
SkTextDirective,
HighlightedTextComponent,
TableDetailRowComponent,
],
templateUrl: './bund-project-table.component.html',
styleUrl: './bund-project-table.component.scss',
@@ -65,29 +65,33 @@
<ng-template #expandedProject let-project>
@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">
<app-table-detail-row>
<div table-detail-header>
<h4 class="panel-field__label">Fundstelle im Projekt</h4>
</div>
<ng-container table-detail-body>
<article>
<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>
</article>
@if (getPanelLanguage(project) === 'de') {
@if (highlight.title_de.length > 0) {
<article class="panel-field panel-field--full">
@@ -161,8 +165,8 @@
}
</article>
}
</div>
</section>
</ng-container>
</app-table-detail-row>
}
</ng-template>
<ng-template #authorsTmp let-project>
@@ -296,6 +296,7 @@
.language-toggle {
display: inline-flex;
flex: 0 0 auto;
margin-top: 5px;
padding: 1px;
border: 1px solid var(--sg-border);
border-radius: 4px;
@@ -358,94 +359,6 @@
line-height: 1.4;
overflow-wrap: anywhere;
}
// ------------------------
// Expanded project panel
// ------------------------
.project-panel {
width: 100%;
padding: 12px 16px 14px;
color: var(--sg-text);
background: var(--sg-background);
border-top: 1px solid var(--sg-border);
}
.project-panel__header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}
.project-panel__heading {
display: flex;
align-items: flex-start;
gap: 8px;
> mat-icon {
flex: 0 0 auto;
width: 19px;
height: 19px;
color: var(--sg-primary);
font-size: 19px;
}
h3 {
margin: 0;
font-size: 13px;
font-weight: 700;
line-height: 1.2;
}
p {
margin: 1px 0 0;
color: var(--sg-text-muted);
font-size: 11px;
line-height: 1.3;
}
}
.project-panel__content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
gap: 10px;
}
.panel-field {
min-width: 0;
&--full {
grid-column: 1 / -1;
}
}
.panel-field__label {
color: var(--sg-text-muted);
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.02em;
}
.panel-field__text {
margin: 0;
font-size: 12px;
line-height: 1.5;
overflow-wrap: anywhere;
}
.project-panel__empty {
display: flex;
align-items: center;
gap: 6px;
grid-column: 1 / -1;
color: var(--sg-text-muted);
font-size: 12px;
mat-icon {
width: 16px;
height: 16px;
font-size: 16px;
}
.keka {
background: var(--sg-surface-soft);
}
@@ -30,6 +30,7 @@ import {
HighlightedTextComponent,
HighlightTerm,
} from '../highlighted-text/highlighted-text.component';
import { TableDetailRowComponent } from '../table-detail-row/table-detail-row.component';
import { MatDividerModule } from '@angular/material/divider';
type HighlightLanguage = 'de' | 'en';
@@ -47,6 +48,7 @@ type HighlightLanguage = 'de' | 'en';
SkTextDirective,
HighlightedTextComponent,
MatDividerModule,
TableDetailRowComponent,
],
templateUrl: './dfg-project-table.component.html',
styleUrl: './dfg-project-table.component.scss',
@@ -534,6 +536,7 @@ export class DfgProjectTableComponent implements OnInit {
}
}
}
console.log(terms);
return Array.from(terms);
}
@@ -150,67 +150,73 @@
<ng-template #expandedProject let-project>
@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 (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>
}
<app-table-detail-row>
<div table-detail-header>
<h4 class="panel-field__label">Fundstelle im Projekt</h4>
</div>
</section>
<ng-container table-detail-body>
<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 (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>
</ng-container>
</app-table-detail-row>
}
</ng-template>
@@ -143,97 +143,6 @@
max-width: 200px;
}
// ------------------------
// Expanded project panel
// ------------------------
.project-panel {
width: 100%;
padding: 12px 16px 14px;
color: var(--sg-text);
background: var(--sg-background);
border-top: 1px solid var(--sg-border);
}
.project-panel__header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}
.project-panel__heading {
display: flex;
align-items: flex-start;
gap: 8px;
> mat-icon {
flex: 0 0 auto;
width: 19px;
height: 19px;
color: var(--sg-primary);
font-size: 19px;
}
h3 {
margin: 0;
font-size: 13px;
font-weight: 700;
line-height: 1.2;
}
p {
margin: 1px 0 0;
color: var(--sg-text-muted);
font-size: 11px;
line-height: 1.3;
}
}
.project-panel__content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
gap: 10px;
}
.panel-field {
min-width: 0;
&--full {
grid-column: 1 / -1;
}
}
.panel-field__label {
color: var(--sg-text-muted);
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.02em;
}
.panel-field__text {
margin: 0;
font-size: 12px;
line-height: 1.5;
overflow-wrap: anywhere;
}
.project-panel__empty {
display: flex;
align-items: center;
gap: 6px;
grid-column: 1 / -1;
color: var(--sg-text-muted);
font-size: 12px;
mat-icon {
width: 16px;
height: 16px;
font-size: 16px;
}
}
// ------------------------
// Data table overrides (applied via ::ng-deep)
// ------------------------
@@ -39,6 +39,7 @@ import {
} from '../highlighted-text/highlighted-text.component';
import { MatDividerModule } from '@angular/material/divider';
import { SearchResultsStateService } from '../../../modules/keywords-search/search-results/search-results-state.service';
import { TableDetailRowComponent } from '../table-detail-row/table-detail-row.component';
@Component({
selector: 'app-eu-project-table',
imports: [
@@ -57,6 +58,7 @@ import { SearchResultsStateService } from '../../../modules/keywords-search/sear
SkTextDirective,
MatDividerModule,
HighlightedTextComponent,
TableDetailRowComponent,
],
templateUrl: './eu-project-table.component.html',
styleUrl: './eu-project-table.component.scss',