Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document: fix collection display #885

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -253,22 +253,6 @@ export class DocumentDetailViewComponent implements DetailRecord, OnInit, OnDest
}
}

/**
* Get short main title
* @param titles - document titles
* @return - main title to display
*/
getShortMainTitle(titles: any) {
const bfTitles: Array<any> = titles.filter((title: any) => title.type === 'bf:Title');
for (const bfTitle of bfTitles) {
for (const mainTitle of bfTitle.mainTitle) {
if (!mainTitle.language) {
return mainTitle.value;
}
}
}
}

contributionTypeParam(contribution: any) {
switch (contribution.type) {
case 'bf:Person':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
<b>{{ getPartOfLabel(hostDocument) }}</b>:
<ng-container *ngIf="isPublicView; else adminLink">
<a id="{{ 'doc-part-of-' + i }}" href="/{{ viewcode }}/documents/{{ partOf.document.pid }}">
{{ getShortMainTitle(hostDocument.metadata.title) }}
{{ hostDocument.metadata.title | mainTitle }}
</a>
</ng-container>
<ng-template #adminLink>
<a id="{{ 'doc-part-of-' + i }}" [routerLink]="['/records', 'documents', 'detail', partOf.document.pid]">
{{ getShortMainTitle(hostDocument.metadata.title) }}
{{ hostDocument.metadata.title | mainTitle }}
</a>
</ng-template>
<ng-container *ngIf="partOf.numbering">
Expand Down Expand Up @@ -58,12 +58,12 @@
<div class="row">
<ng-container *ngIf="isPublicView; else adminLink">
<a id="{{ 'doc-part-of-' + i }}" href="/{{ viewcode }}/documents/{{ document.document.pid }}">
{{ getShortMainTitle(hostDocument.metadata.title) }}
{{ hostDocument.metadata.title | mainTitle }}
</a>
</ng-container>
<ng-template #adminLink>
<a id="{{ 'doc-part-of-' + i }}" [routerLink]="['/records', 'documents', 'detail', document.document.pid]">
{{ getShortMainTitle(hostDocument.metadata.title) }}
{{ hostDocument.metadata.title | mainTitle }}
</a>
</ng-template>
<ng-container *ngIf="document.numbering">
Expand Down
16 changes: 0 additions & 16 deletions projects/shared/src/lib/view/brief/part-of/part-of.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@ export class PartOfComponent {
}
}

/**
* Get short main title
* @param titles - document titles
* @return - main title to display
*/
getShortMainTitle(titles: any) {
const bfTitles: Array<any> = titles.filter((title: any) => title.type === 'bf:Title');
for (const bfTitle of bfTitles) {
for (const mainTitle of bfTitle.mainTitle) {
if (!mainTitle.language) {
return mainTitle.value;
}
}
}
}

/**
* Format "part of" numbering for display
*
Expand Down