mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 13:33:03 +00:00
Merge pull request #1748 from mspalti/new-themes
New theme-able components
This commit is contained in:
@@ -25,12 +25,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section class="comcol-page-browse-section">
|
<section class="comcol-page-browse-section">
|
||||||
|
|
||||||
<!-- Browse-By Links -->
|
<!-- Browse-By Links -->
|
||||||
<ds-themed-comcol-page-browse-by [id]="communityPayload.id" [contentType]="communityPayload.type">
|
<ds-themed-comcol-page-browse-by [id]="communityPayload.id" [contentType]="communityPayload.type">
|
||||||
</ds-themed-comcol-page-browse-by>
|
</ds-themed-comcol-page-browse-by>
|
||||||
|
|
||||||
<ds-community-page-sub-community-list [community]="communityPayload"></ds-community-page-sub-community-list>
|
<ds-themed-community-page-sub-community-list [community]="communityPayload"></ds-themed-community-page-sub-community-list>
|
||||||
<ds-community-page-sub-collection-list [community]="communityPayload"></ds-community-page-sub-collection-list>
|
<ds-themed-community-page-sub-collection-list [community]="communityPayload"></ds-themed-community-page-sub-collection-list>
|
||||||
</section>
|
</section>
|
||||||
<footer *ngIf="communityPayload.copyrightText" class="border-top my-5 pt-4">
|
<footer *ngIf="communityPayload.copyrightText" class="border-top my-5 pt-4">
|
||||||
<!-- Copyright -->
|
<!-- Copyright -->
|
||||||
|
@@ -13,10 +13,18 @@ import { StatisticsModule } from '../statistics/statistics.module';
|
|||||||
import { CommunityFormModule } from './community-form/community-form.module';
|
import { CommunityFormModule } from './community-form/community-form.module';
|
||||||
import { ThemedCommunityPageComponent } from './themed-community-page.component';
|
import { ThemedCommunityPageComponent } from './themed-community-page.component';
|
||||||
import { ComcolModule } from '../shared/comcol/comcol.module';
|
import { ComcolModule } from '../shared/comcol/comcol.module';
|
||||||
|
import {
|
||||||
|
ThemedCommunityPageSubCommunityListComponent
|
||||||
|
} from './sub-community-list/themed-community-page-sub-community-list.component';
|
||||||
|
import {
|
||||||
|
ThemedCollectionPageSubCollectionListComponent
|
||||||
|
} from './sub-collection-list/themed-community-page-sub-collection-list.component';
|
||||||
|
|
||||||
const DECLARATIONS = [CommunityPageComponent,
|
const DECLARATIONS = [CommunityPageComponent,
|
||||||
ThemedCommunityPageComponent,
|
ThemedCommunityPageComponent,
|
||||||
|
ThemedCommunityPageSubCommunityListComponent,
|
||||||
CommunityPageSubCollectionListComponent,
|
CommunityPageSubCollectionListComponent,
|
||||||
|
ThemedCollectionPageSubCollectionListComponent,
|
||||||
CommunityPageSubCommunityListComponent,
|
CommunityPageSubCommunityListComponent,
|
||||||
CreateCommunityPageComponent,
|
CreateCommunityPageComponent,
|
||||||
DeleteCommunityPageComponent];
|
DeleteCommunityPageComponent];
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
|
||||||
import { BehaviorSubject, combineLatest as observableCombineLatest } from 'rxjs';
|
import { BehaviorSubject, combineLatest as observableCombineLatest } from 'rxjs';
|
||||||
|
|
||||||
@@ -12,6 +12,7 @@ import { SortDirection, SortOptions } from '../../core/cache/models/sort-options
|
|||||||
import { CollectionDataService } from '../../core/data/collection-data.service';
|
import { CollectionDataService } from '../../core/data/collection-data.service';
|
||||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||||
import { switchMap } from 'rxjs/operators';
|
import { switchMap } from 'rxjs/operators';
|
||||||
|
import { hasValue } from '../../shared/empty.util';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-community-page-sub-collection-list',
|
selector: 'ds-community-page-sub-collection-list',
|
||||||
@@ -19,9 +20,15 @@ import { switchMap } from 'rxjs/operators';
|
|||||||
templateUrl: './community-page-sub-collection-list.component.html',
|
templateUrl: './community-page-sub-collection-list.component.html',
|
||||||
animations:[fadeIn]
|
animations:[fadeIn]
|
||||||
})
|
})
|
||||||
export class CommunityPageSubCollectionListComponent implements OnInit {
|
export class CommunityPageSubCollectionListComponent implements OnInit, OnDestroy {
|
||||||
@Input() community: Community;
|
@Input() community: Community;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional page size. Overrides communityList.pageSize configuration for this component.
|
||||||
|
* Value can be added in the themed version of the parent component.
|
||||||
|
*/
|
||||||
|
@Input() pageSize: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pagination configuration
|
* The pagination configuration
|
||||||
*/
|
*/
|
||||||
@@ -50,7 +57,9 @@ export class CommunityPageSubCollectionListComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.config = new PaginationComponentOptions();
|
this.config = new PaginationComponentOptions();
|
||||||
this.config.id = this.pageId;
|
this.config.id = this.pageId;
|
||||||
this.config.pageSize = 5;
|
if (hasValue(this.pageSize)) {
|
||||||
|
this.config.pageSize = this.pageSize;
|
||||||
|
}
|
||||||
this.config.currentPage = 1;
|
this.config.currentPage = 1;
|
||||||
this.sortConfig = new SortOptions('dc.title', SortDirection.ASC);
|
this.sortConfig = new SortOptions('dc.title', SortDirection.ASC);
|
||||||
this.initPage();
|
this.initPage();
|
||||||
|
@@ -0,0 +1,28 @@
|
|||||||
|
import { ThemedComponent } from '../../shared/theme-support/themed.component';
|
||||||
|
import { CommunityPageSubCollectionListComponent } from './community-page-sub-collection-list.component';
|
||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { Community } from '../../core/shared/community.model';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-community-page-sub-collection-list',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedCollectionPageSubCollectionListComponent extends ThemedComponent<CommunityPageSubCollectionListComponent> {
|
||||||
|
@Input() community: Community;
|
||||||
|
@Input() pageSize: number;
|
||||||
|
protected inAndOutputNames: (keyof CommunityPageSubCollectionListComponent & keyof this)[] = ['community', 'pageSize'];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'CommunityPageSubCollectionListComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../themes/${themeName}/app/community-page/sub-collection-list/community-page-sub-collection-list.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`./community-page-sub-collection-list.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
|
||||||
import { BehaviorSubject, combineLatest as observableCombineLatest } from 'rxjs';
|
import { BehaviorSubject, combineLatest as observableCombineLatest } from 'rxjs';
|
||||||
|
|
||||||
@@ -12,6 +12,7 @@ import { CommunityDataService } from '../../core/data/community-data.service';
|
|||||||
import { takeUntilCompletedRemoteData } from '../../core/shared/operators';
|
import { takeUntilCompletedRemoteData } from '../../core/shared/operators';
|
||||||
import { switchMap } from 'rxjs/operators';
|
import { switchMap } from 'rxjs/operators';
|
||||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||||
|
import { hasValue } from '../../shared/empty.util';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-community-page-sub-community-list',
|
selector: 'ds-community-page-sub-community-list',
|
||||||
@@ -22,9 +23,15 @@ import { PaginationService } from '../../core/pagination/pagination.service';
|
|||||||
/**
|
/**
|
||||||
* Component to render the sub-communities of a Community
|
* Component to render the sub-communities of a Community
|
||||||
*/
|
*/
|
||||||
export class CommunityPageSubCommunityListComponent implements OnInit {
|
export class CommunityPageSubCommunityListComponent implements OnInit, OnDestroy {
|
||||||
@Input() community: Community;
|
@Input() community: Community;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional page size. Overrides communityList.pageSize configuration for this component.
|
||||||
|
* Value can be added in the themed version of the parent component.
|
||||||
|
*/
|
||||||
|
@Input() pageSize: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pagination configuration
|
* The pagination configuration
|
||||||
*/
|
*/
|
||||||
@@ -53,7 +60,9 @@ export class CommunityPageSubCommunityListComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.config = new PaginationComponentOptions();
|
this.config = new PaginationComponentOptions();
|
||||||
this.config.id = this.pageId;
|
this.config.id = this.pageId;
|
||||||
this.config.pageSize = 5;
|
if (hasValue(this.pageSize)) {
|
||||||
|
this.config.pageSize = this.pageSize;
|
||||||
|
}
|
||||||
this.config.currentPage = 1;
|
this.config.currentPage = 1;
|
||||||
this.sortConfig = new SortOptions('dc.title', SortDirection.ASC);
|
this.sortConfig = new SortOptions('dc.title', SortDirection.ASC);
|
||||||
this.initPage();
|
this.initPage();
|
||||||
|
@@ -0,0 +1,29 @@
|
|||||||
|
import { ThemedComponent } from '../../shared/theme-support/themed.component';
|
||||||
|
import { CommunityPageSubCommunityListComponent } from './community-page-sub-community-list.component';
|
||||||
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { Community } from '../../core/shared/community.model';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-community-page-sub-community-list',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedCommunityPageSubCommunityListComponent extends ThemedComponent<CommunityPageSubCommunityListComponent> {
|
||||||
|
|
||||||
|
@Input() community: Community;
|
||||||
|
@Input() pageSize: number;
|
||||||
|
protected inAndOutputNames: (keyof CommunityPageSubCommunityListComponent & keyof this)[] = ['community', 'pageSize'];
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'CommunityPageSubCommunityListComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../themes/${themeName}/app/community-page/sub-community-list/community-page-sub-community-list.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`./community-page-sub-community-list.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,12 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { CommunityPageSubCollectionListComponent as BaseComponent }
|
||||||
|
from '../../../../../app/community-page/sub-collection-list/community-page-sub-collection-list.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-community-page-sub-collection-list',
|
||||||
|
// styleUrls: ['./community-page-sub-collection-list.component.scss'],
|
||||||
|
styleUrls: ['../../../../../app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss'],
|
||||||
|
// templateUrl: './community-page-sub-collection-list.component.html',
|
||||||
|
templateUrl: '../../../../../app/community-page/sub-collection-list/community-page-sub-collection-list.component.html'
|
||||||
|
})
|
||||||
|
export class CommunityPageSubCollectionListComponent extends BaseComponent {}
|
@@ -0,0 +1,12 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { CommunityPageSubCommunityListComponent as BaseComponent }
|
||||||
|
from '../../../../../app/community-page/sub-community-list/community-page-sub-community-list.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-community-page-sub-community-list',
|
||||||
|
// styleUrls: ['./community-page-sub-community-list.component.scss'],
|
||||||
|
styleUrls: ['../../../../../app/community-page/sub-community-list/community-page-sub-community-list.component.scss'],
|
||||||
|
// templateUrl: './community-page-sub-community-list.component.html',
|
||||||
|
templateUrl: '../../../../../app/community-page/sub-community-list/community-page-sub-community-list.component.html'
|
||||||
|
})
|
||||||
|
export class CommunityPageSubCommunityListComponent extends BaseComponent {}
|
@@ -99,6 +99,12 @@ import {
|
|||||||
import { LoadingComponent } from './app/shared/loading/loading.component';
|
import { LoadingComponent } from './app/shared/loading/loading.component';
|
||||||
import { SearchResultsComponent } from './app/shared/search/search-results/search-results.component';
|
import { SearchResultsComponent } from './app/shared/search/search-results/search-results.component';
|
||||||
import { AdminSidebarComponent } from './app/admin/admin-sidebar/admin-sidebar.component';
|
import { AdminSidebarComponent } from './app/admin/admin-sidebar/admin-sidebar.component';
|
||||||
|
import {
|
||||||
|
CommunityPageSubCommunityListComponent
|
||||||
|
} from './app/community-page/sub-community-list/community-page-sub-community-list.component';
|
||||||
|
import {
|
||||||
|
CommunityPageSubCollectionListComponent
|
||||||
|
} from './app/community-page/sub-collection-list/community-page-sub-collection-list.component';
|
||||||
|
|
||||||
const DECLARATIONS = [
|
const DECLARATIONS = [
|
||||||
FileSectionComponent,
|
FileSectionComponent,
|
||||||
@@ -118,6 +124,8 @@ const DECLARATIONS = [
|
|||||||
ItemStatisticsPageComponent,
|
ItemStatisticsPageComponent,
|
||||||
SiteStatisticsPageComponent,
|
SiteStatisticsPageComponent,
|
||||||
CommunityPageComponent,
|
CommunityPageComponent,
|
||||||
|
CommunityPageSubCommunityListComponent,
|
||||||
|
CommunityPageSubCollectionListComponent,
|
||||||
CollectionPageComponent,
|
CollectionPageComponent,
|
||||||
ItemPageComponent,
|
ItemPageComponent,
|
||||||
FullItemPageComponent,
|
FullItemPageComponent,
|
||||||
@@ -196,6 +204,9 @@ const DECLARATIONS = [
|
|||||||
ComcolModule,
|
ComcolModule,
|
||||||
],
|
],
|
||||||
declarations: DECLARATIONS,
|
declarations: DECLARATIONS,
|
||||||
|
exports: [
|
||||||
|
CommunityPageSubCollectionListComponent
|
||||||
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user