added detailed overview page for a single DFG project
This commit is contained in:
@@ -0,0 +1,243 @@
|
||||
<div class="detail-page">
|
||||
<div class="page-header">
|
||||
<div class="breadcrumb">
|
||||
<span>DFG Projekte</span>
|
||||
<mat-icon>chevron_right</mat-icon>
|
||||
<span>Projektdetails</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (dfgProject) {
|
||||
<div class="project-hero">
|
||||
<div class="hero-content">
|
||||
<div class="eyebrow">
|
||||
<span class="project-badge">DFG Projekt</span>
|
||||
<span class="project-id">ID: {{ dfgProject.id }}</span>
|
||||
</div>
|
||||
<h1>{{ dfgProject.title }}</h1>
|
||||
@if (dfgProject.project_identifier) {
|
||||
<p class="project-identifier">
|
||||
<strong>{{ dfgProject.project_identifier.split('-')[0] }}</strong>
|
||||
</p>
|
||||
}
|
||||
<div class="hero-actions">
|
||||
@if (dfgProject.link) {
|
||||
<a [href]="dfgProject.link" target="_blank" class="primary-action">
|
||||
<mat-icon>open_in_new</mat-icon>
|
||||
<span>Zum Projekt</span>
|
||||
</a>
|
||||
}
|
||||
@if (dfgProject.website) {
|
||||
<a
|
||||
[href]="dfgProject.website"
|
||||
target="_blank"
|
||||
class="secondary-action">
|
||||
<mat-icon>language</mat-icon>
|
||||
<span>Webseite</span>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metrics-grid">
|
||||
<div class="metric-item">
|
||||
<mat-icon>calendar_today</mat-icon>
|
||||
<div class="metric-content">
|
||||
<strong>{{ dfgProject.funding_start_date || 'N/A' }}</strong>
|
||||
<span>Fördersbeginn</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="metric-item">
|
||||
<mat-icon>event_busy</mat-icon>
|
||||
<div class="metric-content">
|
||||
<strong>{{ getFundingStatus(dfgProject.funding_end_date) }}</strong>
|
||||
<span>Fördersende</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- @if (dfgProject.subject_area) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>category</mat-icon>
|
||||
<div class="metric-content">
|
||||
<strong>{{ dfgProject.subject_area }}</strong>
|
||||
<span>Fachliche Zuordnung</span>
|
||||
</div>
|
||||
</div>
|
||||
} -->
|
||||
@if (dfgProject.dfg_procedure) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>gavel</mat-icon>
|
||||
<div class="metric-content">
|
||||
<strong>{{ dfgProject.dfg_procedure }}</strong>
|
||||
<span>DFG Verfahren</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<!-- @if (dfgProject.funding_type) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>paid</mat-icon>
|
||||
<div class="metric-content">
|
||||
<strong>{{ dfgProject.funding_type }}</strong>
|
||||
<span>Förderung</span>
|
||||
</div>
|
||||
</div>
|
||||
} -->
|
||||
@if (dfgProject.international_reference) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>public</mat-icon>
|
||||
<div class="metric-content">
|
||||
<strong>{{ dfgProject.international_reference }}</strong>
|
||||
<span>Internationaler Bezug</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (dfgProject.description) {
|
||||
<mat-card appearance="outlined" class="card description-card">
|
||||
<div class="section-header">
|
||||
<mat-icon>description</mat-icon>
|
||||
<h2>Beschreibung</h2>
|
||||
</div>
|
||||
<p class="description-text">{{ dfgProject.description }}</p>
|
||||
</mat-card>
|
||||
}
|
||||
|
||||
<div class="content-grid">
|
||||
<main class="main-content">
|
||||
<!-- Beteiligte Personen -->
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>people</mat-icon>
|
||||
<h2>Beteiligte Personen</h2>
|
||||
<span class="count-badge">{{ getAssociatedPersons().length }}</span>
|
||||
</div>
|
||||
@if (getAssociatedPersons().length > 0) {
|
||||
<div class="person-grid">
|
||||
@for (person of getAssociatedPersons(); track person) {
|
||||
<div (click)="searchForPersonName(person)" class="person-item">
|
||||
<div class="avatar">{{ getInitials(person) }}</div>
|
||||
<div class="person-name">{{ person }}</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
} @else {
|
||||
<div class="empty-state">Keine Personen gefunden.</div>
|
||||
}
|
||||
</mat-card>
|
||||
|
||||
<!-- Beteiligte Institutionen -->
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>business</mat-icon>
|
||||
<h2>Beteiligte Institutionen</h2>
|
||||
<span class="count-badge">{{ getInstitutions().length }}</span>
|
||||
</div>
|
||||
@if (getInstitutions().length > 0) {
|
||||
<div class="institution-grid">
|
||||
@for (institution of getInstitutions(); track institution) {
|
||||
<div (click)="searchForInstitutionName(institution)" class="institution-item">
|
||||
<mat-icon>apartment</mat-icon>
|
||||
<span>{{ institution }}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
} @else {
|
||||
<div class="empty-state">Keine Institutionen gefunden.</div>
|
||||
}
|
||||
</mat-card>
|
||||
<!-- Teilprojekt -->
|
||||
<!-- @if (dfgProject.subproject_of) {
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>account_tree</mat-icon>
|
||||
<h2>Teilprojekt</h2>
|
||||
</div>
|
||||
<dl class="details-list">
|
||||
<div class="detail-row">
|
||||
<dt>Teilprojekt zu</dt>
|
||||
<dd>{{ dfgProject.subproject_of }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</mat-card>
|
||||
} -->
|
||||
</main>
|
||||
|
||||
<aside class="sidebar">
|
||||
<!-- Projektdetails -->
|
||||
<mat-card appearance="outlined" class="card details-card">
|
||||
<div class="section-header">
|
||||
<mat-icon>info</mat-icon>
|
||||
<h2>Projektdetails</h2>
|
||||
</div>
|
||||
<dl class="details-list">
|
||||
<div class="detail-row">
|
||||
<dt>Projekt ID</dt>
|
||||
<dd>{{ dfgProject.id || 'N/A' }}</dd>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<dt>Titel</dt>
|
||||
<dd>{{ dfgProject.title || 'N/A' }}</dd>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<dt>Projektkennung</dt>
|
||||
<dd>{{ dfgProject.project_identifier || 'N/A' }}</dd>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<dt>Fachliche Zuordnung</dt>
|
||||
<dd>{{ dfgProject.subject_area || 'N/A' }}</dd>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<dt>DFG-Verfahren</dt>
|
||||
<dd>{{ dfgProject.dfg_procedure || 'N/A' }}</dd>
|
||||
</div>
|
||||
<!-- <div class="detail-row">
|
||||
<dt>Förderung</dt>
|
||||
<dd>{{ dfgProject.funding_type || 'N/A' }}</dd>
|
||||
</div> -->
|
||||
<div class="detail-row">
|
||||
<dt>Fördersbeginn</dt>
|
||||
<dd>{{ dfgProject.funding_start_date || 'N/A' }}</dd>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<dt>Fördersende</dt>
|
||||
<dd>{{ getFundingStatus(dfgProject.funding_end_date) }}</dd>
|
||||
</div>
|
||||
@if (dfgProject.subproject_of ) {
|
||||
<div class="detail-row">
|
||||
<dt>Teilprojekt von</dt>
|
||||
<dd>{{ dfgProject.subproject_of }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (dfgProject.international_reference) {
|
||||
<div class="detail-row">
|
||||
<dt>Internationaler Bezug</dt>
|
||||
<dd>{{ dfgProject.international_reference }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (dfgProject.website) {
|
||||
<div class="detail-row">
|
||||
<dt>Webseite</dt>
|
||||
<dd>
|
||||
<a
|
||||
[href]="dfgProject.website"
|
||||
target="_blank"
|
||||
class="external-link"
|
||||
>{{ dfgProject.website }}</a
|
||||
>
|
||||
</dd>
|
||||
</div>
|
||||
}
|
||||
</dl>
|
||||
</mat-card>
|
||||
</aside>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="error-container">
|
||||
<div class="error-state">
|
||||
<mat-icon>error_outline</mat-icon>
|
||||
<p>DFG Projekt nicht gefunden.</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -0,0 +1,467 @@
|
||||
.detail-page {
|
||||
padding: 28px 32px 42px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.back-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 8px 16px;
|
||||
border: 1px solid #d9e2f0;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
background: #fff;
|
||||
color: var(--sg-text);
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.back-link:hover {
|
||||
background: #f5f7fa;
|
||||
border-color: #b8c5d6;
|
||||
}
|
||||
|
||||
.back-link mat-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.breadcrumb mat-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.breadcrumb span:last-child {
|
||||
color: var(--sg-text);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.project-hero {
|
||||
background: #f8fafc;
|
||||
border: 1px solid #d9e2f0;
|
||||
border-radius: var(--sg-radius-md);
|
||||
padding: 28px 32px;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.hero-content {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.project-badge {
|
||||
display: inline-block;
|
||||
padding: 4px 12px;
|
||||
background: #e8edf5;
|
||||
color: var(--sg-text);
|
||||
border-radius: var(--sg-radius-sm);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.project-id {
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 26px;
|
||||
line-height: 1.3;
|
||||
font-weight: 700;
|
||||
color: var(--sg-text);
|
||||
}
|
||||
|
||||
.project-identifier {
|
||||
margin: 0 0 16px;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.primary-action,
|
||||
.secondary-action {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 20px;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.primary-action {
|
||||
background: var(--sg-primary, #0066cc);
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.primary-action:hover {
|
||||
background: var(--sg-primary-dark, #0052a3);
|
||||
}
|
||||
|
||||
.secondary-action {
|
||||
background: #fff;
|
||||
color: var(--sg-text);
|
||||
border: 1px solid #d9e2f0;
|
||||
}
|
||||
|
||||
.secondary-action:hover {
|
||||
background: #f5f7fa;
|
||||
border-color: #b8c5d6;
|
||||
}
|
||||
|
||||
.primary-action mat-icon,
|
||||
.secondary-action mat-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.metrics-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 16px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #d9e2f0;
|
||||
}
|
||||
|
||||
.metric-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.metric-item mat-icon {
|
||||
color: var(--sg-text-muted);
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.metric-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.metric-content strong {
|
||||
font-size: 15px;
|
||||
color: var(--sg-text);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.metric-content span {
|
||||
font-size: 12px;
|
||||
color: var(--sg-text-muted);
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-bottom: 24px;
|
||||
border-color: #d9e2f0 !important;
|
||||
border-radius: var(--sg-radius-md) !important;
|
||||
}
|
||||
|
||||
.card ::ng-deep .mat-mdc-card-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 16px 20px 12px;
|
||||
border-bottom: 1px solid #f0f2f5;
|
||||
}
|
||||
|
||||
.section-header mat-icon {
|
||||
color: var(--sg-text-muted);
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.section-header h2 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--sg-text);
|
||||
}
|
||||
|
||||
.count-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 24px;
|
||||
height: 24px;
|
||||
padding: 0 8px;
|
||||
margin-left: auto;
|
||||
background: #e8edf5;
|
||||
border-radius: 12px;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.description-text {
|
||||
padding: 16px 20px 20px;
|
||||
margin: 0;
|
||||
color: var(--sg-text);
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.content-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.person-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
||||
gap: 12px;
|
||||
padding: 16px 20px 20px;
|
||||
}
|
||||
|
||||
.person-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #d9e2f0;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
background: #fff;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.person-item:hover {
|
||||
cursor:pointer;
|
||||
background: #f8fafc;
|
||||
border-color: #b8c5d6;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
background: #e8edf5;
|
||||
color: var(--sg-text);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.person-name {
|
||||
cursor:pointer;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--sg-text);
|
||||
}
|
||||
|
||||
.institution-grid {
|
||||
cursor:pointer;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 8px;
|
||||
padding: 16px 20px 20px;
|
||||
}
|
||||
|
||||
.institution-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #d9e2f0;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
background: #fff;
|
||||
font-size: 13px;
|
||||
color: var(--sg-text);
|
||||
}
|
||||
|
||||
.institution-item mat-icon {
|
||||
color: var(--sg-text-muted);
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 20px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.details-list {
|
||||
margin: 0;
|
||||
padding: 16px 20px 20px;
|
||||
}
|
||||
|
||||
.detail-row {
|
||||
display: grid;
|
||||
grid-template-columns: 140px 1fr;
|
||||
gap: 12px;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid #f0f2f5;
|
||||
}
|
||||
|
||||
.detail-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.detail-row dt {
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.detail-row dd {
|
||||
margin: 0;
|
||||
color: var(--sg-text);
|
||||
font-size: 13px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.external-link {
|
||||
color: var(--sg-primary, #0066cc);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.external-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.error-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.error-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
color: var(--sg-text-muted);
|
||||
}
|
||||
|
||||
.error-state mat-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
font-size: 48px;
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
.error-state p {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.content-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.detail-page {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.project-hero {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.metrics-grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.detail-row {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.person-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.metrics-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.primary-action,
|
||||
.secondary-action {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { DfgProjectDetails } from '../../../api';
|
||||
import { Router } from '@angular/router';
|
||||
@Component({
|
||||
selector: 'app-dfg-details',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatCardModule, MatIconModule],
|
||||
templateUrl: './dfg-details.component.html',
|
||||
styleUrl: './dfg-details.component.scss',
|
||||
})
|
||||
export class DfgDetailsComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
dfgProject: DfgProjectDetails | undefined;
|
||||
|
||||
constructor (private router:Router){}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.data.subscribe(({ dfgSingleProject }) => {
|
||||
console.log('DFG Project:', dfgSingleProject);
|
||||
this.dfgProject = dfgSingleProject;
|
||||
});
|
||||
}
|
||||
|
||||
getInitials(name: string | null | undefined): string {
|
||||
if (!name) return '';
|
||||
const parts = name.trim().split(/\s+/);
|
||||
if (parts.length > 1) {
|
||||
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
||||
}
|
||||
return parts[0][0].toUpperCase();
|
||||
}
|
||||
|
||||
getFundingStatus(fundingEndDate: string | null | undefined): string {
|
||||
if (!fundingEndDate) return 'N/A';
|
||||
if (fundingEndDate === '2999') return 'laufend';
|
||||
const year = parseInt(fundingEndDate, 10);
|
||||
if (isNaN(year)) return fundingEndDate;
|
||||
return year >= new Date().getFullYear()
|
||||
? `${fundingEndDate} (laufend)`
|
||||
: `${fundingEndDate} (abgeschlossen)`;
|
||||
}
|
||||
searchForPersonName(personName: string): void {
|
||||
this.router.navigate(['/persons'], {
|
||||
queryParams: {
|
||||
query: personName
|
||||
}
|
||||
});
|
||||
}
|
||||
searchForInstitutionName(institutionName: string): void {
|
||||
this.router.navigate(['/institutions'], {
|
||||
queryParams: {
|
||||
search: institutionName
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* All associated persons as a simple list (no role grouping).
|
||||
*/
|
||||
getAssociatedPersons(): string[] {
|
||||
return this.dfgProject?.associated_persons || [];
|
||||
}
|
||||
|
||||
/**
|
||||
* All institutions as a simple list.
|
||||
*/
|
||||
getInstitutions(): string[] {
|
||||
return this.dfgProject?.institutions || [];
|
||||
}
|
||||
|
||||
goBack(): void {
|
||||
window.history.back();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user