refactor: adjust HeBIS templates in list

Closes #318
This commit is contained in:
Jovan Krunić
2022-10-26 18:05:54 +02:00
committed by Rainer Killinger
parent 18ab92909d
commit aba9627661
22 changed files with 110 additions and 169 deletions

View File

@@ -44,7 +44,6 @@ import {DataListComponent} from './list/data-list.component';
import {FoodDataListComponent} from './list/food-data-list.component';
import {SearchPageComponent} from './list/search-page.component';
import {StAppsWebHttpClient} from './stapps-web-http-client.provider';
import {ArticleDetailContentComponent} from './types/article/article-detail-content.component';
import {CatalogDetailContentComponent} from './types/catalog/catalog-detail-content.component';
import {DateSeriesDetailContentComponent} from './types/date-series/date-series-detail-content.component';
import {DishDetailContentComponent} from './types/dish/dish-detail-content.component';
@@ -60,7 +59,6 @@ import {PlaceMensaDetailComponent} from './types/place/special/mensa/place-mensa
import {SemesterDetailContentComponent} from './types/semester/semester-detail-content.component';
import {MapWidgetComponent} from '../map/widget/map-widget.component';
import {LeafletModule} from '@asymmetrik/ngx-leaflet';
import {ArticleListItemComponent} from './types/article/article-list-item.component';
import {SkeletonSimpleCardComponent} from './elements/skeleton-simple-card.component';
import {CatalogListItemComponent} from './types/catalog/catalog-list-item.component';
import {DataListItemComponent} from './list/data-list-item.component';
@@ -91,6 +89,12 @@ import {TreeListFragmentComponent} from './list/tree-list-fragment.component';
import {SettingsProvider} from '../settings/settings.provider';
import {IonIconModule} from '../../util/ion-icon/ion-icon.module';
import {ExternalLinkComponent} from './elements/external-link.component';
import {ArticleListItemComponent} from './types/article/article-item.component';
import {ArticleContentComponent} from './types/article/article-content.component';
import {BookDetailContentComponent} from './types/book/book-detail-content.component';
import {BookListItemComponent} from './types/book/book-list-item.component';
import {PeriodicalListItemComponent} from './types/periodical/periodical-list-item.component';
import {PeriodicalDetailContentComponent} from './types/periodical/periodical-detail-content.component';
/**
* Module for handling data
@@ -101,8 +105,6 @@ import {ExternalLinkComponent} from './elements/external-link.component';
AddEventActionChipComponent,
EditEventSelectionComponent,
AddressDetailComponent,
ArticleDetailContentComponent,
ArticleListItemComponent,
CatalogDetailContentComponent,
CatalogListItemComponent,
DataDetailComponent,
@@ -152,6 +154,12 @@ import {ExternalLinkComponent} from './elements/external-link.component';
SimpleDataListComponent,
TitleCardComponent,
ExternalLinkComponent,
ArticleListItemComponent,
ArticleContentComponent,
BookListItemComponent,
BookDetailContentComponent,
PeriodicalListItemComponent,
PeriodicalDetailContentComponent,
],
entryComponents: [DataListComponent, SimpleDataListComponent],
imports: [
@@ -199,11 +207,13 @@ import {ExternalLinkComponent} from './elements/external-link.component';
SkeletonSimpleCardComponent,
SearchPageComponent,
SimpleDataListComponent,
ArticleDetailContentComponent,
OriginDetailComponent,
FavoriteButtonComponent,
TreeListComponent,
ExternalLinkComponent,
ArticleContentComponent,
BookDetailContentComponent,
PeriodicalDetailContentComponent,
],
})
export class DataModule {}

View File

@@ -103,6 +103,18 @@
[item]="$any(item)"
*ngSwitchCase="item.type === 'video'"
></stapps-video-list-item>
<stapps-book-list-item
[item]="$any(item)"
*ngSwitchCase="item.type === 'book'"
></stapps-book-list-item>
<stapps-periodical-list-item
[item]="$any(item)"
*ngSwitchCase="item.type === 'periodical'"
></stapps-periodical-list-item>
<stapps-article-item
[item]="$any(item)"
*ngSwitchCase="item.type === 'article'"
></stapps-article-item>
<div *ngSwitchDefault>
<h2>
{{ 'name' | thingTranslate: item }}

View File

@@ -19,10 +19,10 @@ import {SCArticle} from '@openstapps/core';
* TODO
*/
@Component({
selector: 'stapps-hebis-article-content',
templateUrl: 'hebis-article-content.html',
selector: 'stapps-article-content',
templateUrl: 'article-content.html',
})
export class HebisArticleContentComponent {
export class ArticleContentComponent {
/**
* TODO
*/

View File

@@ -1,30 +0,0 @@
/*
* Copyright (C) 2019 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Component, Input} from '@angular/core';
import {SCArticle} from '@openstapps/core';
/**
* TODO
*/
@Component({
selector: 'stapps-article-detail-content',
templateUrl: 'article-detail-content.html',
})
export class ArticleDetailContentComponent {
/**
* TODO
*/
@Input() item: SCArticle;
}

View File

@@ -1,16 +0,0 @@
<stapps-simple-card
[title]="'categories' | propertyNameTranslate: item | titlecase"
[content]="'categories' | thingTranslate: item"
>
</stapps-simple-card>
<stapps-simple-card
*ngIf="item.datePublished"
[title]="'datePublished' | propertyNameTranslate: item | titlecase"
[content]="item.datePublished | amDateFormat: 'll'"
></stapps-simple-card>
<stapps-simple-card
[title]="'articleBody' | propertyNameTranslate: item | titlecase"
[content]="'articleBody' | thingTranslate: item"
[isMarkdown]="true"
>
</stapps-simple-card>

View File

@@ -20,7 +20,7 @@ import {DataListItemComponent} from '../../list/data-list-item.component';
* TODO
*/
@Component({
selector: 'stapps-article-list-item',
selector: 'stapps-article-item',
templateUrl: 'article-list-item.html',
})
export class ArticleListItemComponent extends DataListItemComponent {

View File

@@ -1,15 +1,27 @@
<ion-grid>
<ion-row>
<ion-col>
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
<p *ngIf="item.keywords">
<stapps-long-inline-text
[text]="item.keywords.join(', ')"
[size]="110"
></stapps-long-inline-text>
<h2 class="name">
{{ 'name' | thingTranslate: item }}
</h2>
<p>
<ng-container *ngFor="let author of item.authors">
{{ 'name' | thingTranslate: author }}</ng-container
><ng-container
*ngIf="item.authors && item.authors && item.firstPublished"
>,&nbsp;</ng-container
>
<ng-container
*ngIf="item.firstPublished && !item.lastPublished; else dateRange"
>{{ item.firstPublished }}</ng-container
><ng-template #dateRange
><ng-container *ngIf="item.firstPublished && item.lastPublished">{{
[item.firstPublished, item.lastPublished] | join: ' - '
}}</ng-container></ng-template
>
</p>
<ion-note>
{{ 'type' | thingTranslate: item }}
{{ 'categories' | thingTranslate: item }}
</ion-note>
</ion-col>
</ion-row>

View File

@@ -14,7 +14,7 @@
*/
import {Component, Input} from '@angular/core';
import {SCBook} from '@openstapps/core';
import {DataListItemComponent} from '../../../data/list/data-list-item.component';
import {DataListItemComponent} from '../../list/data-list-item.component';
/**
* TODO

View File

@@ -0,0 +1,28 @@
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">
{{ 'name' | thingTranslate: item }}
</h2>
<p>
<ng-container *ngFor="let author of item.authors">
{{ 'name' | thingTranslate: author }}</ng-container
><ng-container
*ngIf="item.authors && item.authors && item.firstPublished"
>,&nbsp;</ng-container
>
<ng-container
*ngIf="item.firstPublished && !item.lastPublished; else dateRange"
>{{ item.firstPublished }}</ng-container
><ng-template #dateRange
><ng-container *ngIf="item.firstPublished && item.lastPublished">{{
[item.firstPublished, item.lastPublished] | join: ' - '
}}</ng-container></ng-template
>
</p>
<ion-note>
{{ 'categories' | thingTranslate: item }}
</ion-note>
</ion-col>
</ion-row>
</ion-grid>

View File

@@ -14,7 +14,7 @@
*/
import {Component, Input} from '@angular/core';
import {SCPeriodical} from '@openstapps/core';
import {DataListItemComponent} from '../../../data/list/data-list-item.component';
import {DataListItemComponent} from '../../list/data-list-item.component';
/**
* TODO

View File

@@ -0,0 +1,28 @@
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">
{{ 'name' | thingTranslate: item }}
</h2>
<p>
<ng-container *ngFor="let author of item.authors">
{{ 'name' | thingTranslate: author }}</ng-container
><ng-container
*ngIf="item.authors && item.authors && item.firstPublished"
>,&nbsp;</ng-container
>
<ng-container
*ngIf="item.firstPublished && !item.lastPublished; else dateRange"
>{{ item.firstPublished }}</ng-container
><ng-template #dateRange
><ng-container *ngIf="item.firstPublished && item.lastPublished">{{
[item.firstPublished, item.lastPublished] | join: ' - '
}}</ng-container></ng-template
>
</p>
<ion-note>
{{ 'categories' | thingTranslate: item }}
</ion-note>
</ion-col>
</ion-row>
</ion-grid>

View File

@@ -22,10 +22,10 @@
[item]="item"
*ngSwitchCase="'periodical'"
></stapps-periodical-detail-content>
<stapps-hebis-article-content
<stapps-article-content
[item]="item"
*ngSwitchCase="'article'"
></stapps-hebis-article-content>
></stapps-article-content>
<ng-container *ngSwitchDefault>
<ion-item class="ion-text-wrap" lines="inset">
<ion-thumbnail slot="start" class="ion-margin-end">

View File

@@ -32,14 +32,6 @@ import {DaiaDataProvider} from './daia-data.provider';
import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
import {HebisRoutingModule} from './hebis-routing.module';
import {DataModule} from '../data/data.module';
import {BookDetailContentComponent} from './types/book/book-detail-content.component';
import {BookListItemComponent} from './types/book/book-list-item.component';
import {PeriodicalListItemComponent} from './types/periodical/periodical-list-item.component';
import {PeriodicalDetailContentComponent} from './types/periodical/periodical-detail-content.component';
import {HebisArticleListItemComponent} from './types/hebis-article/hebis-article-item.component';
import {HebisArticleContentComponent} from './types/hebis-article/hebis-article-content.component';
import {DataListComponent} from '../data/list/data-list.component';
import {DaiaAvailabilityComponent} from './daia-availability/daia-availability.component';
import {UtilModule} from '../../util/util.module';
@@ -55,12 +47,6 @@ import {DaiaHoldingComponent} from './daia-availability/daia-holding.component';
HebisDetailComponent,
HebisDetailContentComponent,
DaiaAvailabilityComponent,
BookDetailContentComponent,
BookListItemComponent,
PeriodicalDetailContentComponent,
PeriodicalListItemComponent,
HebisArticleListItemComponent,
HebisArticleContentComponent,
DaiaHoldingComponent,
],
entryComponents: [DataListComponent],
@@ -86,15 +72,5 @@ import {DaiaHoldingComponent} from './daia-availability/daia-holding.component';
UtilModule,
],
providers: [HebisDataProvider, DaiaDataProvider, StAppsWebHttpClient],
exports: [
HebisSearchPageComponent,
HebisDetailComponent,
HebisDetailContentComponent,
DaiaAvailabilityComponent,
PeriodicalDetailContentComponent,
BookDetailContentComponent,
HebisArticleListItemComponent,
HebisArticleContentComponent,
],
})
export class HebisModule {}

View File

@@ -1,16 +0,0 @@
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
<p *ngIf="item.keywords">
<stapps-long-inline-text
[text]="item.keywords.join(', ')"
[size]="110"
></stapps-long-inline-text>
</p>
<ion-note>
{{ 'type' | thingTranslate: item }}
</ion-note>
</ion-col>
</ion-row>
</ion-grid>

View File

@@ -1,31 +0,0 @@
/*
* Copyright (C) 2019 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Component, Input} from '@angular/core';
import {SCArticle} from '@openstapps/core';
import {DataListItemComponent} from '../../../data/list/data-list-item.component';
/**
* TODO
*/
@Component({
selector: 'stapps-hebis-article-item',
templateUrl: 'hebis-article-item.html',
})
export class HebisArticleListItemComponent extends DataListItemComponent {
/**
* TODO
*/
@Input() item: SCArticle;
}

View File

@@ -1,16 +0,0 @@
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
<p *ngIf="item.keywords">
<stapps-long-inline-text
[text]="item.keywords.join(', ')"
[size]="110"
></stapps-long-inline-text>
</p>
<ion-note>
{{ 'type' | thingTranslate: item }}
</ion-note>
</ion-col>
</ion-row>
</ion-grid>

View File

@@ -1,16 +0,0 @@
<ion-grid>
<ion-row>
<ion-col>
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
<p *ngIf="item.keywords">
<stapps-long-inline-text
[text]="item.keywords.join(', ')"
[size]="110"
></stapps-long-inline-text>
</p>
<ion-note>
{{ 'type' | thingTranslate: item }}
</ion-note>
</ion-col>
</ion-row>
</ion-grid>