added colored status element
This commit is contained in:
@@ -26,6 +26,14 @@
|
||||
</p>
|
||||
}
|
||||
<div class="hero-actions">
|
||||
<div
|
||||
class="status-badge"
|
||||
[style.background-color]="
|
||||
getStatusColor(getStatusDisplay(bundProject.funding_end_date))
|
||||
">
|
||||
<mat-icon>circle</mat-icon>
|
||||
<span>{{ getStatusDisplay(bundProject.funding_end_date) }}</span>
|
||||
</div>
|
||||
<!-- @if (bundProject.project_agency) {
|
||||
<div class="agency-info" (click)="searchForAgency(bundProject.project_agency)">
|
||||
<mat-icon>account_balance</mat-icon>
|
||||
@@ -59,7 +67,9 @@
|
||||
<div class="metric-item">
|
||||
<mat-icon>access_time</mat-icon>
|
||||
<div class="metric-content">
|
||||
<strong>{{ getStatusDisplay(bundProject.funding_end_date) }}</strong>
|
||||
<strong>{{
|
||||
getStatusDisplay(bundProject.funding_end_date)
|
||||
}}</strong>
|
||||
<span>Status</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,29 @@
|
||||
gap: 18px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.status-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 14px;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.status-badge:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.status-badge mat-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.back-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -152,6 +152,17 @@ export class BundDetailsComponent implements OnInit {
|
||||
if (fundingEndDate === '2999') return 'Laufend';
|
||||
const year = parseInt(fundingEndDate, 10);
|
||||
return year >= new Date().getFullYear() ? `Laufend` : `Abgeschlossen`;
|
||||
}
|
||||
getStatusColor(status: string | null | undefined): string {
|
||||
if (!status) return '#95a5a6';
|
||||
const statusUpper = status.toUpperCase();
|
||||
if (statusUpper.includes('ABGESCHLOSSEN')) {
|
||||
return '#27ae60';
|
||||
} else if (statusUpper.includes('LAUFEND')) {
|
||||
return '#f39c12';
|
||||
} else {
|
||||
return '#95a5a6';
|
||||
}
|
||||
}
|
||||
goBack(): void {
|
||||
window.history.back();
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
</p>
|
||||
}
|
||||
<div class="hero-actions">
|
||||
<div
|
||||
class="status-badge"
|
||||
[style.background-color]="getStatusColor(getStatusDisplay(dfgProject.funding_end_date))">
|
||||
<mat-icon>circle</mat-icon>
|
||||
<span>{{ getStatusDisplay(dfgProject.funding_end_date) }}</span>
|
||||
</div>
|
||||
@if (dfgProject.link) {
|
||||
<a [href]="dfgProject.link" target="_blank" class="primary-action">
|
||||
<mat-icon>open_in_new</mat-icon>
|
||||
|
||||
@@ -236,7 +236,29 @@ h1 {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.status-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 14px;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.status-badge:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.status-badge mat-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.description-text {
|
||||
padding: 16px 20px 20px;
|
||||
margin: 0;
|
||||
|
||||
@@ -53,11 +53,10 @@ export class DfgDetailsComponent implements OnInit {
|
||||
|
||||
getStatusColor(status: string | null | undefined): string {
|
||||
if (!status) return '#95a5a6';
|
||||
|
||||
const statusUpper = status.toUpperCase();
|
||||
if (statusUpper.includes('Abgeschlossen')) {
|
||||
if (statusUpper.includes('ABGESCHLOSSEN')) {
|
||||
return '#27ae60';
|
||||
} else if (statusUpper.includes('Laufend')) {
|
||||
} else if (statusUpper.includes('LAUFEND')) {
|
||||
return '#f39c12';
|
||||
} else {
|
||||
return '#95a5a6';
|
||||
@@ -93,10 +92,10 @@ export class DfgDetailsComponent implements OnInit {
|
||||
}
|
||||
getDuration(): string {
|
||||
const start = this.dfgProject?.funding_start_date;
|
||||
const end = this.dfgProject?.funding_end_date;
|
||||
const end = this.dfgProject?.funding_end_date === "2999" ? "Heute" : this.dfgProject?.funding_end_date ;
|
||||
|
||||
if (!start || !end) return '';
|
||||
|
||||
|
||||
return `von ${start} bis ${end}`;
|
||||
}
|
||||
goBack(): void {
|
||||
|
||||
Reference in New Issue
Block a user