adjusted view for subject classifications
This commit is contained in:
@@ -77,15 +77,6 @@
|
||||
<span>Status</span>
|
||||
</div>
|
||||
</div>
|
||||
@if (getSubjectArea()) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>category</mat-icon>
|
||||
<div class="metric-content">
|
||||
<strong>{{ getSubjectArea() }}</strong>
|
||||
<span>Fachliche Zuordnung</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (dfgProject.dfg_procedure) {
|
||||
<div class="metric-item">
|
||||
<mat-icon>gavel</mat-icon>
|
||||
@@ -142,6 +133,44 @@
|
||||
<app-project-oa-topics
|
||||
[topics]="dfgProject.topics"></app-project-oa-topics>
|
||||
}
|
||||
<!-- Fachsystematik -->
|
||||
@if (getSubjectClassifications().length > 0) {
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
<mat-icon>category</mat-icon>
|
||||
<h2>Fachsystematik</h2>
|
||||
<span class="count-badge">{{
|
||||
getSubjectClassifications().length
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="classification-list">
|
||||
@for (entry of getSubjectClassifications(); track $index) {
|
||||
<div class="classification-path">
|
||||
@for (
|
||||
segment of getClassificationParentSegments(entry);
|
||||
track $index
|
||||
) {
|
||||
<span class="classification-segment">{{ segment }}</span>
|
||||
<mat-icon class="classification-separator"
|
||||
>chevron_right</mat-icon
|
||||
>
|
||||
}
|
||||
<div class="classification-leaf-group">
|
||||
@for (
|
||||
leaf of getClassificationLeafSegments(entry);
|
||||
track $index
|
||||
) {
|
||||
<span
|
||||
class="classification-segment classification-segment--leaf">
|
||||
{{ leaf }}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</mat-card>
|
||||
}
|
||||
<!-- Beteiligte Personen -->
|
||||
<mat-card appearance="outlined" class="card">
|
||||
<div class="section-header">
|
||||
@@ -335,18 +364,7 @@
|
||||
<dt>Fachliche Zuordnung</dt>
|
||||
<dd>{{ getSubjectArea() || 'N/A' }}</dd>
|
||||
</div>
|
||||
@if (getSubjectClassifications().length > 0) {
|
||||
<div class="detail-row">
|
||||
<dt>Fachsystematik</dt>
|
||||
<dd>
|
||||
@for (entry of getSubjectClassifications(); track $index) {
|
||||
<div class="classification-path">
|
||||
{{ formatSubjectClassification(entry) }}
|
||||
</div>
|
||||
}
|
||||
</dd>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="detail-row">
|
||||
<dt>DFG-Verfahren</dt>
|
||||
<dd>{{ dfgProject.dfg_procedure || 'N/A' }}</dd>
|
||||
|
||||
@@ -154,7 +154,7 @@ h1 {
|
||||
|
||||
.metrics-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 16px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid var(--sg-border);
|
||||
@@ -473,10 +473,54 @@ h1 {
|
||||
color: var(--sg-text-muted);
|
||||
}
|
||||
|
||||
.classification-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 16px 20px 20px;
|
||||
}
|
||||
|
||||
.classification-path {
|
||||
font-size: 13px;
|
||||
color: var(--sg-text);
|
||||
line-height: 1.5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px 2px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: var(--sg-radius-sm);
|
||||
background: var(--sg-surface);
|
||||
}
|
||||
|
||||
.classification-segment {
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
padding: 3px 10px;
|
||||
border-radius: 10px;
|
||||
background: var(--sg-surface-soft);
|
||||
color: var(--sg-text-muted);
|
||||
white-space: nowrap;
|
||||
|
||||
&--leaf {
|
||||
background: var(--sg-primary-soft);
|
||||
color: var(--sg-text);
|
||||
font-weight: 500;
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.classification-leaf-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.classification-separator {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
color: var(--sg-text-muted);
|
||||
flex-shrink: 0;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.website-html {
|
||||
|
||||
@@ -8,13 +8,9 @@ import { DfgProjectPublicationSummary } from '../../../api/model/dfgProjectPubli
|
||||
import { DfgProjectSubprojectSummary } from '../../../api/model/dfgProjectSubprojectSummary';
|
||||
import { DfgProjectInstitutionRole } from '../../../api/model/dfgProjectInstitutionRole';
|
||||
import { DfgProjectPersonRole } from '../../../api/model/dfgProjectPersonRole';
|
||||
import { DfgProjectSubjectArea } from '../../../api/model/dfgProjectSubjectArea';
|
||||
import { DFGProjectFachgebieteInner } from '../../../api/model/dFGProjectFachgebieteInner';
|
||||
import { ProjectOaTopicsComponent } from '../../../shared/ui/project-oa-topics/project-oa-topics.component';
|
||||
import { Topic } from '../../../api';
|
||||
import {
|
||||
topicHierarchyColor,
|
||||
TopicHierarchyColorInput,
|
||||
} from '../../../resolvers/utils/topic-colors';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dfg-details',
|
||||
standalone: true,
|
||||
@@ -159,22 +155,26 @@ export class DfgDetailsComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
// --- Subject classification (DFG Fachsystematik) ---
|
||||
//(DFG Fachsystematik)
|
||||
|
||||
getSubjectClassifications(): DfgProjectSubjectArea[] {
|
||||
getSubjectClassifications(): DFGProjectFachgebieteInner[] {
|
||||
return this.dfgProject?.subject_classifications ?? [];
|
||||
}
|
||||
|
||||
/** Renders one classification entry as a breadcrumb-like path. */
|
||||
formatSubjectClassification(entry: DfgProjectSubjectArea): string {
|
||||
getClassificationParentSegments(entry: DFGProjectFachgebieteInner): string[] {
|
||||
return [
|
||||
entry.wissenschaftsbereich,
|
||||
entry.fachkollegium,
|
||||
entry.fachgebiet,
|
||||
entry.fach,
|
||||
]
|
||||
.filter((part) => !!part)
|
||||
.join(' › ');
|
||||
].filter((part): part is string => !!part);
|
||||
}
|
||||
|
||||
getClassificationLeafSegments(entry: DFGProjectFachgebieteInner): string[] {
|
||||
if (!entry.fach) return [];
|
||||
return entry.fach
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter((s) => !!s);
|
||||
}
|
||||
|
||||
// --- Subprojects & publications ---
|
||||
|
||||
@@ -27,17 +27,41 @@
|
||||
<mat-icon>open_in_new</mat-icon>
|
||||
</a>
|
||||
</ng-template>
|
||||
<ng-template #detailRowTmp let-element>
|
||||
<div class="classification-container">
|
||||
@for (classification of element.subject_classifications; track $index) {
|
||||
<p>
|
||||
{{ classification.wissenschaftsbereich || '-' }}
|
||||
→ {{ classification.fachkollegium || '-' }} →
|
||||
{{ classification.fachgebiet || '-' }} →
|
||||
{{ classification.fach || '-' }}
|
||||
</p>
|
||||
<ng-template #detailRowTmp let-project>
|
||||
@let classifications = getProjectClassifications(project);
|
||||
@let isClassificationsExpanded = isProjectClassificationsExpanded(project);
|
||||
@let visibleClassifications =
|
||||
isClassificationsExpanded ? classifications : classifications.slice(0, 3);
|
||||
<div
|
||||
class="classification-tags"
|
||||
aria-label="Fachsystematik"
|
||||
style="padding: 0.5rem 0.5rem">
|
||||
@for (classification of visibleClassifications; track $index) {
|
||||
<span
|
||||
class="publication-institution-tag classification-tag"
|
||||
[matTooltip]="getClassificationTooltipText(classification)"
|
||||
matTooltipPosition="above"
|
||||
[attr.aria-label]="getClassificationTooltipText(classification)">
|
||||
<mat-icon class="institution-icon">category</mat-icon>
|
||||
<span class="institution-name">{{
|
||||
getClassificationFullChain(classification)
|
||||
}}</span>
|
||||
</span>
|
||||
} @empty {
|
||||
<span>-</span>
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
@if (classifications.length > 3) {
|
||||
<button
|
||||
type="button"
|
||||
class="publication-institution-more"
|
||||
[attr.aria-expanded]="isClassificationsExpanded"
|
||||
(click)="toggleProjectClassificationsExpansion(project)">
|
||||
{{
|
||||
isClassificationsExpanded
|
||||
? 'weniger'
|
||||
: '+' + (classifications.length - 3)
|
||||
}}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
@@ -130,6 +130,7 @@
|
||||
|
||||
.topic-chips,
|
||||
.institution-tags,
|
||||
.classification-tags,
|
||||
.author-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -163,8 +164,16 @@
|
||||
// Classification container
|
||||
// ------------------------
|
||||
|
||||
.classification-container {
|
||||
max-width: 200px;
|
||||
.classification-tag {
|
||||
max-width: 280px;
|
||||
cursor: default; // not clickable/filterable, unlike author/institution tags
|
||||
|
||||
.institution-name {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
|
||||
@@ -360,4 +360,39 @@ export class DfgProjectTableComponent implements OnInit {
|
||||
|
||||
return this.expandedProjectTopicsId.includes(project.id);
|
||||
}
|
||||
expandedProjectClassificationsId: string[] = [];
|
||||
//classifications
|
||||
getProjectClassifications(project: DfgProjectSummary): any[] {
|
||||
return project.subject_classifications ?? [];
|
||||
}
|
||||
|
||||
isProjectClassificationsExpanded(project: DfgProjectSummary): boolean {
|
||||
if (!project.id) return false;
|
||||
|
||||
return this.expandedProjectClassificationsId.includes(project.id);
|
||||
}
|
||||
|
||||
toggleProjectClassificationsExpansion(project: DfgProjectSummary): void {
|
||||
if (!project.id) return;
|
||||
|
||||
if (this.expandedProjectClassificationsId.includes(project.id)) {
|
||||
this.expandedProjectClassificationsId =
|
||||
this.expandedProjectClassificationsId.filter((id) => id !== project.id);
|
||||
} else {
|
||||
this.expandedProjectClassificationsId.push(project.id);
|
||||
}
|
||||
}
|
||||
|
||||
getClassificationFullChain(classification: any): string {
|
||||
return [
|
||||
classification.wissenschaftsbereich || '-',
|
||||
classification.fachkollegium || '-',
|
||||
classification.fachgebiet || '-',
|
||||
classification.fach || '-',
|
||||
].join(' → ');
|
||||
}
|
||||
|
||||
getClassificationTooltipText(classification: any): string {
|
||||
return this.getClassificationFullChain(classification);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user