add themed community list component

This commit is contained in:
Art Lowel
2022-02-22 12:20:19 +01:00
parent 9fc7b57157
commit dc00fd4c75
7 changed files with 49 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
<div class="container"> <div class="container">
<h2>{{ 'communityList.title' | translate }}</h2> <h2>{{ 'communityList.title' | translate }}</h2>
<ds-community-list></ds-community-list> <ds-themed-community-list></ds-themed-community-list>
</div> </div>

View File

@@ -5,12 +5,14 @@ import { CommunityListPageComponent } from './community-list-page.component';
import { CommunityListPageRoutingModule } from './community-list-page.routing.module'; import { CommunityListPageRoutingModule } from './community-list-page.routing.module';
import { CommunityListComponent } from './community-list/community-list.component'; import { CommunityListComponent } from './community-list/community-list.component';
import { ThemedCommunityListPageComponent } from './themed-community-list-page.component'; import { ThemedCommunityListPageComponent } from './themed-community-list-page.component';
import { ThemedCommunityListComponent } from './community-list/themed-community-list.component';
const DECLARATIONS = [ const DECLARATIONS = [
CommunityListPageComponent, CommunityListPageComponent,
CommunityListComponent, CommunityListComponent,
ThemedCommunityListPageComponent ThemedCommunityListPageComponent,
ThemedCommunityListComponent
]; ];
/** /**
* The page which houses a title and the community list, as described in community-list.component * The page which houses a title and the community list, as described in community-list.component

View File

@@ -0,0 +1,23 @@
import { ThemedComponent } from '../../shared/theme-support/themed.component';
import { CommunityListComponent } from './community-list.component';
import { Component } from '@angular/core';
@Component({
selector: 'ds-themed-community-list',
styleUrls: [],
templateUrl: '../../shared/theme-support/themed.component.html',
})export class ThemedCommunityListComponent extends ThemedComponent<CommunityListComponent> {
protected getComponentName(): string {
return 'CommunityListComponent';
}
protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../../themes/${themeName}/app/community-list-page/community-list/community-list.component`);
}
protected importUnthemedComponent(): Promise<any> {
return import(`./community-list.component`);
}
}

View File

@@ -0,0 +1,18 @@
import { Component } from '@angular/core';
import { CommunityListComponent as BaseComponent } from '../../../../../app/community-list-page/community-list/community-list.component';
/**
* A tree-structured list of nodes representing the communities, their subCommunities and collections.
* Initially only the page-restricted top communities are shown.
* Each node can be expanded to show its children and all children are also page-limited.
* More pages of a page-limited result can be shown by pressing a show more node/link.
* Which nodes were expanded is kept in the store, so this persists across pages.
*/
@Component({
selector: 'ds-community-list',
// styleUrls: ['./community-list.component.scss'],
// templateUrl: './community-list.component.html'
templateUrl: '../../../../../app/community-list-page/community-list/community-list.component.html'
})
export class CommunityListComponent extends BaseComponent {}

View File

@@ -79,6 +79,7 @@ import { HeaderComponent } from './app/header/header.component';
import { FooterComponent } from './app/footer/footer.component'; import { FooterComponent } from './app/footer/footer.component';
import { BreadcrumbsComponent } from './app/breadcrumbs/breadcrumbs.component'; import { BreadcrumbsComponent } from './app/breadcrumbs/breadcrumbs.component';
import { HeaderNavbarWrapperComponent } from './app/header-nav-wrapper/header-navbar-wrapper.component'; import { HeaderNavbarWrapperComponent } from './app/header-nav-wrapper/header-navbar-wrapper.component';
import { CommunityListComponent } from './app/community-list-page/community-list/community-list.component';
const DECLARATIONS = [ const DECLARATIONS = [
HomePageComponent, HomePageComponent,
@@ -119,7 +120,8 @@ const DECLARATIONS = [
HeaderComponent, HeaderComponent,
NavbarComponent, NavbarComponent,
HeaderNavbarWrapperComponent, HeaderNavbarWrapperComponent,
BreadcrumbsComponent BreadcrumbsComponent,
CommunityListComponent
]; ];
@NgModule({ @NgModule({