40416: solved collections issue on item page

This commit is contained in:
Lotte Hofstede
2017-05-08 10:20:59 +02:00
parent 57aa58ac56
commit 176c498770
9 changed files with 14 additions and 10 deletions

View File

@@ -17,7 +17,8 @@
"abstract": "Abstract", "abstract": "Abstract",
"date": "Date", "date": "Date",
"uri": "URI", "uri": "URI",
"files": "Files" "files": "Files",
"collections": "Collections"
} }
}, },

View File

@@ -1,7 +1,7 @@
<ds-metadata-field-wrapper [label]="label | translate"> <ds-metadata-field-wrapper [label]="label | translate">
<div class="collections"> <div class="collections">
<a *ngFor="let collection of collections" [href]="(collection)?.self"> <a *ngFor="let collection of collections; let last=last;" [href]="(collection | async)?.self">
<span>{{(collection)?.name}}</span> <span>{{(collection | async)?.name}}</span><span *ngIf="!last" [innerHTML]="separator"></span>
</a> </a>
</div> </div>
</ds-metadata-field-wrapper> </ds-metadata-field-wrapper>

View File

@@ -11,6 +11,7 @@ export class CollectionsComponent implements OnInit {
@Input() item: Item; @Input() item: Item;
label : string = "item.page.collections"; label : string = "item.page.collections";
separator: string = "<br/>"
collections: Array<Observable<Collection>>; collections: Array<Observable<Collection>>;
constructor() { constructor() {
@@ -23,7 +24,7 @@ export class CollectionsComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.collections = this.item.getCollections(); this.collections = this.item.getCollections();
this.collections[0].subscribe(d => console.log("TEST TEST LOREM IPSUM LALALALAL")); this.collections[0].subscribe(d => console.log(d.name));
} }

View File

@@ -1,8 +1,9 @@
<ds-metadata-field-wrapper [label]="label | translate"> <ds-metadata-field-wrapper [label]="label | translate">
<div class="file-section"> <div class="file-section">
<a *ngFor="let file of (files | async)" [href]="(file | async)?.retrieve"> <a *ngFor="let file of (files | async); let last=last;" [href]="(file | async)?.retrieve">
<span>{{(file | async)?.name}}</span> <span>{{(file | async)?.name}}</span>
<span>({{((file | async)?.size) | dsFileSize }})</span> <span>({{((file | async)?.size) | dsFileSize }})</span>
<span *ngIf="!last" innerHTML="{{separator}}"></span>
</a> </a>
</div> </div>
</ds-metadata-field-wrapper> </ds-metadata-field-wrapper>

View File

@@ -11,6 +11,7 @@ export class FileSectionComponent implements OnInit {
@Input() item: Item; @Input() item: Item;
label : string = "item.page.files"; label : string = "item.page.files";
separator: string = "<br/>"
files: Observable<Array<Observable<Bitstream>>>; files: Observable<Array<Observable<Bitstream>>>;
constructor() { constructor() {

View File

@@ -1,5 +1,5 @@
<ds-metadata-field-wrapper [label]="label | translate"> <ds-metadata-field-wrapper [label]="label | translate">
<a *ngFor="let metadatum of values; let last=last;" href="{{metadatum.value}}"> <a *ngFor="let metadatum of values; let last=last;" [href]="metadatum.value">
{{linktext || metadatum.value}}<span *ngIf="!last"><span innerHTML="{{separator}}"></span></span> {{ linktext || metadatum.value }}<span *ngIf="!last" [innerHTML]="separator"></span>
</a> </a>
</ds-metadata-field-wrapper> </ds-metadata-field-wrapper>

View File

@@ -1,5 +1,5 @@
<ds-metadata-field-wrapper [label]="label | translate"> <ds-metadata-field-wrapper [label]="label | translate">
<span *ngFor="let metadatum of values; let last=last;"> <span *ngFor="let metadatum of values; let last=last;">
{{metadatum.value}}<span *ngIf="!last"><span innerHTML="{{separator}}"></span></span> {{metadatum.value}}<span *ngIf="!last" [innerHTML]="separator"></span>
</span> </span>
</ds-metadata-field-wrapper> </ds-metadata-field-wrapper>

View File

@@ -9,6 +9,7 @@ import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.comp
export class ItemPageAuthorFieldComponent extends ItemPageSpecificFieldComponent implements OnInit { export class ItemPageAuthorFieldComponent extends ItemPageSpecificFieldComponent implements OnInit {
@Input() item: Item; @Input() item: Item;
separator : string;
fields : string[] = [ fields : string[] = [
"dc.contributor.author", "dc.contributor.author",
@@ -16,6 +17,5 @@ export class ItemPageAuthorFieldComponent extends ItemPageSpecificFieldComponent
"dc.contributor" "dc.contributor"
]; ];
label : string = "item.page.author"; label : string = "item.page.author";
separator : string = ",";
} }

View File

@@ -9,7 +9,7 @@ import { ItemPageSpecificFieldComponent } from "../item-page-specific-field.comp
export class ItemPageDateFieldComponent extends ItemPageSpecificFieldComponent implements OnInit { export class ItemPageDateFieldComponent extends ItemPageSpecificFieldComponent implements OnInit {
@Input() item: Item; @Input() item: Item;
separator : string; separator : string = ", ";
fields : string[] = [ fields : string[] = [
"dc.date.issued" "dc.date.issued"