Renamed Collection/Community shared components

This commit is contained in:
Christian Scheible
2017-06-13 15:41:38 +02:00
parent 90840d949b
commit ac7b2775e4
21 changed files with 47 additions and 79 deletions

View File

@@ -1,30 +1,32 @@
<div class="collection-page" *ngIf="collectionData.hasSucceeded | async">
<!-- Collection Name -->
<ds-dso-name [name]="(collectionData.payload | async)?.name"></ds-dso-name>
<ds-comcol-page-header
[name]="(collectionData.payload | async)?.name">
</ds-comcol-page-header>
<!-- Collection logo -->
<ds-dso-logo *ngIf="logoData"
<ds-comcol-page-logo *ngIf="logoData"
[logo]="logoData.payload | async"
[alternateText]="'Collection Logo'">
</ds-dso-logo>
</ds-comcol-page-logo>
<!-- Introductionary text -->
<ds-content-with-optional-title
<ds-comcol-page-content
[content]="(collectionData.payload | async)?.introductoryText"
[hasInnerHtml]="true">
</ds-content-with-optional-title>
</ds-comcol-page-content>
<!-- News -->
<ds-content-with-optional-title
<ds-comcol-page-content
[content]="(collectionData.payload | async)?.sidebarText"
[hasInnerHtml]="true"
[title]="'community.page.news'">
</ds-content-with-optional-title>
</ds-comcol-page-content>
<!-- Copyright -->
<ds-content-with-optional-title
<ds-comcol-page-content
[content]="(collectionData.payload | async)?.copyrightText"
[hasInnerHtml]="true">>
</ds-content-with-optional-title>
</ds-comcol-page-content>
<!-- Licence -->
<ds-content-with-optional-title
<ds-comcol-page-content
[content]="(collectionData.payload | async)?.license"
[title]="'collection.page.license'">>
</ds-content-with-optional-title>
</ds-comcol-page-content>
</div>

View File

@@ -5,7 +5,6 @@ import { TranslateModule } from "@ngx-translate/core";
import { SharedModule } from '../shared/shared.module';
import { CollectionPageComponent } from './collection-page.component';
import { FieldWrapperComponent } from './field-wrapper/field-wrapper.component';
import { CollectionPageRoutingModule } from './collection-page-routing.module';
@NgModule({
@@ -17,7 +16,6 @@ import { CollectionPageRoutingModule } from './collection-page-routing.module';
],
declarations: [
CollectionPageComponent,
FieldWrapperComponent,
]
})
export class CollectionPageModule { }

View File

@@ -1,3 +0,0 @@
<div class="collection-page-field-wrapper">
<ng-content></ng-content>
</div>

View File

@@ -1,11 +0,0 @@
import { Component, Input } from '@angular/core';
@Component({
selector: 'ds-field-wrapper',
styleUrls: ['./field-wrapper.component.css'],
templateUrl: './field-wrapper.component.html',
})
export class FieldWrapperComponent {
@Input() name: String;
}

View File

@@ -1,26 +1,26 @@
<div class="community-page" *ngIf="communityData.hasSucceeded | async">
<!-- Community name -->
<ds-dso-name [name]="(communityData.payload | async)?.name"></ds-dso-name>
<ds-comcol-page-header [name]="(communityData.payload | async)?.name"></ds-comcol-page-header>
<!-- Community logo -->
<ds-dso-logo *ngIf="logoData"
<ds-comcol-page-logo *ngIf="logoData"
[logo]="logoData.payload | async"
[alternateText]="'Community Logo'">
</ds-dso-logo>
</ds-comcol-page-logo>
<!-- Introductionary text -->
<ds-content-with-optional-title
<ds-comcol-page-content
[content]="(communityData.payload | async)?.introductoryText"
[hasInnerHtml]="true">
</ds-content-with-optional-title>
</ds-comcol-page-content>
<!-- News -->
<ds-content-with-optional-title
<ds-comcol-page-content
[content]="(communityData.payload | async)?.sidebarText"
[hasInnerHtml]="true"
[title]="'community.page.news'">
</ds-content-with-optional-title >
</ds-comcol-page-content >
<!-- Copyright -->
<ds-content-with-optional-title
<ds-comcol-page-content
[content]="(communityData.payload | async)?.copyrightText"
[hasInnerHtml]="true">
</ds-content-with-optional-title>
</ds-comcol-page-content>
<ds-community-page-sub-collection-list></ds-community-page-sub-collection-list>
</div>

View File

@@ -6,7 +6,6 @@ import { TranslateModule } from "@ngx-translate/core";
import { SharedModule } from '../shared/shared.module';
import { CommunityPageComponent } from './community-page.component';
import { FieldWrapperComponent } from './field-wrapper/field-wrapper.component';
import { CommunityPageSubCollectionListComponent } from './sub-collection-list/community-page-sub-collection-list.component';
import { CommunityPageRoutingModule } from './community-page-routing.module';
@@ -20,7 +19,6 @@ import { CommunityPageRoutingModule } from './community-page-routing.module';
],
declarations: [
CommunityPageComponent,
FieldWrapperComponent,
CommunityPageSubCollectionListComponent,
]
})

View File

@@ -1,3 +0,0 @@
<div class="community-page-field-wrapper">
<ng-content></ng-content>
</div>

View File

@@ -1,11 +0,0 @@
import { Component, Input } from '@angular/core';
@Component({
selector: 'ds-field-wrapper',
styleUrls: ['./field-wrapper.component.css'],
templateUrl: './field-wrapper.component.html',
})
export class FieldWrapperComponent {
@Input() name: String;
}

View File

@@ -8,11 +8,11 @@ import { Component, Input } from '@angular/core';
*/
@Component({
selector: 'ds-content-with-optional-title',
styleUrls: ['./content-with-optional-title.component.css'],
templateUrl: './content-with-optional-title.component.html'
selector: 'ds-comcol-page-content',
styleUrls: ['./comcol-page-content.component.css'],
templateUrl: './comcol-page-content.component.html'
})
export class ContentWithOptionalTitleComponent {
export class ComcolPageContentComponent {
// Optional title
@Input() title: string;

View File

@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';
@Component({
selector: 'ds-comcol-page-header',
styleUrls: ['./comcol-page-header.component.css'],
templateUrl: './comcol-page-header.component.html',
})
export class ComcolPageHeaderComponent {
@Input() name: String;
}

View File

@@ -4,11 +4,11 @@ import { Bitstream } from "../../core/shared/bitstream.model";
@Component({
selector: 'ds-dso-logo',
styleUrls: ['./dso-logo.component.css'],
templateUrl: './dso-logo.component.html',
selector: 'ds-comcol-page-logo',
styleUrls: ['./comcol-page-logo.component.css'],
templateUrl: './comcol-page-logo.component.html',
})
export class DsoLogoComponent {
export class ComcolPageLogoComponent {
@Input() logo: Bitstream;
@Input() alternateText: string;

View File

@@ -1 +0,0 @@
@import '../../../styles/variables.scss';

View File

@@ -1 +0,0 @@
@import '../../../styles/variables.scss';

View File

@@ -1,11 +0,0 @@
import { Component, Input } from '@angular/core';
@Component({
selector: 'ds-dso-name',
styleUrls: ['./dso-name.component.css'],
templateUrl: './dso-name.component.html',
})
export class DsoNameComponent {
@Input() name: String;
}

View File

@@ -14,9 +14,9 @@ import { ThumbnailComponent } from "../thumbnail/thumbnail.component";
import { SafeUrlPipe } from "./utils/safe-url-pipe";
import { HostWindowService } from "./host-window.service";
import { NativeWindowFactory, NativeWindowService } from "./window.service";
import { ContentWithOptionalTitleComponent } from "./content-with-optional-title/content-with-optional-title.component";
import { DsoNameComponent } from "./dso-name/dso-name.component";
import { DsoLogoComponent } from "./dso-logo/dso-logo.component";
import { ComcolPageContentComponent } from "./comcol-page-content/comcol-page-content.component";
import { ComcolPageHeaderComponent } from "./comcol-page-header/comcol-page-header.component";
import { ComcolPageLogoComponent } from "./comcol-page-logo/comcol-page-logo.component";
const MODULES = [
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
@@ -39,9 +39,9 @@ const COMPONENTS = [
// put shared components here
PaginationComponent,
ThumbnailComponent,
ContentWithOptionalTitleComponent,
DsoNameComponent,
DsoLogoComponent
ComcolPageContentComponent,
ComcolPageHeaderComponent,
ComcolPageLogoComponent
];
const PROVIDERS = [