-
- Suche nach Themen
-
- search
-
-
+
+
@@ -24,24 +15,20 @@
+ queryParamSortKey="sort_by"
+ queryParamSortDirectionKey="sort_direction" />
+ queryParamSortKey="sort_by"
+ queryParamSortDirectionKey="sort_direction" />
-
+
@@ -94,3 +81,15 @@
{{ row.funding_amount | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }}
+
+
+
+ open_in_new
+
+
+
+
+ open_in_new
+
+
diff --git a/webapp/src/app/modules/institution-projects/institution-projects.component.ts b/webapp/src/app/modules/institution-projects/institution-projects.component.ts
index 4f547c61..94b16f46 100644
--- a/webapp/src/app/modules/institution-projects/institution-projects.component.ts
+++ b/webapp/src/app/modules/institution-projects/institution-projects.component.ts
@@ -4,22 +4,20 @@ import {
effect,
input,
OnInit,
- signal,
TemplateRef,
viewChild,
} from '@angular/core';
-import { ActivatedRoute, Router } from '@angular/router';
+import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import {
BundProject,
BundProjectPage,
- CordisEuProject,
- CordisEuProjectPage,
+ EuOrganizationProjectSummary,
+ EuOrganizationProjectSummaryPage,
InstitutionFunderSummary,
} from '../../api';
import { MatCardModule } from '@angular/material/card';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs';
-import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
import { FormsModule } from '@angular/forms';
import { MatInputModule } from '@angular/material/input';
import {
@@ -27,15 +25,16 @@ import {
DataTableComponent,
} from '../../shared/ui/data-table/data-table.component';
import { CurrencyPipe, DatePipe } from '@angular/common';
-import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
-import { Sort, SortDirection } from '@angular/material/sort';
-import { DebounceDirective } from '../../directives/debounce.directive';
+import { toSignal } from '@angular/core/rxjs-interop';
import { MatIconModule } from '@angular/material/icon';
import { MatButtonModule } from '@angular/material/button';
import { InstitutionProjectsFundingGraphComponent } from '../institution-projects-funding-graph/institution-projects-funding-graph.component';
import { PersonNetworkInfoCardComponent } from '../person-network-info-card/person-network-info-card.component';
+import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
+import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component';
type BundProjectRow = {
+ id: string;
topic: string;
funding_start: Date;
funding_end: Date;
@@ -44,6 +43,7 @@ type BundProjectRow = {
};
type EuProjectRow = {
+ id: string;
topic: string;
funding_start: Date;
funding_end: Date;
@@ -56,17 +56,18 @@ type EuProjectRow = {
MatCardModule,
MatFormFieldModule,
MatTabsModule,
- MatPaginatorModule,
FormsModule,
MatInputModule,
DataTableComponent,
DatePipe,
CurrencyPipe,
- DebounceDirective,
MatIconModule,
MatButtonModule,
InstitutionProjectsFundingGraphComponent,
PersonNetworkInfoCardComponent,
+ RouterModule,
+ QueryParamPaginatorComponent,
+ QueryParamInputComponent,
],
templateUrl: './institution-projects.component.html',
styleUrl: './institution-projects.component.scss',
@@ -76,13 +77,19 @@ export class InstitutionProjectsComponent implements OnInit {
fundingEndTmp = viewChild.required
>('fundingEndTmp');
fundingAmountTmp = viewChild.required>('fundingAmountTmp');
- cordisEuProjectPage = input.required();
+ cordisEuProjectPage = input.required();
euProjectColumns: GenericColumn[] = [];
euProjectData: EuProjectRow[] = [];
+ euProjectActionsTmp = viewChild.required>(
+ 'euProjectActionsTmp',
+ );
bundProjectPage = input.required();
bundProjectColumns: GenericColumn[] = [];
bundProjectData: BundProjectRow[] = [];
+ bundProjectActionsTmp = viewChild.required>(
+ 'bundProjectActionsTmp',
+ );
bundProjectsFunding = input.required();
bundTotalFunding = computed(() => {
@@ -108,24 +115,10 @@ export class InstitutionProjectsComponent implements OnInit {
return funding.annual_average_over_period ?? 0;
});
- urlSortKey = signal('');
- urlSortDirection = signal('');
- urlSearchTerm = signal('');
-
constructor(
private readonly activatedRoute: ActivatedRoute,
private readonly router: Router,
) {
- this.activatedRoute.queryParams
- .pipe(takeUntilDestroyed())
- .subscribe((params) => {
- this.urlSortKey.set(params['sort_by'] ?? '');
- this.urlSortDirection.set(
- (params['sort_direction'] as SortDirection) ?? '',
- );
- this.urlSearchTerm.set(params['search'] ?? '');
- });
-
effect(() => {
const euPage = this.cordisEuProjectPage();
if (euPage) {
@@ -142,20 +135,6 @@ export class InstitutionProjectsComponent implements OnInit {
: [];
}
});
-
- effect(() => {
- const searchTerm = this.urlSearchTerm();
- if (searchTerm) {
- this.router.navigate([], {
- queryParams: { search: searchTerm, page: 0, size: 10 },
- queryParamsHandling: 'merge',
- });
- }
- });
-
- effect(() => {
- console.log('Funding over time data:', this.bundProjectsFunding());
- });
}
readonly queryParams = toSignal(this.activatedRoute.queryParamMap, {
@@ -166,12 +145,6 @@ export class InstitutionProjectsComponent implements OnInit {
return this.queryParams()?.get('project_tab') ?? 'eu';
});
- readonly page = computed(() => {
- const pageParam = this.queryParams()?.get('page');
- const page = pageParam ? Number.parseInt(pageParam, 10) : 0;
- return Number.isNaN(page) ? 0 : page;
- });
-
readonly selectedPage = computed(() => {
if (this.displayedProjects() === 'eu') {
return this.cordisEuProjectPage();
@@ -184,14 +157,6 @@ export class InstitutionProjectsComponent implements OnInit {
return this.selectedPage()?.total ?? 0;
});
- readonly pageSize = computed(() => {
- return this.selectedPage()?.size ?? 10;
- });
-
- readonly pageIndex = computed(() => {
- return this.selectedPage()?.page ?? 0;
- });
-
ngOnInit(): void {
this.euProjectColumns = [
{
@@ -221,10 +186,16 @@ export class InstitutionProjectsComponent implements OnInit {
accessorKey: 'funding_amount',
cellTemplate: this.fundingAmountTmp(),
},
+ {
+ id: 'actions',
+ header: '',
+ type: 'display',
+ cellTemplate: this.euProjectActionsTmp(),
+ },
];
this.bundProjectColumns = [
{
- id: 'topic',
+ id: 'title',
header: 'Titel',
type: 'accessor',
accessorKey: 'topic',
@@ -250,22 +221,30 @@ export class InstitutionProjectsComponent implements OnInit {
accessorKey: 'funding_amount',
cellTemplate: this.fundingAmountTmp(),
},
+ {
+ id: 'actions',
+ header: '',
+ type: 'display',
+ cellTemplate: this.bundProjectActionsTmp(),
+ },
];
}
- transformEuRow(project: CordisEuProject): EuProjectRow {
+ transformEuRow(project: EuOrganizationProjectSummary): EuProjectRow {
return {
+ id: project.project_id,
topic: project.title || '',
- funding_start: project.startDate
- ? new Date(project.startDate)
+ funding_start: project.start_date
+ ? new Date(project.start_date)
: new Date(0),
- funding_end: project.endDate ? new Date(project.endDate) : new Date(0),
- funding_amount: Number(project.totalCost) || 0,
+ funding_end: project.end_date ? new Date(project.end_date) : new Date(0),
+ funding_amount: Number(project.ec_contribution) || 0,
};
}
transformBundRow(project: BundProject): BundProjectRow {
return {
+ id: project.funding_code || '',
topic: project.topic || '',
funding_start: project.funding_start
? new Date(project.funding_start)
@@ -296,32 +275,4 @@ export class InstitutionProjectsComponent implements OnInit {
queryParamsHandling: 'merge',
});
}
-
- handlePageChange(event: PageEvent): void {
- this.router.navigate([], {
- queryParams: { page: event.pageIndex, size: event.pageSize },
- queryParamsHandling: 'merge',
- });
- }
-
- handleSortChange(event: Sort): void {
- this.router.navigate([], {
- queryParams: { sort_by: event.active, sort_direction: event.direction },
- queryParamsHandling: 'merge',
- });
- }
-
- handleSearchTermChange(newTerm: string): void {
- this.router.navigate([], {
- queryParams: { search: newTerm, page: 0, size: 10 },
- queryParamsHandling: 'merge',
- });
- }
-
- clearSearchTerm(): void {
- this.router.navigate([], {
- queryParams: { search: null, page: 0, size: 10 },
- queryParamsHandling: 'merge',
- });
- }
}
diff --git a/webapp/src/app/modules/institutions/institutions.component.html b/webapp/src/app/modules/institutions/institutions.component.html
index 4702d7fe..ce12b7ed 100644
--- a/webapp/src/app/modules/institutions/institutions.component.html
+++ b/webapp/src/app/modules/institutions/institutions.component.html
@@ -4,34 +4,19 @@
-
- Suche nach Namen
-
- search
-
-
+
-
+
-
+
@@ -106,11 +91,7 @@
-
-
+
diff --git a/webapp/src/app/modules/institutions/institutions.component.scss b/webapp/src/app/modules/institutions/institutions.component.scss
index 95ff7534..7303fdd7 100644
--- a/webapp/src/app/modules/institutions/institutions.component.scss
+++ b/webapp/src/app/modules/institutions/institutions.component.scss
@@ -25,26 +25,10 @@
.cards {
display: grid;
gap: 1.5rem;
- grid-template-columns: repeat(4, 1fr);
+ grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
padding: 0 1rem;
}
-@media (max-width: 900px) {
- .cards {
- grid-template-columns: repeat(2, 1fr);
- }
-}
-
-@media (max-width: 600px) {
- .cards {
- grid-template-columns: 1fr;
- }
-}
-
-mat-paginator {
- background-color: var(--sg-background);
-}
-
.card {
padding: 0.5rem;
background-color: var(--sg-background);
diff --git a/webapp/src/app/modules/institutions/institutions.component.ts b/webapp/src/app/modules/institutions/institutions.component.ts
index e2449349..18eea25f 100644
--- a/webapp/src/app/modules/institutions/institutions.component.ts
+++ b/webapp/src/app/modules/institutions/institutions.component.ts
@@ -1,26 +1,28 @@
-import { Component, effect, input, signal } from '@angular/core';
+import { Component, input } from '@angular/core';
import { Institution, InstitutionPage } from '../../api';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
-import { MatInputModule } from '@angular/material/input';
-import { ActivatedRoute, Router, RouterModule } from '@angular/router';
-import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { RouterModule } from '@angular/router';
import { MatIconModule } from '@angular/material/icon';
-import { DebounceDirective } from '../../directives/debounce.directive';
-import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatDividerModule } from '@angular/material/divider';
+import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
+import {
+ QueryParamSelectorComponent,
+ SelectorOption,
+} from '../../shared/ui/query-param-selector/query-param-selector.component';
+import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component';
@Component({
selector: 'app-institutions',
imports: [
MatButtonModule,
MatCardModule,
- MatInputModule,
MatIconModule,
- DebounceDirective,
- MatPaginator,
MatDividerModule,
RouterModule,
+ QueryParamPaginatorComponent,
+ QueryParamSelectorComponent,
+ QueryParamInputComponent,
],
templateUrl: './institutions.component.html',
styleUrl: './institutions.component.scss',
@@ -28,74 +30,21 @@ import { MatDividerModule } from '@angular/material/divider';
export class InstitutionsComponent {
institutionPage = input.required
();
- urlSearchTerm = signal('');
- urlSortBy = signal('relevance');
- urlSortingOrder = signal('desc');
-
- constructor(
- private readonly activatedRoute: ActivatedRoute,
- private readonly router: Router,
- ) {
- this.activatedRoute.queryParams
- .pipe(takeUntilDestroyed())
- .subscribe((params) => {
- this.urlSearchTerm.set(params['search'] || '');
- this.urlSortBy.set(params['sort_by'] || 'relevance');
- this.urlSortingOrder.set(params['sorting_order'] || 'desc');
- });
-
- effect(() => {
- const searchTerm = this.urlSearchTerm();
- this.router.navigate([], {
- queryParams: { search: searchTerm },
- queryParamsHandling: 'merge',
- });
- });
- }
-
- handleSearchTermChange(newTerm: string): void {
- this.router.navigate([], {
- queryParams: { search: newTerm },
- queryParamsHandling: 'merge',
- });
- }
-
- clearSearchTerm(): void {
- this.router.navigate([], {
- queryParams: { search: null },
- queryParamsHandling: 'merge',
- });
- }
-
- handlePageChange(event: PageEvent): void {
- this.router.navigate([], {
- queryParams: { page: event.pageIndex, size: event.pageSize },
- queryParamsHandling: 'merge',
- });
- }
+ sortingOptions: SelectorOption[] = [
+ { value: 'relevance', display_name: 'Relevanz' },
+ { value: 'name', display_name: 'Name' },
+ { value: 'works_count', display_name: 'Anzahl Publikationen' },
+ { value: 'citations_count', display_name: 'Anzahl Zitationen' },
+ ];
+ sortingDirectionOptions: SelectorOption[] = [
+ { value: 'asc', display_name: 'Aufsteigend' },
+ { value: 'desc', display_name: 'Absteigend' },
+ ];
extractInstitutionId(institution: Institution): string {
return institution.id?.split('/').pop() ?? '';
}
- handleSortFieldChange(event: Event): void {
- const selectElement = event.target as HTMLSelectElement;
- const sortField = selectElement.value;
- this.router.navigate([], {
- queryParams: { sort_by: sortField },
- queryParamsHandling: 'merge',
- });
- }
-
- handleSortOrderChange(event: Event): void {
- const selectElement = event.target as HTMLSelectElement;
- const sortOrder = selectElement.value;
- this.router.navigate([], {
- queryParams: { sorting_order: sortOrder },
- queryParamsHandling: 'merge',
- });
- }
-
getDisplayName(institution: Institution): string {
const primary = institution.display_name?.trim();
if (primary && primary.length > 0) return primary;
diff --git a/webapp/src/app/modules/news-detail/news-detail.component.html b/webapp/src/app/modules/news-detail/news-detail.component.html
new file mode 100644
index 00000000..dc1a3fc0
--- /dev/null
+++ b/webapp/src/app/modules/news-detail/news-detail.component.html
@@ -0,0 +1,123 @@
+
+
+
+ @if (loading) {
+
+
+
Nachricht wird geladen...
+
+ } @else if (notFound || !article) {
+
+
search_off
+
Nachricht nicht gefunden
+
Der Artikel konnte nicht geladen werden.
+
Zur Personensuche
+
+ } @else {
+
+
+
+
+ @if (article.author) {
+ {{ article.author }}
+ }
+ @if (article.date) {
+ {{ formatDate(article.date) }}
+ }
+
+ {{ article.maintitle || 'Kein Titel' }}
+
+ @if (article.relevant === true) {
+
+ check_circle
+ Relevant
+
+ } @else if (article.relevant === false) {
+
+ cancel
+ Nicht relevant
+
+ } @else {
+
+ help
+ Relevanz nicht bestimmt
+
+ }
+
+
+
+ @if (article.full_content) {
+
{{ article.full_content }}
+ } @else {
+
Kein Inhalt verfügbar.
+ }
+
+
+ @if (article.url) {
+
+ }
+
+
+
+
+ }
+
diff --git a/webapp/src/app/modules/news-detail/news-detail.component.scss b/webapp/src/app/modules/news-detail/news-detail.component.scss
new file mode 100644
index 00000000..82f7b1ac
--- /dev/null
+++ b/webapp/src/app/modules/news-detail/news-detail.component.scss
@@ -0,0 +1,295 @@
+.detail-page {
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 28px 32px 64px;
+}
+
+.back-link {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ background: none;
+ border: none;
+ cursor: pointer;
+ font-size: 14px;
+ color: var(--sg-text-muted);
+ padding: 0;
+ margin-bottom: 32px;
+
+ &:hover {
+ color: var(--sg-text);
+ }
+
+ mat-icon {
+ font-size: 18px;
+ width: 18px;
+ height: 18px;
+ }
+}
+
+.state {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 16px;
+ padding: 80px 0;
+ text-align: center;
+ color: var(--sg-text-muted);
+
+ mat-icon {
+ font-size: 48px;
+ width: 48px;
+ height: 48px;
+ }
+
+ p {
+ margin: 0;
+ }
+}
+
+.error-state h2 {
+ margin: 0;
+}
+
+.detail-layout {
+ display: grid;
+ grid-template-columns: 1fr 280px;
+ gap: 40px;
+ align-items: start;
+}
+
+main {
+ min-width: 0;
+}
+
+.hero {
+ margin-bottom: 32px;
+}
+
+.eyebrow {
+ display: flex;
+ gap: 12px;
+ font-size: 13px;
+ color: var(--sg-text-muted);
+ margin-bottom: 12px;
+
+ span + span::before {
+ content: '·';
+ margin-right: 12px;
+ }
+}
+
+.article-heading {
+ margin: 0;
+ font-size: 28px;
+ font-weight: 700;
+ line-height: 1.3;
+}
+
+.relevance-badge {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ margin-top: 14px;
+ padding: 5px 12px;
+ border-radius: 999px;
+ font-size: 13px;
+ font-weight: 600;
+
+ mat-icon {
+ font-size: 16px;
+ width: 16px;
+ height: 16px;
+ }
+
+ &.is-relevant {
+ background: #effaf3;
+ border: 1px solid #bdebcf;
+ color: #24834f;
+ }
+
+ &.not-relevant {
+ background: var(--sg-surface-muted);
+ border: 1px solid #e2e2e2;
+ color: var(--sg-text-muted);
+ }
+
+ &.undetermined {
+ background: #fff7e8;
+ border: 1px solid #ffd796;
+ color: #c67500;
+ }
+}
+
+.article-body {
+ font-size: 15px;
+ line-height: 1.7;
+ color: var(--sg-text);
+}
+
+.content {
+ margin: 0;
+ white-space: pre-wrap;
+}
+
+.placeholder {
+ margin: 0;
+ color: var(--sg-text-muted);
+ font-style: italic;
+}
+
+.article-actions {
+ margin-top: 32px;
+}
+
+.sidebar {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+ position: sticky;
+ top: 24px;
+}
+
+.sidebar-card {
+ padding: 20px;
+ border: 1px solid #d7e4ff;
+ border-radius: 16px;
+ background: #ffffff;
+ box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
+
+ h3 {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ margin: 0 0 14px;
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--sg-text);
+
+ mat-icon {
+ font-size: 18px;
+ width: 18px;
+ height: 18px;
+ color: var(--sg-text-muted);
+ }
+ }
+}
+
+.person-list {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
+.person-item {
+ display: grid;
+ grid-template-columns: 38px minmax(0, 1fr) auto;
+ gap: 11px;
+ align-items: center;
+ padding: 12px;
+ border-radius: var(--sg-radius-sm);
+ background: var(--sg-surface-muted);
+}
+
+.person-item.is-link {
+ cursor: pointer;
+ text-decoration: none;
+ color: inherit;
+ transition: background 0.15s ease;
+}
+
+.person-item.is-link:hover {
+ background: #e5ecfb;
+}
+
+.person-item.is-muted {
+ .avatar {
+ background: #ececef;
+ color: var(--sg-text-muted);
+ }
+
+ .person-name {
+ color: var(--sg-text-muted);
+ }
+}
+
+.ude-badge {
+ justify-self: end;
+ padding: 3px 9px;
+ border-radius: 999px;
+ background: #effaf3;
+ border: 1px solid #bdebcf;
+ color: #24834f;
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: 0.03em;
+}
+
+.avatar {
+ display: grid;
+ place-items: center;
+ width: 38px;
+ height: 38px;
+ border-radius: 50%;
+ background: #e5ecfb;
+ color: var(--sg-text);
+ font-size: 15px;
+ font-weight: 700;
+ text-transform: uppercase;
+}
+
+.person-name {
+ color: var(--sg-text);
+ font-size: 13px;
+ font-weight: 700;
+}
+
+.chip-list {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+}
+
+.topic-chip {
+ display: inline-flex;
+ align-items: center;
+ padding: 6px 12px;
+ border: 1px solid var(--topic-border);
+ border-radius: 8px;
+ background: var(--topic-bg);
+ color: var(--topic-color);
+ font-size: 12px;
+ font-weight: 500;
+ line-height: 1.25;
+}
+
+.purple {
+ --topic-border: #d8cafe;
+ --topic-bg: #f6f0ff;
+ --topic-color: #7255d9;
+}
+
+.blue {
+ --topic-border: #bdd4ff;
+ --topic-bg: #f0f6ff;
+ --topic-color: #0b63ce;
+}
+
+.green {
+ --topic-border: #bdebcf;
+ --topic-bg: #effaf3;
+ --topic-color: #24834f;
+}
+
+.orange {
+ --topic-border: #ffd796;
+ --topic-bg: #fff7e8;
+ --topic-color: #c67500;
+}
+
+.pink {
+ --topic-border: #ffc7d7;
+ --topic-bg: #fff1f5;
+ --topic-color: #d12f61;
+}
diff --git a/webapp/src/app/modules/news-detail/news-detail.component.ts b/webapp/src/app/modules/news-detail/news-detail.component.ts
new file mode 100644
index 00000000..bd75dc3c
--- /dev/null
+++ b/webapp/src/app/modules/news-detail/news-detail.component.ts
@@ -0,0 +1,109 @@
+import { Component, DestroyRef, OnInit, inject } from '@angular/core';
+import { Location, NgClass } from '@angular/common';
+import { HttpClient } from '@angular/common/http';
+import { ActivatedRoute, RouterLink } from '@angular/router';
+import { MatButtonModule } from '@angular/material/button';
+import { MatIconModule } from '@angular/material/icon';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+
+import { WorksService } from '../../api';
+
+interface MentionedPerson {
+ name: string;
+ is_ude?: boolean;
+ person_id?: string | null;
+}
+
+interface NewsArticleDetail {
+ id: string;
+ date?: string | null;
+ maintitle?: string | null;
+ author?: string | null;
+ url?: string | null;
+ full_content?: string | null;
+ relevant?: boolean;
+ authors?: MentionedPerson[];
+}
+
+@Component({
+ selector: 'app-news-detail',
+ imports: [
+ MatButtonModule,
+ MatIconModule,
+ MatProgressSpinnerModule,
+ RouterLink,
+ NgClass,
+ ],
+ templateUrl: './news-detail.component.html',
+ styleUrl: './news-detail.component.scss',
+})
+export class NewsDetailComponent implements OnInit {
+ private readonly destroyRef = inject(DestroyRef);
+ private readonly route = inject(ActivatedRoute);
+ private readonly httpClient = inject(HttpClient);
+ private readonly worksService = inject(WorksService);
+ private readonly location = inject(Location);
+
+ article: NewsArticleDetail | null = null;
+ loading = false;
+ notFound = false;
+
+ readonly relevantTopics = [
+ 'Künstliche Intelligenz',
+ 'Maschinelles Lernen',
+ 'Digitalisierung',
+ 'Datenwissenschaft',
+ ];
+
+ private readonly chipColors = ['purple', 'blue', 'green', 'orange', 'pink'];
+
+ chipColor(index: number): string {
+ return this.chipColors[index % this.chipColors.length];
+ }
+
+ ngOnInit(): void {
+ this.route.paramMap
+ .pipe(takeUntilDestroyed(this.destroyRef))
+ .subscribe((params) => {
+ const id = params.get('id');
+ if (id) {
+ this.fetchArticle(id);
+ }
+ });
+ }
+
+ navigateBack(): void {
+ this.location.back();
+ }
+
+ formatDate(dateStr?: string | null): string {
+ if (!dateStr) return '-';
+ const date = new Date(dateStr);
+ if (isNaN(date.getTime())) return dateStr;
+ return new Intl.DateTimeFormat('de-DE', {
+ day: '2-digit',
+ month: 'long',
+ year: 'numeric',
+ }).format(date);
+ }
+
+ private fetchArticle(id: string): void {
+ this.loading = true;
+ this.notFound = false;
+ const basePath = this.worksService.configuration.basePath ?? '';
+ this.httpClient
+ .get(`${basePath}/api/news/${encodeURIComponent(id)}`)
+ .pipe(takeUntilDestroyed(this.destroyRef))
+ .subscribe({
+ next: (article) => {
+ this.article = article;
+ this.loading = false;
+ },
+ error: () => {
+ this.notFound = true;
+ this.loading = false;
+ },
+ });
+ }
+}
diff --git a/webapp/src/app/modules/news/news.component.html b/webapp/src/app/modules/news/news.component.html
new file mode 100644
index 00000000..aff9aadc
--- /dev/null
+++ b/webapp/src/app/modules/news/news.component.html
@@ -0,0 +1,110 @@
+
+
+
Nachrichten
+
Aktuelle Nachrichten aus Campus-Aktuell.
+
+
+
+
+ search
+
+
+
+ @if (!isSearching) {
+
+
+ Neueste zuerst
+ Älteste zuerst
+
+
+ }
+
+
+
+ @if (loading) {
+
+
+
+ }
+
+
+
+ | Titel |
+
+ {{
+ article.maintitle || 'Kein Titel'
+ }}
+ |
+
+
+
+ Fundstelle |
+
+ @if (article.snippet) {
+
+ } @else {
+ —
+ }
+ |
+
+
+
+ Relevanz |
+
+ @if (article.relevant === true) {
+
+ check_circle
+ Relevant
+
+ } @else if (article.relevant === false) {
+
+ cancel
+ Nicht relevant
+
+ } @else {
+
+ help
+ Nicht bestimmt
+
+ }
+ |
+
+
+
+ Datum |
+
+ {{ formatDate(article.date) }}
+ |
+
+
+
+
+
+
+ @if (!loading && articles.length === 0) {
+
+ @if (isSearching) {
+ Keine Ergebnisse für „{{ searchControl.value.trim() }}" gefunden.
+ } @else {
+ Keine Nachrichten gefunden.
+ }
+
+ }
+
+
+
+
diff --git a/webapp/src/app/modules/news/news.component.scss b/webapp/src/app/modules/news/news.component.scss
new file mode 100644
index 00000000..100dead9
--- /dev/null
+++ b/webapp/src/app/modules/news/news.component.scss
@@ -0,0 +1,209 @@
+.page {
+ padding: 28px 32px 42px;
+ max-width: 100%;
+ margin: 0 auto;
+}
+
+h6 {
+ margin: 0 0 6px;
+ font-size: 22px;
+ line-height: 1.2;
+ font-weight: 700;
+}
+
+.page > div:first-child p {
+ margin: 0;
+ color: var(--sg-text-muted);
+ font-size: 14px;
+}
+
+.news-toolbar {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 12px;
+ padding-top: 10px;
+ padding-bottom: 25px;
+}
+
+.search-field {
+ max-width: 480px;
+}
+
+::ng-deep .news-toolbar .mat-mdc-form-field-subscript-wrapper {
+ display: none;
+}
+
+::ng-deep .news-toolbar .mat-mdc-text-field-wrapper {
+ height: 42px;
+ background: #fff;
+ border-radius: var(--sg-radius-sm);
+}
+
+::ng-deep .news-toolbar .mat-mdc-form-field-infix {
+ min-height: unset;
+ height: 42px;
+ padding: 0;
+ display: flex;
+ align-items: center;
+}
+
+::ng-deep .news-toolbar .mdc-notched-outline__leading,
+::ng-deep .news-toolbar .mdc-notched-outline__notch,
+::ng-deep .news-toolbar .mdc-notched-outline__trailing {
+ border-color: #d9e2f0;
+}
+
+::ng-deep .news-toolbar input.mat-mdc-input-element {
+ color: var(--sg-text);
+ font-size: 14px;
+}
+
+::ng-deep .news-toolbar input.mat-mdc-input-element::placeholder {
+ color: var(--sg-text-muted);
+ opacity: 1;
+ font-size: 14px;
+}
+
+.sort-field {
+ width: 180px;
+}
+
+.table-wrap {
+ position: relative;
+ overflow-x: auto;
+}
+
+table {
+ width: 100%;
+ min-width: 600px;
+ border-collapse: separate;
+ border-spacing: 0 10px;
+ background: transparent;
+ box-shadow: none;
+}
+
+.article-title {
+ display: inline-block;
+ max-width: 520px;
+ line-height: 1.35;
+ color: var(--sg-text);
+ font-size: 14px;
+ font-weight: 700;
+ text-decoration: none;
+
+ &:hover {
+ color: var(--sg-text);
+ text-decoration: underline;
+ }
+}
+
+.loading {
+ position: absolute;
+ inset: 0;
+ z-index: 1;
+ display: grid;
+ place-items: center;
+ background: rgba(255, 255, 255, 0.65);
+}
+
+.empty-state {
+ padding: 28px;
+ text-align: center;
+ color: rgba(0, 0, 0, 0.6);
+ background: transparent;
+}
+
+.snippet {
+ color: var(--sg-text-muted);
+ font-size: 13px;
+ line-height: 1.4;
+}
+
+::ng-deep .snippet em {
+ font-style: normal;
+ background: #fff48d;
+ padding: 0 3px;
+ border-radius: 3px;
+}
+
+.snippet-empty {
+ color: var(--sg-text-muted);
+}
+
+.relevance-badge {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ padding: 5px 12px;
+ border-radius: 999px;
+ font-size: 13px;
+ font-weight: 600;
+ line-height: 1;
+ white-space: nowrap;
+
+ mat-icon {
+ font-size: 16px;
+ width: 16px;
+ height: 16px;
+ }
+
+ &.is-relevant {
+ background: #effaf3;
+ border: 1px solid #bdebcf;
+ color: #24834f;
+ }
+
+ &.not-relevant {
+ background: var(--sg-surface-muted);
+ border: 1px solid #e2e2e2;
+ color: var(--sg-text-muted);
+ }
+
+ &.undetermined {
+ background: #fff7e8;
+ border: 1px solid #ffd796;
+ color: #c67500;
+ }
+}
+
+::ng-deep .mat-mdc-header-cell {
+ color: var(--sg-text-muted);
+ font-size: 12px;
+ font-weight: 700;
+}
+
+::ng-deep .mat-mdc-row {
+ height: 72px;
+}
+
+::ng-deep .mat-mdc-cell {
+ color: var(--sg-text);
+ border-bottom-color: var(--sg-border);
+ font-size: 13px;
+}
+
+mat-paginator {
+ background: transparent;
+}
+
+.table-footer {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ min-height: 66px;
+ padding: 0 22px 0 28px;
+ color: var(--sg-text-muted);
+ font-size: 13px;
+}
+
+@media (max-width: 600px) {
+ .page {
+ padding: 16px;
+ }
+
+ .table-footer {
+ align-items: stretch;
+ flex-direction: column;
+ }
+}
diff --git a/webapp/src/app/modules/news/news.component.ts b/webapp/src/app/modules/news/news.component.ts
new file mode 100644
index 00000000..3c1ff74c
--- /dev/null
+++ b/webapp/src/app/modules/news/news.component.ts
@@ -0,0 +1,219 @@
+import { Component, DestroyRef, OnInit, inject } from '@angular/core';
+import { HttpClient, HttpParams } from '@angular/common/http';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { ActivatedRoute, Router, RouterLink } from '@angular/router';
+import { MatIconModule } from '@angular/material/icon';
+import { MatSelectModule } from '@angular/material/select';
+import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
+import { MatTableModule } from '@angular/material/table';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { MatInputModule } from '@angular/material/input';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { debounceTime, distinctUntilChanged } from 'rxjs';
+
+import { WorksService } from '../../api';
+import { PaginationService } from '../../shared/services/pagination.service';
+
+interface NewsArticle {
+ id: string;
+ date?: string | null;
+ maintitle?: string | null;
+ author?: string | null;
+ url?: string | null;
+ relevant?: boolean | null;
+ snippet?: string | null;
+}
+
+interface NewsPage {
+ total: number;
+ page: number;
+ page_size: number;
+ results: NewsArticle[];
+}
+
+type SortOrder = 'desc' | 'asc';
+const DEFAULT_SORT_ORDER: SortOrder = 'desc';
+
+@Component({
+ selector: 'app-news',
+ imports: [
+ MatIconModule,
+ MatSelectModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ MatProgressSpinnerModule,
+ MatTableModule,
+ ReactiveFormsModule,
+ RouterLink,
+ ],
+ templateUrl: './news.component.html',
+ styleUrl: './news.component.scss',
+})
+export class NewsComponent implements OnInit {
+ private readonly destroyRef = inject(DestroyRef);
+ private readonly route = inject(ActivatedRoute);
+ private readonly router = inject(Router);
+ private readonly httpClient = inject(HttpClient);
+ private readonly worksService = inject(WorksService);
+ readonly paginationService = inject(PaginationService);
+
+ readonly searchControl = new FormControl('', { nonNullable: true });
+
+ get displayedColumns(): string[] {
+ if (this.isSearching) {
+ return ['maintitle', 'snippet', 'relevance', 'date'];
+ }
+ return ['maintitle', 'relevance', 'date'];
+ }
+
+ articles: NewsArticle[] = [];
+ total = 0;
+ loading = false;
+
+ currentPage = 1;
+ sortOrder: SortOrder = DEFAULT_SORT_ORDER;
+
+ get isSearching(): boolean {
+ return this.searchControl.value.trim().length > 0;
+ }
+
+ ngOnInit(): void {
+ this.route.queryParamMap
+ .pipe(takeUntilDestroyed(this.destroyRef))
+ .subscribe((params) => {
+ this.currentPage = this.parsePage(params.get('page'));
+ this.paginationService.selection = this.parsePageSize(
+ params.get('pageSize'),
+ );
+ this.sortOrder = this.parseSortOrder(params.get('sortOrder'));
+ this.searchControl.setValue(params.get('q') ?? '', {
+ emitEvent: false,
+ });
+ this.load();
+ });
+
+ this.searchControl.valueChanges
+ .pipe(
+ debounceTime(300),
+ distinctUntilChanged(),
+ takeUntilDestroyed(this.destroyRef),
+ )
+ .subscribe((query) => {
+ this.router.navigate([], {
+ relativeTo: this.route,
+ queryParams: { q: query.trim() || null, page: 1 },
+ queryParamsHandling: 'merge',
+ });
+ });
+ }
+
+ load(): void {
+ this.loading = true;
+ const query = this.searchControl.value.trim();
+ const basePath = this.worksService.configuration.basePath ?? '';
+
+ if (query) {
+ const params = new HttpParams()
+ .set('query', query)
+ .set('page', this.currentPage)
+ .set('pageSize', this.paginationService.selection);
+
+ this.httpClient
+ .get(`${basePath}/api/news/search`, { params })
+ .subscribe({
+ next: (page) => {
+ this.articles = page.results ?? [];
+ this.total = page.total ?? 0;
+ this.loading = false;
+ },
+ error: () => {
+ this.articles = [];
+ this.total = 0;
+ this.loading = false;
+ },
+ });
+ } else {
+ const params = new HttpParams()
+ .set('page', this.currentPage)
+ .set('pageSize', this.paginationService.selection)
+ .set('sortOrder', this.sortOrder);
+
+ this.httpClient
+ .get(`${basePath}/api/news`, { params })
+ .subscribe({
+ next: (page) => {
+ this.articles = page.results ?? [];
+ this.total = page.total ?? 0;
+ this.loading = false;
+ },
+ error: () => {
+ this.articles = [];
+ this.total = 0;
+ this.loading = false;
+ },
+ });
+ }
+ }
+
+ onPage(event: PageEvent): void {
+ this.router.navigate([], {
+ relativeTo: this.route,
+ queryParams: {
+ page: event.pageIndex + 1,
+ pageSize: event.pageSize,
+ },
+ queryParamsHandling: 'merge',
+ });
+ }
+
+ onSortChange(order: SortOrder): void {
+ this.router.navigate([], {
+ relativeTo: this.route,
+ queryParams: {
+ sortOrder: order,
+ page: 1,
+ },
+ queryParamsHandling: 'merge',
+ });
+ }
+
+ formatDate(dateStr?: string | null): string {
+ if (!dateStr) return '-';
+ const date = new Date(dateStr);
+ if (isNaN(date.getTime())) return dateStr;
+ return new Intl.DateTimeFormat('de-DE').format(date);
+ }
+
+ articleRange(): string {
+ if (this.total === 0) return 'Keine Nachrichten gefunden';
+ const pageSize = this.paginationService.selection;
+ const start = (this.currentPage - 1) * pageSize + 1;
+ const end = Math.min(start + this.articles.length - 1, this.total);
+ return `Zeige ${start} bis ${end} von ${this.total} Nachrichten`;
+ }
+
+ private parsePage(value: string | null): number {
+ const page = Number.parseInt(value ?? '', 10);
+ if (Number.isNaN(page) || page < 1) {
+ return 1;
+ }
+ return page;
+ }
+
+ private parsePageSize(value: string | null): number {
+ const pageSize = Number.parseInt(value ?? '', 10);
+ if (this.paginationService.options.includes(pageSize)) {
+ return pageSize;
+ }
+ return 10;
+ }
+
+ private parseSortOrder(value: string | null): SortOrder {
+ if (value === 'asc' || value === 'desc') {
+ return value;
+ }
+ return DEFAULT_SORT_ORDER;
+ }
+}
diff --git a/webapp/src/app/modules/person-card/person-card.component.html b/webapp/src/app/modules/person-card/person-card.component.html
index 03c91185..e07bb800 100644
--- a/webapp/src/app/modules/person-card/person-card.component.html
+++ b/webapp/src/app/modules/person-card/person-card.component.html
@@ -1,8 +1,8 @@
-
@@ -66,3 +58,25 @@
+
+