Skip to content

Commit

Permalink
document: adapt display of field "notes"
Browse files Browse the repository at this point in the history
* Creates a pipe to display the field "notes".
* Corrects detail view accordingly.

Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
  • Loading branch information
Alicia Zangger committed Jun 22, 2020
1 parent 5e5a75a commit bc720d6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
6 changes: 4 additions & 2 deletions projects/admin/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { LOCALE_ID, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
Expand All @@ -42,6 +42,7 @@ import { MenuComponent } from './menu/menu.component';
import { BioInformationsPipe } from './pipe/bio-informations.pipe';
import { BirthDatePipe } from './pipe/birth-date.pipe';
import { MefTitlePipe } from './pipe/mef-title.pipe';
import { NotesFormatPipe } from './pipe/notes-format.pipe';
import { AcquisitionOrderBriefViewComponent } from './record/brief-view/acquisition-order-brief-view.component';
import { BudgetsBriefViewComponent } from './record/brief-view/budgets-brief-view.component';
import { CircPoliciesBriefViewComponent } from './record/brief-view/circ-policies-brief-view.component';
Expand Down Expand Up @@ -184,7 +185,8 @@ import { SharedPipesModule } from './shared/shared-pipes.module';
SerialHoldingItemComponent,
SerialHoldingDetailViewComponent,
HoldingDetailViewComponent,
DefaultHoldingItemComponent
DefaultHoldingItemComponent,
NotesFormatPipe
],
imports: [
AppRoutingModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,41 +201,43 @@ <h3>{{ altgr_title }}</h3>
</ng-container>

<!-- NOTES -->
<ng-container *ngIf="record.metadata.notes_text && record.metadata.notes_text.general">
<ng-container *ngIf="record.metadata.note && record.metadata.note.length > 0 && record.metadata.note | notesFormat as notes">
<ng-container *ngIf="notes.general">
<dt class="col-sm-4 offset-sm-2 offset-md-0" translate>
Note
</dt>
<dd [ngClass]="ddCssClass">
<ul class="list-unstyled mb-0">
<li
*ngFor="let note of record.metadata.notes_text.general"
*ngFor="let note of notes.general"
>{{ note }}</li>
</ul>
</dd>
</ng-container>
<ng-container *ngIf="record.metadata.notes_text && record.metadata.notes_text.otherPhysicalDetails">
<dt class="col-sm-4 offset-sm-2 offset-md-0" translate>
Physical details
</dt>
<dd [ngClass]="ddCssClass">
<ul class="list-unstyled mb-0">
<li
*ngFor="let note of record.metadata.notes_text.otherPhysicalDetails"
>{{ note }}</li>
</ul>
</dd>
</ng-container>
<ng-container *ngIf="record.metadata.notes_text && record.metadata.notes_text.accompanyingMaterial">
<dt class="col-sm-4 offset-sm-2 offset-md-0" translate>
Accompanying material
</dt>
<dd [ngClass]="ddCssClass">
<ul class="list-unstyled mb-0">
<li
*ngFor="let note of record.metadata.notes_text.accompanyingMaterial"
>{{ note }}</li>
</ul>
</dd>
</ng-container>
<ng-container *ngIf="notes.otherPhysicalDetails">
<dt class="col-sm-4 offset-sm-2 offset-md-0" translate>
Physical details
</dt>
<dd [ngClass]="ddCssClass">
<ul class="list-unstyled mb-0">
<li
*ngFor="let note of notes.otherPhysicalDetails"
>{{ note }}</li>
</ul>
</dd>
</ng-container>
<ng-container *ngIf="notes.accompanyingMaterial">
<dt class="col-sm-4 offset-sm-2 offset-md-0" translate>
Accompanying material
</dt>
<dd [ngClass]="ddCssClass">
<ul class="list-unstyled mb-0">
<li
*ngFor="let note of notes.accompanyingMaterial"
>{{ note }}</li>
</ul>
</dd>
</ng-container>
</ng-container>

<!-- SERIES -->
Expand Down

0 comments on commit bc720d6

Please sign in to comment.