diff --git a/src/app/community-page/community-page-routing.module.ts b/src/app/community-page/community-page-routing.module.ts new file mode 100644 index 0000000000..40585617f6 --- /dev/null +++ b/src/app/community-page/community-page-routing.module.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { CommunityPageComponent } from './community-page.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: 'communities/:id', component: CommunityPageComponent } + ]) + ] +}) +export class CommunityPageRoutingModule { } diff --git a/src/app/community-page/community-page.component.html b/src/app/community-page/community-page.component.html new file mode 100644 index 0000000000..28425e48fe --- /dev/null +++ b/src/app/community-page/community-page.component.html @@ -0,0 +1,17 @@ +
+ + + + + + + + + + + +
diff --git a/src/app/community-page/community-page.component.scss b/src/app/community-page/community-page.component.scss new file mode 100644 index 0000000000..da97dd7a62 --- /dev/null +++ b/src/app/community-page/community-page.component.scss @@ -0,0 +1 @@ +@import '../../styles/variables.scss'; diff --git a/src/app/community-page/community-page.component.ts b/src/app/community-page/community-page.component.ts new file mode 100644 index 0000000000..cfca9659ba --- /dev/null +++ b/src/app/community-page/community-page.component.ts @@ -0,0 +1,35 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Params } from '@angular/router'; + +import { Community } from "../core/shared/community.model"; +import { Bitstream } from "../core/shared/bitstream.model"; +import { RemoteData } from "../core/data/remote-data"; +import { CommunityDataService } from "../core/data/community-data.service"; + +@Component({ + selector: 'ds-community-page', + styleUrls: ['./community-page.component.css'], + templateUrl: './community-page.component.html', +}) +export class CommunityPageComponent implements OnInit { + communityData: RemoteData; + logoData: RemoteData; + + constructor( + private communityDataService: CommunityDataService, + private route: ActivatedRoute + ) { + this.universalInit(); + } + + ngOnInit(): void { + this.route.params.subscribe((params: Params) => { + this.communityData = this.communityDataService.findById(params['id']) + this.communityData.payload + .subscribe(community => this.logoData = community.logo); + }); + } + + universalInit() { + } +} diff --git a/src/app/community-page/community-page.module.ts b/src/app/community-page/community-page.module.ts new file mode 100644 index 0000000000..f8fb2c57b3 --- /dev/null +++ b/src/app/community-page/community-page.module.ts @@ -0,0 +1,37 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from "@angular/router"; + +import { TranslateModule } from "@ngx-translate/core"; + +import { CommunityPageComponent } from './community-page.component'; +import { FieldWrapperComponent } from './field-wrapper/field-wrapper.component'; +import { CommunityPageNameComponent } from './name/community-page-name.component'; +import { CommunityPageLogoComponent } from './logo/community-page-logo.component'; +import { CommunityPageIntroductoryTextComponent } from './introductory-text/community-page-introductory-text.component'; +import { CommunityPageNewsComponent } from './news/community-page-news.component'; +import { CommunityPageCopyrightComponent } from './copyright/community-page-copyright.component'; +import { CommunityPageLicenseComponent } from './license/community-page-license.component'; +import { CommunityPageSubCollectionListComponent } from './sub-collection-list/community-page-sub-collection-list.component'; +import { CommunityPageRoutingModule } from './community-page-routing.module'; + +@NgModule({ + imports: [ + CommunityPageRoutingModule, + CommonModule, + TranslateModule, + RouterModule, + ], + declarations: [ + CommunityPageComponent, + FieldWrapperComponent, + CommunityPageNameComponent, + CommunityPageLogoComponent, + CommunityPageIntroductoryTextComponent, + CommunityPageNewsComponent, + CommunityPageCopyrightComponent, + CommunityPageLicenseComponent, + CommunityPageSubCollectionListComponent, + ] +}) +export class CommunityPageModule { } diff --git a/src/app/community-page/copyright/community-page-copyright.component.html b/src/app/community-page/copyright/community-page-copyright.component.html new file mode 100644 index 0000000000..987f3cb64a --- /dev/null +++ b/src/app/community-page/copyright/community-page-copyright.component.html @@ -0,0 +1,3 @@ + +

+
\ No newline at end of file diff --git a/src/app/community-page/copyright/community-page-copyright.component.scss b/src/app/community-page/copyright/community-page-copyright.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/community-page/copyright/community-page-copyright.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/community-page/copyright/community-page-copyright.component.ts b/src/app/community-page/copyright/community-page-copyright.component.ts new file mode 100644 index 0000000000..1639f57db2 --- /dev/null +++ b/src/app/community-page/copyright/community-page-copyright.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-community-page-copyright', + styleUrls: ['./community-page-copyright.component.css'], + templateUrl: './community-page-copyright.component.html', +}) +export class CommunityPageCopyrightComponent { + @Input() copyrightText: String; +} diff --git a/src/app/community-page/field-wrapper/field-wrapper.component.html b/src/app/community-page/field-wrapper/field-wrapper.component.html new file mode 100644 index 0000000000..67e482efa0 --- /dev/null +++ b/src/app/community-page/field-wrapper/field-wrapper.component.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/src/app/community-page/field-wrapper/field-wrapper.component.scss b/src/app/community-page/field-wrapper/field-wrapper.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/community-page/field-wrapper/field-wrapper.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/community-page/field-wrapper/field-wrapper.component.ts b/src/app/community-page/field-wrapper/field-wrapper.component.ts new file mode 100644 index 0000000000..c8420661ea --- /dev/null +++ b/src/app/community-page/field-wrapper/field-wrapper.component.ts @@ -0,0 +1,11 @@ +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; +} diff --git a/src/app/community-page/introductory-text/community-page-introductory-text.component.html b/src/app/community-page/introductory-text/community-page-introductory-text.component.html new file mode 100644 index 0000000000..8c1f89544a --- /dev/null +++ b/src/app/community-page/introductory-text/community-page-introductory-text.component.html @@ -0,0 +1,3 @@ + +

+
\ No newline at end of file diff --git a/src/app/community-page/introductory-text/community-page-introductory-text.component.scss b/src/app/community-page/introductory-text/community-page-introductory-text.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/community-page/introductory-text/community-page-introductory-text.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/community-page/introductory-text/community-page-introductory-text.component.ts b/src/app/community-page/introductory-text/community-page-introductory-text.component.ts new file mode 100644 index 0000000000..beee2df466 --- /dev/null +++ b/src/app/community-page/introductory-text/community-page-introductory-text.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-community-page-introductory-text', + styleUrls: ['./community-page-introductory-text.component.css'], + templateUrl: './community-page-introductory-text.component.html', +}) +export class CommunityPageIntroductoryTextComponent { + @Input() introductoryText: String; +} diff --git a/src/app/community-page/license/community-page-license.component.html b/src/app/community-page/license/community-page-license.component.html new file mode 100644 index 0000000000..7bea146194 --- /dev/null +++ b/src/app/community-page/license/community-page-license.component.html @@ -0,0 +1,4 @@ + +

{{ 'community.page.license' | translate }}

+

{{ license }}

+
\ No newline at end of file diff --git a/src/app/community-page/license/community-page-license.component.scss b/src/app/community-page/license/community-page-license.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/community-page/license/community-page-license.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/community-page/license/community-page-license.component.ts b/src/app/community-page/license/community-page-license.component.ts new file mode 100644 index 0000000000..cf3e8e0661 --- /dev/null +++ b/src/app/community-page/license/community-page-license.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-community-page-license', + styleUrls: ['./community-page-license.component.css'], + templateUrl: './community-page-license.component.html', +}) +export class CommunityPageLicenseComponent { + @Input() license: String; +} diff --git a/src/app/community-page/logo/community-page-logo.component.html b/src/app/community-page/logo/community-page-logo.component.html new file mode 100644 index 0000000000..d5ef5d6311 --- /dev/null +++ b/src/app/community-page/logo/community-page-logo.component.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/app/community-page/logo/community-page-logo.component.scss b/src/app/community-page/logo/community-page-logo.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/community-page/logo/community-page-logo.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/community-page/logo/community-page-logo.component.ts b/src/app/community-page/logo/community-page-logo.component.ts new file mode 100644 index 0000000000..3610932745 --- /dev/null +++ b/src/app/community-page/logo/community-page-logo.component.ts @@ -0,0 +1,13 @@ +import { Component, Input } from '@angular/core'; + +import { Bitstream } from "../../core/shared/bitstream.model"; + + +@Component({ + selector: 'ds-community-page-logo', + styleUrls: ['./community-page-logo.component.css'], + templateUrl: './community-page-logo.component.html', +}) +export class CommunityPageLogoComponent { + @Input() logo: Bitstream; +} diff --git a/src/app/community-page/name/community-page-name.component.html b/src/app/community-page/name/community-page-name.component.html new file mode 100644 index 0000000000..21f1f65331 --- /dev/null +++ b/src/app/community-page/name/community-page-name.component.html @@ -0,0 +1 @@ +

{{ name }}

\ No newline at end of file diff --git a/src/app/community-page/name/community-page-name.component.scss b/src/app/community-page/name/community-page-name.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/community-page/name/community-page-name.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/community-page/name/community-page-name.component.ts b/src/app/community-page/name/community-page-name.component.ts new file mode 100644 index 0000000000..f2cbded07c --- /dev/null +++ b/src/app/community-page/name/community-page-name.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-community-page-name', + styleUrls: ['./community-page-name.component.css'], + templateUrl: './community-page-name.component.html', +}) +export class CommunityPageNameComponent { + @Input() name: String; +} diff --git a/src/app/community-page/news/community-page-news.component.html b/src/app/community-page/news/community-page-news.component.html new file mode 100644 index 0000000000..bce01dd378 --- /dev/null +++ b/src/app/community-page/news/community-page-news.component.html @@ -0,0 +1,4 @@ + +

{{ 'community.page.news' | translate }}

+

+
\ No newline at end of file diff --git a/src/app/community-page/news/community-page-news.component.scss b/src/app/community-page/news/community-page-news.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/community-page/news/community-page-news.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/community-page/news/community-page-news.component.ts b/src/app/community-page/news/community-page-news.component.ts new file mode 100644 index 0000000000..b978d41a55 --- /dev/null +++ b/src/app/community-page/news/community-page-news.component.ts @@ -0,0 +1,11 @@ +import { Component, Input } from '@angular/core'; + + +@Component({ + selector: 'ds-community-page-news', + styleUrls: ['./community-page-news.component.css'], + templateUrl: './community-page-news.component.html', +}) +export class CommunityPageNewsComponent { + @Input() sidebarText: String; +} diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html new file mode 100644 index 0000000000..f1f05a0467 --- /dev/null +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html @@ -0,0 +1,11 @@ +
+

{{'community.sub-collection-list.head' | translate}}

+ +
diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss new file mode 100644 index 0000000000..ad84b72f8c --- /dev/null +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss @@ -0,0 +1 @@ +@import '../../../styles/variables.scss'; \ No newline at end of file diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts new file mode 100644 index 0000000000..f3c39914ee --- /dev/null +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; +import { CollectionDataService } from "../../core/data/collection-data.service"; +import { RemoteData } from "../../core/data/remote-data"; +import { Collection } from "../../core/shared/collection.model"; + + +@Component({ + selector: 'ds-community-page-sub-collection-list', + styleUrls: ['./community-page-sub-collection-list.component.css'], + templateUrl: './community-page-sub-collection-list.component.html', +}) +export class CommunityPageSubCollectionListComponent implements OnInit { + subCollections: RemoteData; + + constructor( + private cds: CollectionDataService + ) { + this.universalInit(); + } + + universalInit() { + + } + + ngOnInit(): void { + this.subCollections = this.cds.findAll(); + } +}