layout adjustments
This commit is contained in:
@@ -140,6 +140,7 @@
|
||||
<button
|
||||
class="tab-btn"
|
||||
[class.active]="activeTab === 'organizations'"
|
||||
[disabled]="!isTabVisible('organizations')"
|
||||
(click)="setTab('organizations')">
|
||||
<mat-icon>business</mat-icon>
|
||||
Organisationen
|
||||
@@ -151,6 +152,7 @@
|
||||
<button
|
||||
class="tab-btn"
|
||||
[class.active]="activeTab === 'publications'"
|
||||
[disabled]="!isTabVisible('publications')"
|
||||
(click)="setTab('publications')">
|
||||
<mat-icon>description</mat-icon>
|
||||
Publikationen
|
||||
@@ -160,6 +162,7 @@
|
||||
<button
|
||||
class="tab-btn"
|
||||
[class.active]="activeTab === 'iprs'"
|
||||
[disabled]="!isTabVisible('iprs')"
|
||||
(click)="setTab('iprs')">
|
||||
<mat-icon>gavel</mat-icon>
|
||||
Patente
|
||||
@@ -169,6 +172,7 @@
|
||||
<button
|
||||
class="tab-btn"
|
||||
[class.active]="activeTab === 'deliverables'"
|
||||
[disabled]="!isTabVisible('deliverables')"
|
||||
(click)="setTab('deliverables')">
|
||||
<mat-icon>assignment</mat-icon>
|
||||
Deliverables
|
||||
@@ -215,29 +219,6 @@
|
||||
</mat-card>
|
||||
}
|
||||
|
||||
<!-- Keywords -->
|
||||
<!-- @if (getKeywords(euProject.keywords).length > 0) {
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>tag</mat-icon>
|
||||
<h2>Schlüsselwörter</h2>
|
||||
<span class="count-badge">{{
|
||||
getKeywords(euProject.keywords).length
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="keywords-grid">
|
||||
@for (
|
||||
keyword of getKeywords(euProject.keywords);
|
||||
track keyword
|
||||
) {
|
||||
<div
|
||||
class="keyword-item">
|
||||
<span class="keyword-value">{{ keyword }}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</mat-card>
|
||||
} -->
|
||||
@if (getKeywordChips().length > 0) {
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
@@ -492,67 +473,6 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Organizations Tab
|
||||
@if (activeTab === 'organizations' && euProject.organizations) {
|
||||
<div class="organizations-tab">
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>business</mat-icon>
|
||||
<h2>Organisationen ({{ euProject.organizations.length }})</h2>
|
||||
</div>
|
||||
<div class="organizations-list">
|
||||
@for (org of euProject.organizations; track org.organisationID) {
|
||||
<div
|
||||
class="organization-item"
|
||||
(click)="searchForInstitutionName(org.name || '')">
|
||||
<div class="org-avatar">{{ getInitials(org.name) }}</div>
|
||||
<div class="org-info">
|
||||
<div class="org-name">
|
||||
{{
|
||||
org.name || org.shortName || 'Unbekannte Organisation'
|
||||
}}
|
||||
</div>
|
||||
<div class="org-details">
|
||||
@if (org.shortName) {
|
||||
<span class="org-short">{{ org.shortName }}</span>
|
||||
}
|
||||
@if (org.role) {
|
||||
<span class="org-role">{{ org.role }}</span>
|
||||
}
|
||||
@if (org.country) {
|
||||
<span class="org-country">{{ org.country }}</span>
|
||||
}
|
||||
@if (org.SME) {
|
||||
<span class="org-sme-badge">SME</span>
|
||||
}
|
||||
@if (org.city) {
|
||||
<span class="org-city">{{ org.city }}</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (org.ecContribution) {
|
||||
<div class="org-contribution">
|
||||
<span class="contribution-label">EU-Beitrag:</span>
|
||||
<span class="contribution-value">{{
|
||||
formatCurrency(org.ecContribution)
|
||||
}}</span>
|
||||
</div>
|
||||
}
|
||||
@if (org.totalCost) {
|
||||
<div class="org-cost">
|
||||
<span class="cost-label">Kosten:</span>
|
||||
<span class="cost-value">{{
|
||||
formatCurrency(org.totalCost)
|
||||
}}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
} -->
|
||||
|
||||
<!-- Organizations Tab -->
|
||||
@if (activeTab === 'organizations' && euProject.organizations) {
|
||||
<app-organizations-table [orgs]="euProject.organizations"/>
|
||||
@@ -560,63 +480,7 @@
|
||||
@if (activeTab === 'publications' && euProject.publications) {
|
||||
<app-publications-table [publications]="euProject.publications"/>
|
||||
}
|
||||
<!-- Publications Tab
|
||||
@if (activeTab === 'publications' && euProject.publications) {
|
||||
<div class="publications-tab">
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>description</mat-icon>
|
||||
<h2>Publikationen ({{ euProject.publications.length }})</h2>
|
||||
</div>
|
||||
<div class="publications-list">
|
||||
@for (pub of euProject.publications; track pub.doi) {
|
||||
<div class="publication-item" (click)="searchForPublication(pub)">
|
||||
<div class="pub-icon">
|
||||
<mat-icon>article</mat-icon>
|
||||
</div>
|
||||
<div class="pub-info">
|
||||
<div class="pub-title">{{ pub.title || 'Kein Titel' }}</div>
|
||||
<div class="pub-authors">
|
||||
{{ pub.authors || 'Autoren unbekannt' }}
|
||||
</div>
|
||||
<div class="pub-meta">
|
||||
@if (pub.journalTitle) {
|
||||
<span class="pub-journal">{{ pub.journalTitle }}</span>
|
||||
}
|
||||
@if (pub.publishedYear) {
|
||||
<span class="pub-year">({{ pub.publishedYear }})</span>
|
||||
}
|
||||
@if (pub.publisher) {
|
||||
<span class="pub-publisher">{{ pub.publisher }}</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pub-actions">
|
||||
@if (pub.doi) {
|
||||
<a
|
||||
[href]="'https://doi.org/' + pub.doi"
|
||||
target="_blank"
|
||||
class="pub-link"
|
||||
matTooltip="DOI öffnen">
|
||||
<mat-icon>open_in_new</mat-icon>
|
||||
</a>
|
||||
}
|
||||
@if (pub.repositoryUrl) {
|
||||
<a
|
||||
[href]="pub.repositoryUrl"
|
||||
target="_blank"
|
||||
class="pub-link"
|
||||
matTooltip="Repository öffnen">
|
||||
<mat-icon>folder_open</mat-icon>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
} -->
|
||||
|
||||
|
||||
<!-- IPRs Tab -->
|
||||
@if (activeTab === 'iprs' && euProject.iprs) {
|
||||
@@ -624,7 +488,7 @@
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>gavel</mat-icon>
|
||||
<h2>Geistiges Eigentum (IPRs) ({{ euProject.iprs.length }})</h2>
|
||||
<h2>Patente (IPRs) ({{ euProject.iprs.length }})</h2>
|
||||
</div>
|
||||
<div class="iprs-list">
|
||||
@for (ipr of euProject.iprs; track ipr.title) {
|
||||
@@ -674,12 +538,12 @@
|
||||
}
|
||||
|
||||
<!-- Deliverables Tab -->
|
||||
@if (activeTab === 'deliverables' && euProject.deliverables) {
|
||||
@if (activeTab === 'deliverables' && notEmpty(euProject.deliverables)) {
|
||||
<div class="deliverables-tab">
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>assignment</mat-icon>
|
||||
<h2>Deliverables ({{ euProject.deliverables.length }})</h2>
|
||||
<h2>Deliverables ({{ euProject.deliverables?.length }})</h2>
|
||||
</div>
|
||||
<div class="deliverables-list">
|
||||
@for (deliv of euProject.deliverables; track deliv.url) {
|
||||
|
||||
@@ -782,6 +782,7 @@ h1 {
|
||||
}
|
||||
|
||||
.ipr-item {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 16px;
|
||||
|
||||
@@ -149,17 +149,16 @@ export class EuDetailsComponent implements OnInit, OnDestroy {
|
||||
const queryParams = params || this.route.snapshot.queryParams;
|
||||
const tabParam = queryParams['tab'] as TabType;
|
||||
|
||||
if (tabParam && this.isValidTab(tabParam)) {
|
||||
if (this.tabHasContent(tabParam)) {
|
||||
this.activeTab = tabParam;
|
||||
} else {
|
||||
// Only update if it's a different tab
|
||||
if (this.activeTab !== 'overview') {
|
||||
this.updateTabQueryParam('overview');
|
||||
}
|
||||
}
|
||||
} else if (!queryParams['tab'] && this.activeTab !== 'overview') {
|
||||
// Set default tab only if no tab param exists
|
||||
if (!tabParam) {
|
||||
this.activeTab = 'overview'; // silent default, no navigation
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isValidTab(tabParam) && this.tabHasContent(tabParam)) {
|
||||
this.activeTab = tabParam;
|
||||
} else {
|
||||
// tab param exists but is invalid/empty — correct it
|
||||
this.activeTab = 'overview';
|
||||
this.updateTabQueryParam('overview');
|
||||
}
|
||||
}
|
||||
@@ -201,15 +200,15 @@ export class EuDetailsComponent implements OnInit, OnDestroy {
|
||||
* Update URL query param for tab
|
||||
*/
|
||||
private updateTabQueryParam(tab: TabType): void {
|
||||
// Prevent unnecessary navigation
|
||||
const currentTab = this.route.snapshot.queryParams['tab'];
|
||||
if (currentTab === tab) return;
|
||||
|
||||
this.router
|
||||
.navigate([], {
|
||||
relativeTo: this.route,
|
||||
queryParams: { tab: tab },
|
||||
queryParams: { tab },
|
||||
queryParamsHandling: 'merge',
|
||||
replaceUrl: true,
|
||||
})
|
||||
.catch((err) => console.error('Tab navigation failed:', err));
|
||||
}
|
||||
@@ -241,7 +240,6 @@ export class EuDetailsComponent implements OnInit, OnDestroy {
|
||||
|
||||
// Check if tab has content
|
||||
if (!this.tabHasContent(tab)) {
|
||||
console.warn(`Tab "${tab}" has no content`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -411,6 +409,10 @@ export class EuDetailsComponent implements OnInit, OnDestroy {
|
||||
|
||||
return schemeMap[scheme] || scheme;
|
||||
}
|
||||
notEmpty(array: any): boolean {
|
||||
if (array === undefined) return false;
|
||||
return Array.isArray(array) && array.length > 0;
|
||||
}
|
||||
|
||||
getFormattedTopics(topics: string | null | undefined): string[] {
|
||||
if (!topics) return [];
|
||||
@@ -487,104 +489,11 @@ export class EuDetailsComponent implements OnInit, OnDestroy {
|
||||
|
||||
// ============= SEARCH / NAVIGATION METHODS =============
|
||||
|
||||
/**
|
||||
* Navigate to projects with topic filter
|
||||
*/
|
||||
searchByTopic(topic: string): void {
|
||||
if (!topic) {
|
||||
console.warn('Cannot search with empty topic');
|
||||
return;
|
||||
}
|
||||
|
||||
this.router
|
||||
.navigate(['/eu-projects'], {
|
||||
queryParams: { topic: topic },
|
||||
})
|
||||
.catch((err) => console.error('Navigation to topic failed:', err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate to projects with keyword filter
|
||||
*/
|
||||
searchByKeyword(keyword: string): void {
|
||||
if (!keyword) {
|
||||
console.warn('Cannot search with empty keyword');
|
||||
return;
|
||||
}
|
||||
|
||||
this.router
|
||||
.navigate(['/eu-projects'], {
|
||||
queryParams: { keyword: keyword },
|
||||
})
|
||||
.catch((err) => console.error('Navigation to keyword failed:', err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate to projects with framework filter
|
||||
*/
|
||||
searchByFramework(framework: string): void {
|
||||
if (!framework) {
|
||||
console.warn('Cannot search with empty framework');
|
||||
return;
|
||||
}
|
||||
|
||||
this.router
|
||||
.navigate(['/eu-projects'], {
|
||||
queryParams: { framework: framework },
|
||||
})
|
||||
.catch((err) => console.error('Navigation to framework failed:', err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate to projects with funding scheme filter
|
||||
*/
|
||||
searchByFundingScheme(scheme: string): void {
|
||||
if (!scheme) {
|
||||
console.warn('Cannot search with empty funding scheme');
|
||||
return;
|
||||
}
|
||||
|
||||
this.router
|
||||
.navigate(['/eu-projects'], {
|
||||
queryParams: { fundingScheme: scheme },
|
||||
})
|
||||
.catch((err) =>
|
||||
console.error('Navigation to funding scheme failed:', err),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate to projects with status filter
|
||||
*/
|
||||
searchByStatus(status: string): void {
|
||||
if (!status) {
|
||||
console.warn('Cannot search with empty status');
|
||||
return;
|
||||
}
|
||||
|
||||
this.router
|
||||
.navigate(['/eu-projects'], {
|
||||
queryParams: { status: status },
|
||||
})
|
||||
.catch((err) => console.error('Navigation to status failed:', err));
|
||||
}
|
||||
|
||||
searchForPatent(patent:Fp7ProjectIPR): void {
|
||||
searchForPatent(patent: Fp7ProjectIPR): void {
|
||||
this.router.navigate(['/patents'], {
|
||||
queryParams: {
|
||||
search: patent.title,
|
||||
search: patent.title,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Navigate back to projects list with optional filter
|
||||
*/
|
||||
goBack(filters?: { [key: string]: any }): void {
|
||||
this.router
|
||||
.navigate(['/eu-projects'], {
|
||||
queryParams: filters || {},
|
||||
queryParamsHandling: 'merge',
|
||||
})
|
||||
.catch((err) => console.error('Navigation back failed:', err));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -56,8 +56,8 @@
|
||||
<ng-container matColumnDef="journal">
|
||||
<th mat-header-cell *matHeaderCellDef>Zeitschrift</th>
|
||||
<td mat-cell *matCellDef="let pub">
|
||||
@if (pub.journalTitle) {
|
||||
<span class="journal-chip">{{ pub.journalTitle }}</span>
|
||||
@if (pub.journalNumber) {
|
||||
<span class="journal-chip" [matTooltip]="pub.journalNumber">{{ pub.journalNumber }}</span>
|
||||
} @else {
|
||||
<span class="empty-value">—</span>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user