Skip to content

Commit

Permalink
structure biographies, rename component, correct headlines
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijeinath committed Dec 8, 2023
1 parent 7d181bd commit d874b3d
Show file tree
Hide file tree
Showing 11 changed files with 723 additions and 109 deletions.
4 changes: 2 additions & 2 deletions src/app/app.module.ts
Expand Up @@ -63,7 +63,7 @@ import { ManuscriptEntryComponent } from './resource/manuscript-entry/manuscript
import { TeiLinkDirective } from './directives/tei-link.directive';
import { CommentComponent } from './resource/comment/comment.component';
import { HttpClientModule } from '@angular/common/http';
import { BibliographyComponent } from './bibliography/bibliography.component';
import { BiographyComponent } from './biography/biography.component';

@NgModule({
declarations: [
Expand Down Expand Up @@ -101,7 +101,7 @@ import { BibliographyComponent } from './bibliography/bibliography.component';
TeiLinkDirective,
CommentComponent,
PublishedLetterComponent,
BibliographyComponent,
BiographyComponent,
],
imports: [
AppRouting,
Expand Down
6 changes: 3 additions & 3 deletions src/app/app.routing.ts
Expand Up @@ -23,7 +23,7 @@ import { BebbRouteComponent } from './bebb-route/bebb-route.component';
import { TranscriptionComponent } from './resource/transcription/transcription.component';
import { ManuscriptEntryComponent } from './resource/manuscript-entry/manuscript-entry.component';
import { CommentComponent } from './resource/comment/comment.component';
import { BibliographyComponent } from './bibliography/bibliography.component';
import { BiographyComponent } from './biography/biography.component';


const appRoutes: Routes = [
Expand All @@ -32,8 +32,8 @@ const appRoutes: Routes = [
component: LandingPageComponent,
},
{
path: 'bibliography/:person',
component: BibliographyComponent,
path: 'biography/:person',
component: BiographyComponent,
pathMatch: 'full'
},
{
Expand Down
32 changes: 0 additions & 32 deletions src/app/bibliography/bibliography.component.html

This file was deleted.

Empty file.
47 changes: 0 additions & 47 deletions src/app/bibliography/bibliography.component.ts

This file was deleted.

210 changes: 210 additions & 0 deletions src/app/biography/biography.component.html
@@ -0,0 +1,210 @@
<div class="full-size scroll-y-only">

<dsp-progress-indicator *ngIf="isLoading" [color]="'#D88958'"></dsp-progress-indicator>

<div *ngIf="!isLoading && props">

<div class="sidebar">
<button mat-stroked-button class="previousBtn" (click)="location.back()">
<mat-icon>arrow_back</mat-icon>
Previous
</button>
</div>

<div class="main-content" [ngSwitch]="name">

<ng-container *ngSwitchCase="'Jacob I Bernoulli'">
<h1 *ngIf="name">{{name}}</h1>
<section class="biography">
<h2>Biography</h2>
<img src="assets/images/leibniz.jpeg" alt="portrait of Jacob I Bernoulli">
<p>[...]</p>
</section>

<mat-divider></mat-divider>

<section>
<h2>Diaries</h2>
<mat-card class="intro-card" appearance="outlined"
(click)="searchForManuscriptEntries('http://rdfh.ch/0801/HSmk8KWbQjy6YCqnBrwYgA')">
<mat-card-content>Meditationes</mat-card-content>
</mat-card>
<mat-card class="intro-card" appearance="outlined">
<!-- TODO: calling searchForManuscriptEntries() with url of 'Reisbüchlein' -->
<mat-card-content>Reisbüchlein</mat-card-content>
</mat-card>
</section>
</ng-container>

<ng-container *ngSwitchCase="'Daniel I Bernoulli'">
<h1 *ngIf="name">{{name}}</h1>
<section class="biography">
<h2>Biography</h2>
<img src="assets/images/leibniz.jpeg" alt="portrait of Daniel Bernoulli">
<p>[...]</p>
</section>

<mat-divider></mat-divider>

<section>
<p>Correspondence between
<strong>{{correspondences_Daniel_I_Bernoulli.mainCorrespondent.name}}</strong> and
<!-- select list to choose the recipient name (among one or several choices) -->
<mat-form-field>
<mat-select placeholder="Select Correspondent">
<ng-container *ngFor="let section of correspondences_Daniel_I_Bernoulli.sections">
<mat-option *ngFor="let corr of section.correspondences" [value]="corr.correspondent2.name"
(click)="searchForCorrespondence(corr.correspondent1.gnd, corr.correspondent2.gnd)">
{{corr.correspondent2.name}}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</p>
</section>
</ng-container>

<ng-container *ngSwitchCase="'Johann I Bernoulli'">
<h1 *ngIf="name">{{name}}</h1>
<section class="biography">
<h2>Biography</h2>
<img src="assets/images/leibniz.jpeg" alt="portrait of Johann I Bernoulli">
<p>[...]</p>
</section>

<mat-divider></mat-divider>

<section>
<p>Correspondence between
<strong>{{correspondences_Johann_I_Bernoulli.mainCorrespondent.name}}</strong> and
<!-- select list to choose the recipient name (among one or several choices) -->
<mat-form-field>
<mat-select placeholder="Select Correspondent">
<ng-container *ngFor="let section of correspondences_Johann_I_Bernoulli.sections">
<mat-option *ngFor="let corr of section.correspondences" [value]="corr.correspondent2.name"
(click)="searchForCorrespondence(corr.correspondent1.gnd, corr.correspondent2.gnd)">
{{corr.correspondent2.name}}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</p>
</section>
</ng-container>

<ng-container *ngSwitchCase="'Johann II Bernoulli'">
<h1 *ngIf="name">{{name}}</h1>
<section class="biography">
<h2>Biography</h2>
<img src="assets/images/leibniz.jpeg" alt="portrait of Johann II Bernoulli">
<p>[...]</p>
</section>

<mat-divider></mat-divider>

<section>
<p>Correspondence between
<strong>{{correspondences_Johann_II_Bernoulli.mainCorrespondent.name}}</strong> and
<!-- select list to choose the recipient name (among one or several choices) -->
<mat-form-field>
<mat-select placeholder="Select Correspondent">
<ng-container *ngFor="let section of correspondences_Johann_II_Bernoulli.sections">
<mat-option *ngFor="let corr of section.correspondences" [value]="corr.correspondent2.name"
(click)="searchForCorrespondence(corr.correspondent1.gnd, corr.correspondent2.gnd)">
{{corr.correspondent2.name}}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</p>
</section>
</ng-container>

<ng-container *ngSwitchCase="'Nicolaus I Bernoulli'">
<h1 *ngIf="name">{{name}}</h1>
<section class="biography">
<h2>Biography</h2>
<img src="assets/images/leibniz.jpeg" alt="portrait of Nicolaus I Bernoulli">
<p>[...]</p>
</section>

<mat-divider></mat-divider>

<section>
<p>Correspondence between
<strong>{{correspondences_Nicolaus_I_Bernoulli.mainCorrespondent.name}}</strong> and
<!-- select list to choose the recipient name (among one or several choices) -->
<mat-form-field>
<mat-select placeholder="Select Correspondent">
<ng-container *ngFor="let section of correspondences_Nicolaus_I_Bernoulli.sections">
<mat-option *ngFor="let corr of section.correspondences" [value]="corr.correspondent2.name"
(click)="searchForCorrespondence(corr.correspondent1.gnd, corr.correspondent2.gnd)">
{{corr.correspondent2.name}}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</p>
</section>
</ng-container>

<ng-container *ngSwitchCase="'Nicolaus II Bernoulli'">
<h1 *ngIf="name">{{name}}</h1>
<section class="biography">
<h2>Biography</h2>
<img src="assets/images/leibniz.jpeg" alt="portrait of Nicolaus II Bernoulli">
<p>[...]</p>
</section>

<mat-divider></mat-divider>

<section>
<p>Correspondence between
<strong>{{correspondences_Nicolaus_II_Bernoulli.mainCorrespondent.name}}</strong> and
<!-- select list to choose the recipient name (among one or several choices) -->
<mat-form-field>
<mat-select placeholder="Select Correspondent">
<ng-container *ngFor="let section of correspondences_Nicolaus_II_Bernoulli.sections">
<mat-option *ngFor="let corr of section.correspondences" [value]="corr.correspondent2.name"
(click)="searchForCorrespondence(corr.correspondent1.gnd, corr.correspondent2.gnd)">
{{corr.correspondent2.name}}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</p>
</section>
</ng-container>

<ng-container *ngSwitchCase="'Jacob Hermann'">
<h1 *ngIf="name">{{name}}</h1>
<section class="biography">
<h2>Biography</h2>
<img src="assets/images/leibniz.jpeg" alt="portrait of Jacob Hermann">
<p>[...]</p>
</section>

<mat-divider></mat-divider>

<section>
<p>Correspondence between
<strong>{{correspondences_Jacob_Hermann.mainCorrespondent.name}}</strong> and
<!-- select list to choose the recipient name (among one or several choices) -->
<mat-form-field>
<mat-select placeholder="Select Correspondent">
<ng-container *ngFor="let section of correspondences_Jacob_Hermann.sections">
<mat-option *ngFor="let corr of section.correspondences" [value]="corr.correspondent2.name"
(click)="searchForCorrespondence(corr.correspondent1.gnd, corr.correspondent2.gnd)">
{{corr.correspondent2.name}}
</mat-option>
</ng-container>
</mat-select>
</mat-form-field>
</p>
</section>
</ng-container>

</div>
</div>

</div>
13 changes: 13 additions & 0 deletions src/app/biography/biography.component.scss
@@ -0,0 +1,13 @@
img {
float: right;
}

.biography {
margin-block-end: 1.5rem;
}

.biography::after {
content: "";
clear: both;
display: table;
}
@@ -1,12 +1,12 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { BibliographyComponent } from './bibliography.component';
import { BiographyComponent } from './biography.component';
import { RouterTestingModule } from '@angular/router/testing';
import { BeolService } from '../services/beol.service';
import { AppInitService } from '../dsp-ui-lib/core';

describe('BibliographyComponent', () => {
let component: BibliographyComponent;
let fixture: ComponentFixture<BibliographyComponent>;
let component: BiographyComponent;
let fixture: ComponentFixture<BiographyComponent>;

beforeEach(waitForAsync(() => {

Expand All @@ -22,15 +22,15 @@ describe('BibliographyComponent', () => {
imports: [
RouterTestingModule,
],
declarations: [BibliographyComponent],
declarations: [BiographyComponent],
providers: [
{ provide: BeolService, useValue: beolServiceSpy },
{ provide: AppInitService, useValue: appInitServiceMock }
]
})
.compileComponents();

fixture = TestBed.createComponent(BibliographyComponent);
fixture = TestBed.createComponent(BiographyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));
Expand Down

0 comments on commit d874b3d

Please sign in to comment.