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",
"date": "Date",
"uri": "URI",
"files": "Files"
"files": "Files",
"collections": "Collections"
}
},

View File

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

View File

@@ -11,6 +11,7 @@ export class CollectionsComponent implements OnInit {
@Input() item: Item;
label : string = "item.page.collections";
separator: string = "<br/>"
collections: Array<Observable<Collection>>;
constructor() {
@@ -23,7 +24,7 @@ export class CollectionsComponent implements OnInit {
ngOnInit(): void {
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">
<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)?.size) | dsFileSize }})</span>
<span *ngIf="!last" innerHTML="{{separator}}"></span>
</a>
</div>
</ds-metadata-field-wrapper>

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
<ds-metadata-field-wrapper [label]="label | translate">
<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>
</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 {
@Input() item: Item;
separator : string;
fields : string[] = [
"dc.contributor.author",
@@ -16,6 +17,5 @@ export class ItemPageAuthorFieldComponent extends ItemPageSpecificFieldComponent
"dc.contributor"
];
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 {
@Input() item: Item;
separator : string;
separator : string = ", ";
fields : string[] = [
"dc.date.issued"