mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-06 05:22:52 +00:00
feat: add content to empty catalogs
This commit is contained in:
committed by
Rainer Killinger
parent
6270a93151
commit
982fb1653b
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 StApps
|
~ Copyright (C) 2023 StApps
|
||||||
~ This program is free software: you can redistribute it and/or modify it
|
~ 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
|
~ under the terms of the GNU General Public License as published by the Free
|
||||||
~ Software Foundation, version 3.
|
~ Software Foundation, version 3.
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<stapps-origin-detail [origin]="item.origin"></stapps-origin-detail>
|
<stapps-origin-detail [origin]="item.origin"></stapps-origin-detail>
|
||||||
|
|
||||||
<ng-template #defaultContent>
|
<ng-template #defaultContent>
|
||||||
<div [ngSwitch]="item.type">
|
<div [ngSwitch]="item.type" class="content-switch">
|
||||||
<stapps-article-detail-content
|
<stapps-article-detail-content
|
||||||
[item]="$any(item)"
|
[item]="$any(item)"
|
||||||
*ngSwitchCase="'article'"
|
*ngSwitchCase="'article'"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Copyright (C) 2022 StApps
|
* Copyright (C) 2023 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* 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
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -14,6 +14,48 @@
|
|||||||
*/
|
*/
|
||||||
@import 'src/theme/util/_mixins.scss';
|
@import 'src/theme/util/_mixins.scss';
|
||||||
|
|
||||||
|
stapps-origin-detail {
|
||||||
|
// css hack to make the element stick to the bottom of the scroll container even
|
||||||
|
// when the content is not filling it
|
||||||
|
position: sticky;
|
||||||
|
top: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-switch {
|
||||||
|
// prevent a scrollbar from appearing in some cases
|
||||||
|
margin-block-start: -1px !important;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
padding: 0 var(--spacing-md);
|
||||||
|
|
||||||
|
::ng-deep > * {
|
||||||
|
display: flex;
|
||||||
|
height: fit-content;
|
||||||
|
width: 100%;
|
||||||
|
flex-direction: column;
|
||||||
|
@include border-radius-in-parallax(var(--border-radius-default));
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
margin-block-start: calc((var(--header-spacing-bottom) - var(--spacing-xl)) * -1);
|
||||||
|
margin-block-end: var(--spacing-xl);
|
||||||
|
background-color: var(--ion-color-primary-contrast);
|
||||||
|
@include content-padding();
|
||||||
|
|
||||||
|
& > ion-thumbnail {
|
||||||
|
background: var(--ion-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Firefox doesn't support this yet...
|
||||||
|
@supports selector(:has(*)) {
|
||||||
|
& > .expand-when-space,
|
||||||
|
&:has(> .expand-when-space) {
|
||||||
|
height: unset;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:host ::ng-deep {
|
:host ::ng-deep {
|
||||||
ion-slides.work-locations {
|
ion-slides.work-locations {
|
||||||
ion-slide {
|
ion-slide {
|
||||||
@@ -49,21 +91,4 @@
|
|||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
> div {
|
|
||||||
padding: 0 var(--spacing-md);
|
|
||||||
|
|
||||||
& > * {
|
|
||||||
display: block;
|
|
||||||
@include border-radius-in-parallax(var(--border-radius-default));
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
top: calc((var(--header-spacing-bottom) - var(--spacing-xl)) * -1);
|
|
||||||
background-color: var(--ion-color-primary-contrast);
|
|
||||||
|
|
||||||
& > ion-thumbnail {
|
|
||||||
background: var(--ion-color-primary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Copyright (C) 2022 StApps
|
* Copyright (C) 2023 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* 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
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -25,6 +25,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ion-content > div > stapps-data-detail-content,
|
||||||
|
ion-content > div {
|
||||||
|
min-height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
::ng-deep {
|
::ng-deep {
|
||||||
ion-slides.work-locations {
|
ion-slides.work-locations {
|
||||||
ion-slide {
|
ion-slide {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 StApps
|
* Copyright (C) 2023 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* 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
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -28,9 +28,6 @@ import {DataListContext} from './data-list.component';
|
|||||||
styleUrls: ['simple-data-list.scss'],
|
styleUrls: ['simple-data-list.scss'],
|
||||||
})
|
})
|
||||||
export class SimpleDataListComponent implements OnInit, OnDestroy {
|
export class SimpleDataListComponent implements OnInit, OnDestroy {
|
||||||
/**
|
|
||||||
* All SCThings to display
|
|
||||||
*/
|
|
||||||
@Input() items?: Promise<SCThings[] | undefined>;
|
@Input() items?: Promise<SCThings[] | undefined>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,6 +42,8 @@ export class SimpleDataListComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
@Input() listHeader?: string;
|
@Input() listHeader?: string;
|
||||||
|
|
||||||
|
@Input() emptyListMessage?: string;
|
||||||
|
|
||||||
@ContentChild(TemplateRef) listItemTemplateRef: TemplateRef<DataListContext<SCThings>>;
|
@ContentChild(TemplateRef) listItemTemplateRef: TemplateRef<DataListContext<SCThings>>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 StApps
|
~ Copyright (C) 2023 StApps
|
||||||
~ This program is free software: you can redistribute it and/or modify it
|
~ 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
|
~ under the terms of the GNU General Public License as published by the Free
|
||||||
~ Software Foundation, version 3.
|
~ Software Foundation, version 3.
|
||||||
@@ -22,6 +22,9 @@
|
|||||||
></ng-container>
|
></ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
<ion-label class="empty-list-message" *ngIf="emptyListMessage && (items | async)?.length === 0">{{
|
||||||
|
emptyListMessage
|
||||||
|
}}</ion-label>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-template #loading>
|
<ng-template #loading>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*!
|
||||||
|
* Copyright (C) 2023 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.empty-list-message {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--ion-color-medium);
|
||||||
|
min-height: 300px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,22 @@
|
|||||||
|
<!--
|
||||||
|
~ Copyright (C) 2023 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/>.
|
||||||
|
-->
|
||||||
|
|
||||||
<stapps-simple-data-list
|
<stapps-simple-data-list
|
||||||
id="simple-data-list"
|
id="simple-data-list"
|
||||||
[items]="items"
|
[items]="items"
|
||||||
[singleType]="true"
|
[singleType]="true"
|
||||||
[listHeader]="'type' | thingTranslate: item | titlecase"
|
[listHeader]="'type' | thingTranslate: item | titlecase"
|
||||||
|
[emptyListMessage]="'catalog.detail.EMPTY_CATALOG' | translate"
|
||||||
></stapps-simple-data-list>
|
></stapps-simple-data-list>
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/*!
|
||||||
|
* Copyright (C) 2023 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/>.
|
||||||
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 StApps
|
~ Copyright (C) 2023 StApps
|
||||||
~ This program is free software: you can redistribute it and/or modify it
|
~ 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
|
~ under the terms of the GNU General Public License as published by the Free
|
||||||
~ Software Foundation, version 3.
|
~ Software Foundation, version 3.
|
||||||
@@ -41,7 +41,9 @@
|
|||||||
</ion-card>
|
</ion-card>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="hasValidLocation">
|
<ng-container *ngIf="hasValidLocation">
|
||||||
<ion-card class="map-widget">
|
<stapps-map-widget
|
||||||
<stapps-map-widget [place]="item" expandable="true"></stapps-map-widget>
|
class="map-widget expand-when-space"
|
||||||
</ion-card>
|
[place]="item"
|
||||||
|
expandable="true"
|
||||||
|
></stapps-map-widget>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@@ -1,4 +1,21 @@
|
|||||||
ion-card.map-widget {
|
/*!
|
||||||
|
* Copyright (C) 2023 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.map-widget {
|
||||||
|
position: relative;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
|
min-height: 300px;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,7 +252,8 @@
|
|||||||
"catalog": {
|
"catalog": {
|
||||||
"title": "Vorlesungsverzeichnis",
|
"title": "Vorlesungsverzeichnis",
|
||||||
"detail": {
|
"detail": {
|
||||||
"EMPTY_SEMESTER": "Keine Verzeichnisdaten für das ausgewählte Semester vorhanden"
|
"EMPTY_SEMESTER": "Keine Verzeichnisdaten für das ausgewählte Semester vorhanden",
|
||||||
|
"EMPTY_CATALOG": "Keine Veranstaltung in diesem Bereich gefunden"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"library": {
|
"library": {
|
||||||
|
|||||||
@@ -252,7 +252,8 @@
|
|||||||
"catalog": {
|
"catalog": {
|
||||||
"title": "course catalog",
|
"title": "course catalog",
|
||||||
"detail": {
|
"detail": {
|
||||||
"EMPTY_SEMESTER": "No catalog data available for selected semester"
|
"EMPTY_SEMESTER": "No catalog data available for selected semester",
|
||||||
|
"EMPTY_CATALOG": "No events were found in this area"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"library": {
|
"library": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Copyright (C) 2022 StApps
|
* Copyright (C) 2023 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* 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
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -22,36 +22,43 @@
|
|||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin ion-sm-down {
|
@mixin ion-sm-down {
|
||||||
@media (max-width: 575.98px) {
|
@media (max-width: 575.98px) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin ion-md-up {
|
@mixin ion-md-up {
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin ion-md-down {
|
@mixin ion-md-down {
|
||||||
@media (max-width: 767.98px) {
|
@media (max-width: 767.98px) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin ion-lg-up {
|
@mixin ion-lg-up {
|
||||||
@media (min-width: 992px) {
|
@media (min-width: 992px) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin ion-lg-down {
|
@mixin ion-lg-down {
|
||||||
@media (max-width: 991.98px) {
|
@media (max-width: 991.98px) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin ion-xl-up {
|
@mixin ion-xl-up {
|
||||||
@media (min-width: 1200px) {
|
@media (min-width: 1200px) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin ion-xl-down {
|
@mixin ion-xl-down {
|
||||||
@media (max-width: 1199.98px) {
|
@media (max-width: 1199.98px) {
|
||||||
@content;
|
@content;
|
||||||
@@ -83,3 +90,9 @@
|
|||||||
// and disregard border radius in some cases
|
// and disregard border radius in some cases
|
||||||
transform: translateZ(0);
|
transform: translateZ(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin content-padding {
|
||||||
|
margin-inline-start: calc(
|
||||||
|
clamp(0px, (100% - var(--preferred-content-width)) / 2, var(--content-inline-start-padding-bias))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user