Skip to content
Snippets Groups Projects
Commit 06d2ac74 authored by Art Lowel's avatar Art Lowel
Browse files

added custom item page fields for Projects, OrgUnits and People

parent fdd9746f
No related branches found
No related tags found
No related merge requests found
Showing
with 171 additions and 41 deletions
......@@ -45,6 +45,38 @@
}
}
},
"person": {
"page": {
"jobtitle": "Job Title",
"lastname": "Last Name",
"firstname": "First Name",
"email": "Email Address",
"orcid": "ORCID",
"birthdate": "Birth Date",
"staffid": "Staff ID",
"link": {
"full": "Show all metadata"
}
}
},
"project": {
"page": {
"status": "Status",
"id": "ID",
"expectedcompletion": "Expected Completion",
"description": "Description",
"keywords": "Keywords"
}
},
"orgunit": {
"page": {
"dateestablished": "Date established",
"city": "City",
"country": "Country",
"id": "ID",
"description": "Description"
}
},
"nav": {
"home": "Home"
},
......
resources/images/orgunit-placeholder.jpg

70.3 KiB

resources/images/person-placeholder.png

138 KiB

resources/images/project-placeholder.png

313 KiB

......@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from './../shared/shared.module';
import { GenericItemPageFieldComponent } from './simple/field-components/specific-field/generic/generic-item-page-field.component';
import { ItemPageComponent } from './simple/item-page.component';
import { ItemPageRoutingModule } from './item-page-routing.module';
......@@ -13,11 +14,16 @@ import { ItemPageDateFieldComponent } from './simple/field-components/specific-f
import { ItemPageAbstractFieldComponent } from './simple/field-components/specific-field/abstract/item-page-abstract-field.component';
import { ItemPageUriFieldComponent } from './simple/field-components/specific-field/uri/item-page-uri-field.component';
import { ItemPageTitleFieldComponent } from './simple/field-components/specific-field/title/item-page-title-field.component';
import { ItemPageSpecificFieldComponent } from './simple/field-components/specific-field/item-page-specific-field.component';
import { ItemPageFieldComponent } from './simple/field-components/specific-field/item-page-field.component';
import { FileSectionComponent } from './simple/field-components/file-section/file-section.component';
import { CollectionsComponent } from './field-components/collections/collections.component';
import { FullItemPageComponent } from './full/full-item-page.component';
import { FullFileSectionComponent } from './full/field-components/file-section/full-file-section.component';
import { ItemPageFieldsComponent } from './simple/relationship-types/item/item-page-fields.component';
import { OrgUnitPageFieldsComponent } from './simple/relationship-types/orgunit/orgunit-page-fields.component';
import { PersonPageFieldsComponent } from './simple/relationship-types/person/person-page-fields.component';
import { ProjectPageFieldsComponent } from './simple/relationship-types/project/project-page-fields.component';
import { RelationshipTypeSwitcherComponent } from './simple/relationship-types/switcher/relationship-type-switcher.component';
@NgModule({
imports: [
......@@ -36,10 +42,22 @@ import { FullFileSectionComponent } from './full/field-components/file-section/f
ItemPageAbstractFieldComponent,
ItemPageUriFieldComponent,
ItemPageTitleFieldComponent,
ItemPageSpecificFieldComponent,
ItemPageFieldComponent,
FileSectionComponent,
CollectionsComponent,
FullFileSectionComponent
FullFileSectionComponent,
RelationshipTypeSwitcherComponent,
ItemPageFieldsComponent,
ProjectPageFieldsComponent,
OrgUnitPageFieldsComponent,
PersonPageFieldsComponent,
GenericItemPageFieldComponent
],
entryComponents: [
ItemPageFieldsComponent,
ProjectPageFieldsComponent,
OrgUnitPageFieldsComponent,
PersonPageFieldsComponent
]
})
export class ItemPageModule {
......
import { Component, Input } from '@angular/core';
import { Item } from '../../../../../core/shared/item.model';
import { ItemPageSpecificFieldComponent } from '../item-page-specific-field.component';
import { ItemPageFieldComponent } from '../item-page-field.component';
@Component({
selector: 'ds-item-page-abstract-field',
templateUrl: './../item-page-specific-field.component.html'
templateUrl: '../item-page-field.component.html'
})
export class ItemPageAbstractFieldComponent extends ItemPageSpecificFieldComponent {
export class ItemPageAbstractFieldComponent extends ItemPageFieldComponent {
@Input() item: Item;
......
import { Component, Input } from '@angular/core';
import { Item } from '../../../../../core/shared/item.model';
import { ItemPageSpecificFieldComponent } from '../item-page-specific-field.component';
import { ItemPageFieldComponent } from '../item-page-field.component';
@Component({
selector: 'ds-item-page-author-field',
templateUrl: './../item-page-specific-field.component.html'
templateUrl: '../item-page-field.component.html'
})
export class ItemPageAuthorFieldComponent extends ItemPageSpecificFieldComponent {
export class ItemPageAuthorFieldComponent extends ItemPageFieldComponent {
@Input() item: Item;
......
import { Component, Input } from '@angular/core';
import { Item } from '../../../../../core/shared/item.model';
import { ItemPageSpecificFieldComponent } from '../item-page-specific-field.component';
import { ItemPageFieldComponent } from '../item-page-field.component';
@Component({
selector: 'ds-item-page-date-field',
templateUrl: './../item-page-specific-field.component.html'
templateUrl: '../item-page-field.component.html'
})
export class ItemPageDateFieldComponent extends ItemPageSpecificFieldComponent {
export class ItemPageDateFieldComponent extends ItemPageFieldComponent {
@Input() item: Item;
......
import { Component, Input } from '@angular/core';
import { Item } from '../../../../../core/shared/item.model';
import { ItemPageFieldComponent } from '../item-page-field.component';
@Component({
selector: 'ds-generic-item-page-field',
templateUrl: '../item-page-field.component.html'
})
export class GenericItemPageFieldComponent extends ItemPageFieldComponent {
@Input() item: Item;
@Input() separator: string;
@Input() fields: string[];
@Input() label: string;
}
<div class="item-page-specific-field">
<div class="item-page-field">
<ds-metadata-values [values]="item?.filterMetadata(fields)" [separator]="separator" [label]="label"></ds-metadata-values>
</div>
......@@ -9,9 +9,9 @@ import { Item } from '../../../../core/shared/item.model';
*/
@Component({
templateUrl: './item-page-specific-field.component.html'
templateUrl: './item-page-field.component.html'
})
export class ItemPageSpecificFieldComponent {
export class ItemPageFieldComponent {
@Input() item: Item;
......
import { Component, Input } from '@angular/core';
import { Item } from '../../../../../core/shared/item.model';
import { ItemPageSpecificFieldComponent } from '../item-page-specific-field.component';
import { ItemPageFieldComponent } from '../item-page-field.component';
@Component({
selector: 'ds-item-page-title-field',
templateUrl: './item-page-title-field.component.html'
})
export class ItemPageTitleFieldComponent extends ItemPageSpecificFieldComponent {
export class ItemPageTitleFieldComponent extends ItemPageFieldComponent {
@Input() item: Item;
......
<div class="item-page-specific-field">
<div class="item-page-field">
<ds-metadata-uri-values [values]="item?.filterMetadata(fields)" [separator]="separator" [label]="label"></ds-metadata-uri-values>
</div>
import { Component, Input } from '@angular/core';
import { Item } from '../../../../../core/shared/item.model';
import { ItemPageSpecificFieldComponent } from '../item-page-specific-field.component';
import { ItemPageFieldComponent } from '../item-page-field.component';
@Component({
selector: 'ds-item-page-uri-field',
templateUrl: './item-page-uri-field.component.html'
})
export class ItemPageUriFieldComponent extends ItemPageSpecificFieldComponent {
export class ItemPageUriFieldComponent extends ItemPageFieldComponent {
@Input() item: Item;
......
<div class="container" *ngVar="(itemRDObs | async) as itemRD">
<div class="item-page" *ngIf="itemRD?.hasSucceeded" @fadeInOut>
<div *ngIf="itemRD?.payload as item">
<ds-item-page-title-field [item]="item"></ds-item-page-title-field>
<div class="row">
<div class="col-xs-12 col-md-4">
<ds-metadata-field-wrapper>
<ds-thumbnail [thumbnail]="thumbnailObs | async"></ds-thumbnail>
</ds-metadata-field-wrapper>
<ds-item-page-file-section [item]="item"></ds-item-page-file-section>
<ds-item-page-date-field [item]="item"></ds-item-page-date-field>
<ds-item-page-author-field [item]="item"></ds-item-page-author-field>
</div>
<div class="col-xs-12 col-md-6">
<ds-item-page-abstract-field [item]="item"></ds-item-page-abstract-field>
<ds-item-page-uri-field [item]="item"></ds-item-page-uri-field>
<ds-item-page-collections [item]="item"></ds-item-page-collections>
<div>
<a class="btn btn-outline-primary" [routerLink]="['/items/' + item.id + '/full']">
{{"item.page.link.full" | translate}}
</a>
</div>
</div>
</div>
<ds-relationship-type-switcher [item]="item" [viewMode]="ElementViewMode.Full"></ds-relationship-type-switcher>
</div>
</div>
<ds-error *ngIf="itemRD?.hasFailed" message="{{'error.item' | translate}}"></ds-error>
......
......@@ -12,6 +12,7 @@ import { MetadataService } from '../../core/metadata/metadata.service';
import { fadeInOut } from '../../shared/animations/fade';
import { hasValue } from '../../shared/empty.util';
import * as viewMode from '../../shared/view-mode';
/**
* This component renders a simple item page.
......@@ -35,6 +36,8 @@ export class ItemPageComponent implements OnInit {
thumbnailObs: Observable<Bitstream>;
ElementViewMode = viewMode.ElementViewMode;
constructor(
private route: ActivatedRoute,
private items: ItemDataService,
......
<ds-item-page-title-field [item]="item"></ds-item-page-title-field>
<div class="row">
<div class="col-xs-12 col-md-4">
<ds-metadata-field-wrapper>
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async"></ds-thumbnail>
</ds-metadata-field-wrapper>
<ds-item-page-file-section [item]="item"></ds-item-page-file-section>
<ds-item-page-date-field [item]="item"></ds-item-page-date-field>
<ds-item-page-author-field [item]="item"></ds-item-page-author-field>
</div>
<div class="col-xs-12 col-md-6">
<ds-item-page-abstract-field [item]="item"></ds-item-page-abstract-field>
<ds-item-page-uri-field [item]="item"></ds-item-page-uri-field>
<ds-item-page-collections [item]="item"></ds-item-page-collections>
<div>
<a class="btn btn-outline-primary" [routerLink]="['/items/' + item.id + '/full']">
{{"item.page.link.full" | translate}}
</a>
</div>
</div>
</div>
@import '../../../../../styles/variables.scss';
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
import { Item } from '../../../../core/shared/item.model';
import {
DEFAULT_RELATIONSHIP_TYPE,
rendersRelationshipType
} from '../../../../shared/entities/relationship-type-decorator';
import { ElementViewMode } from '../../../../shared/view-mode';
import { ITEM } from '../switcher/relationship-type-switcher.component';
@rendersRelationshipType('Item', ElementViewMode.Full)
@rendersRelationshipType(DEFAULT_RELATIONSHIP_TYPE, ElementViewMode.Full)
@Component({
selector: 'ds-item-page-fields',
styleUrls: ['./item-page-fields.component.scss'],
templateUrl: './item-page-fields.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ItemPageFieldsComponent {
constructor(@Inject(ITEM) public item: Item) {
}
}
<h2 class="item-page-title-field">
<ds-metadata-values [values]="item?.filterMetadata(['orgunit.identifier.name'])"></ds-metadata-values>
</h2>
<div class="row">
<div class="col-xs-12 col-md-4">
<ds-metadata-field-wrapper>
<ds-thumbnail [thumbnail]="this.item.getThumbnail() | async" [defaultImage]="'assets/images/orgunit-placeholder.jpg'"></ds-thumbnail>
</ds-metadata-field-wrapper>
<ds-generic-item-page-field [item]="item"
[fields]="['orgunit.identifier.dateestablished']"
[label]="'orgunit.page.dateestablished'">
</ds-generic-item-page-field>
<ds-generic-item-page-field [item]="item"
[fields]="['orgunit.identifier.city']"
[label]="'orgunit.page.city'">
</ds-generic-item-page-field>
<ds-generic-item-page-field [item]="item"
[fields]="['orgunit.identifier.country']"
[label]="'orgunit.page.country'">
</ds-generic-item-page-field>
<ds-generic-item-page-field [item]="item"
[fields]="['orgunit.identifier.id']"
[label]="'orgunit.page.id'">
</ds-generic-item-page-field>
</div>
<div class="col-xs-12 col-md-6">
<ds-generic-item-page-field [item]="item"
[fields]="['orgunit.identifier.description']"
[label]="'orgunit.page.description'">
</ds-generic-item-page-field>
</div>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment