mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
refactor: pre release cleanup all over the place
This commit is contained in:
@@ -46,6 +46,11 @@ export class AddEventActionChipComponent implements OnDestroy {
|
||||
*/
|
||||
associatedDateSeries: Promise<SCDateSeries[]>;
|
||||
|
||||
/**
|
||||
* Color
|
||||
*/
|
||||
color: string;
|
||||
|
||||
/**
|
||||
* Disabled
|
||||
*/
|
||||
@@ -56,6 +61,9 @@ export class AddEventActionChipComponent implements OnDestroy {
|
||||
*/
|
||||
icon: string;
|
||||
|
||||
/**
|
||||
* Current state of icon fill
|
||||
*/
|
||||
iconFill: boolean;
|
||||
|
||||
/**
|
||||
@@ -98,11 +106,12 @@ export class AddEventActionChipComponent implements OnDestroy {
|
||||
*/
|
||||
applyState(state: AddEventStates) {
|
||||
this.state = state;
|
||||
const {label, icon, disabled, fill} = this.states[state];
|
||||
const {label, icon, disabled, fill, color} = this.states[state];
|
||||
this.label = label;
|
||||
this.icon = icon;
|
||||
this.iconFill = fill;
|
||||
this.disabled = disabled;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,23 +28,27 @@ export const AddEventStatesMap = {
|
||||
fill: true,
|
||||
label: 'data.chips.add_events.ADDED_ALL',
|
||||
disabled: false,
|
||||
color: 'success',
|
||||
},
|
||||
[AddEventStates.ADDED_SOME]: {
|
||||
icon: SCIcon`event`,
|
||||
fill: true,
|
||||
label: 'data.chips.add_events.ADDED_SOME',
|
||||
disabled: false,
|
||||
color: 'success',
|
||||
},
|
||||
[AddEventStates.REMOVED_ALL]: {
|
||||
icon: SCIcon`calendar_today`,
|
||||
fill: false,
|
||||
label: 'data.chips.add_events.REMOVED_ALL',
|
||||
disabled: false,
|
||||
color: 'primary',
|
||||
},
|
||||
[AddEventStates.UNAVAILABLE]: {
|
||||
icon: SCIcon`event_busy`,
|
||||
fill: false,
|
||||
label: 'data.chips.add_events.UNAVAILABLE',
|
||||
disabled: true,
|
||||
color: 'dark',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
@chipTransition
|
||||
[disabled]="disabled"
|
||||
(click)="$event.stopPropagation(); editModal.present()"
|
||||
[color]="color"
|
||||
[outline]="true"
|
||||
>
|
||||
<ion-icon [name]="icon" [fill]="iconFill"></ion-icon>
|
||||
<ion-label>{{ label | translate }}</ion-label>
|
||||
|
||||
@@ -19,32 +19,38 @@
|
||||
}}</ion-card-header>
|
||||
<ion-card-content>
|
||||
<div *ngFor="let offer of offers">
|
||||
<p *ngIf="offer.inPlace">
|
||||
<ion-icon name="pin_drop"></ion-icon>
|
||||
<a [routerLink]="['/data-detail', offer.inPlace.uid]">{{
|
||||
'name' | thingTranslate: offer.inPlace
|
||||
}}</a
|
||||
>,
|
||||
<span
|
||||
*ngIf="
|
||||
offer.availabilityRange.gt
|
||||
? offer.availabilityRange.gt
|
||||
: offer.availabilityRange.gte
|
||||
"
|
||||
>
|
||||
<ion-icon name="calendar_today"></ion-icon>
|
||||
{{
|
||||
(offer.availabilityRange.gt
|
||||
? offer.availabilityRange.gt
|
||||
: offer.availabilityRange.gte
|
||||
) | amDateFormat: 'll'
|
||||
}}
|
||||
</span>
|
||||
</p>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-icon name="pin_drop"></ion-icon>
|
||||
<a [routerLink]="['/data-detail', offer.inPlace.uid]">
|
||||
{{ 'name' | thingTranslate: offer.inPlace }}
|
||||
</a>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<span
|
||||
*ngIf="
|
||||
offer.availabilityRange.gt
|
||||
? offer.availabilityRange.gt
|
||||
: offer.availabilityRange.gte
|
||||
"
|
||||
>
|
||||
{{
|
||||
(offer.availabilityRange.gt
|
||||
? offer.availabilityRange.gt
|
||||
: offer.availabilityRange.gte
|
||||
) | amDateFormat: 'll'
|
||||
}}
|
||||
</span>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
<ion-grid *ngIf="offer.prices">
|
||||
<ion-row *ngFor="let group of objectKeys(offer.prices)">
|
||||
<ion-col>{{ group | titlecase }}</ion-col>
|
||||
<ion-col width-20 text-right>
|
||||
<ion-col *ngIf="group !== 'default'">{{
|
||||
'data.detail.offers.' + group | translate
|
||||
}}</ion-col>
|
||||
<ion-col *ngIf="group !== 'default'" width-20 text-right>
|
||||
<p>
|
||||
{{
|
||||
offer.prices[group] | currency: 'EUR':'symbol':undefined:'de'
|
||||
|
||||
@@ -19,6 +19,8 @@ ion-item {
|
||||
@include border-radius-in-parallax(var(--border-radius-default));
|
||||
overflow: hidden;
|
||||
--inner-padding-end: 0;
|
||||
--padding-start: var(--spacing-sm);
|
||||
margin: var(--spacing-sm);
|
||||
|
||||
ion-thumbnail {
|
||||
--ion-margin: var(--spacing-xs);
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
AnimationBuilder,
|
||||
AnimationController,
|
||||
} from '@ionic/angular';
|
||||
import {Capacitor} from '@capacitor/core';
|
||||
import {
|
||||
SCFacet,
|
||||
SCFeatureConfiguration,
|
||||
@@ -250,7 +251,9 @@ export class SearchPageComponent implements OnInit, OnDestroy {
|
||||
* Hides keyboard in native app environments
|
||||
*/
|
||||
hideKeyboard() {
|
||||
Keyboard.hide();
|
||||
if (Capacitor.isNativePlatform()) {
|
||||
Keyboard.hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<ion-card *ngIf="item.characteristics">
|
||||
<ion-card-header>{{
|
||||
'characteristics' | propertyNameTranslate: item | titlecase
|
||||
<ion-card-header class="no-padding-inline-start">{{
|
||||
'data.types.dish.CHARACTERISTICS' | translate
|
||||
}}</ion-card-header>
|
||||
<ion-card-content
|
||||
*ngFor="
|
||||
let characteristic of 'characteristics' | thingTranslate: item
|
||||
"
|
||||
>
|
||||
<p>
|
||||
<ion-card-content class="no-padding-inline-start">
|
||||
<p
|
||||
*ngFor="
|
||||
let characteristic of 'characteristics' | thingTranslate: item
|
||||
"
|
||||
>
|
||||
<img
|
||||
*ngIf="characteristic.image"
|
||||
[src]="characteristic.image"
|
||||
@@ -33,12 +33,6 @@
|
||||
*ngIf="item.offers"
|
||||
[offers]="item.offers"
|
||||
></stapps-offers-detail>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.additives"
|
||||
[title]="'additives' | propertyNameTranslate: item | titlecase"
|
||||
[content]="'additives' | thingTranslate: item | join: ', '"
|
||||
>
|
||||
</stapps-simple-card>
|
||||
<ion-card *ngIf="item.nutrition">
|
||||
<ion-card-header>{{
|
||||
'data.types.dish.detail.AVG_NUTRITION_INFO' | translate
|
||||
@@ -88,3 +82,9 @@
|
||||
</ion-grid>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.additives"
|
||||
[title]="'additives' | propertyNameTranslate: item | titlecase"
|
||||
[content]="'additives' | thingTranslate: item | join: ', '"
|
||||
>
|
||||
</stapps-simple-card>
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
<p class="title-sub ion-hide-sm-down">
|
||||
{{ 'description' | thingTranslate: item }}
|
||||
</p>
|
||||
<p>{{ 'categories' | thingTranslate: item | join: ', ' }}</p>
|
||||
<ion-note>{{
|
||||
'categories' | thingTranslate: item | join: ', '
|
||||
}}</ion-note>
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col width-10 text-right>
|
||||
|
||||
@@ -13,22 +13,43 @@
|
||||
~ this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<ion-card>
|
||||
<ion-card-content>
|
||||
<stapps-add-event-action-chip
|
||||
*ngIf="item.type === 'academic event'"
|
||||
[item]="item"
|
||||
>
|
||||
</stapps-add-event-action-chip>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.type === 'academic event' && item.categories"
|
||||
[title]="'categories' | propertyNameTranslate: item | titlecase"
|
||||
[content]="'categories' | thingTranslate: item"
|
||||
>
|
||||
</stapps-simple-card>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<ion-card>
|
||||
<stapps-add-event-action-chip
|
||||
*ngIf="item.type === 'academic event'"
|
||||
[item]="item"
|
||||
>
|
||||
</stapps-add-event-action-chip>
|
||||
</ion-card>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
<stapps-simple-card
|
||||
*ngIf="item.type === 'academic event' && item.categories"
|
||||
[title]="'categories' | propertyNameTranslate: item"
|
||||
[content]="'categories' | thingTranslate: item"
|
||||
>
|
||||
</stapps-simple-card>
|
||||
*ngIf="item.performers"
|
||||
[title]="'performers' | propertyNameTranslate: item | titlecase"
|
||||
[content]="item.performers"
|
||||
></stapps-simple-card>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.organizers"
|
||||
[title]="'organizers' | propertyNameTranslate: item | titlecase"
|
||||
[content]="item.organizers"
|
||||
></stapps-simple-card>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.type === 'academic event' && item.majors | titlecase"
|
||||
[title]="'majors' | propertyNameTranslate: item"
|
||||
[content]="item.majors"
|
||||
></stapps-simple-card>
|
||||
<ion-card *ngIf="item.catalogs">
|
||||
<ion-card-header>{{
|
||||
$any('superCatalogs' | propertyNameTranslate: 'catalog') | titlecase
|
||||
@@ -45,18 +66,3 @@
|
||||
</event-route-path>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.performers"
|
||||
[title]="'performers' | propertyNameTranslate: item"
|
||||
[content]="item.performers"
|
||||
></stapps-simple-card>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.organizers"
|
||||
[title]="'organizers' | propertyNameTranslate: item"
|
||||
[content]="item.organizers"
|
||||
></stapps-simple-card>
|
||||
<stapps-simple-card
|
||||
*ngIf="item.type === 'academic event' && item.majors"
|
||||
[title]="'majors' | propertyNameTranslate: item"
|
||||
[content]="item.majors"
|
||||
></stapps-simple-card>
|
||||
|
||||
@@ -2,23 +2,32 @@
|
||||
<ion-row *ngIf="item.type === 'academic event'">
|
||||
<ion-col>
|
||||
<div class="ion-text-wrap">
|
||||
<ion-label class="title">{{ item.name }}</ion-label>
|
||||
<p *ngIf="item.description" class="title-sub">{{ item.description }}</p>
|
||||
<p *ngIf="item.academicTerms" class="title-sub">
|
||||
{{ item.academicTerms[0].name }}
|
||||
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
|
||||
<p *ngIf="item.description" class="title-sub">
|
||||
{{ 'description' | thingTranslate: item }}
|
||||
</p>
|
||||
<ion-note>{{ item.type }} ({{ item.categories.join(', ') }})</ion-note>
|
||||
<p *ngIf="item.academicTerms" class="title-sub">
|
||||
{{ 'name' | thingTranslate: item.academicTerms[0] }}
|
||||
</p>
|
||||
<ion-note *ngIf="!item.categories">{{
|
||||
'type' | thingTranslate: item
|
||||
}}</ion-note>
|
||||
<ion-note *ngIf="item.categories">
|
||||
{{ 'categories' | thingTranslate: item | join: ', ' }}
|
||||
</ion-note>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row *ngIf="item.type === 'sport course'">
|
||||
<ion-col>
|
||||
<ion-label class="title">{{ item.name }}</ion-label>
|
||||
<p *ngIf="item.description" class="title-sub">{{ item.description }}</p>
|
||||
<p *ngIf="item.academicTerms" class="title-sub">
|
||||
{{ item.academicTerms[0].name }}
|
||||
<ion-label class="title">{{ 'name' | thingTranslate: item }}</ion-label>
|
||||
<p *ngIf="item.description" class="title-sub">
|
||||
{{ 'description' | thingTranslate: item }}
|
||||
</p>
|
||||
<ion-note>{{ item.type }}</ion-note>
|
||||
<p *ngIf="item.academicTerms" class="title-sub">
|
||||
{{ 'name' | thingTranslate: item.academicTerms[0] }}
|
||||
</p>
|
||||
<ion-note>{{ 'type' | thingTranslate: item }}</ion-note>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
@@ -1,31 +1,33 @@
|
||||
<ng-container>
|
||||
<div *ngIf="dishes | async as dishes; else loading">
|
||||
<ion-segment [(ngModel)]="selectedDay" mode="md">
|
||||
<ion-segment-button
|
||||
*ngFor="let day of dishes | keyvalue"
|
||||
[value]="day.key"
|
||||
>
|
||||
<ion-label class="ion-hide-sm-down">{{
|
||||
day.key | dateFormat: 'weekday:long,month:numeric,day:numeric'
|
||||
}}</ion-label>
|
||||
<ion-label class="ion-hide-sm-up">{{
|
||||
day.key | dateFormat: 'weekday:short,month:numeric,day:numeric'
|
||||
}}</ion-label>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
<div [ngSwitch]="selectedDay">
|
||||
<div *ngFor="let date of dishes | keyvalue">
|
||||
<ion-list *ngSwitchCase="date.key">
|
||||
<ng-container *ngFor="let dish of date.value; index as i">
|
||||
<stapps-data-list-item
|
||||
[item]="dish"
|
||||
[hideThumbnail]="true"
|
||||
></stapps-data-list-item>
|
||||
</ng-container>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ng-container *ngIf="dishes | async as dishes; else loading">
|
||||
<ng-container *ngIf="(dishes | json) !== '{}'; else empty">
|
||||
<ion-segment [(ngModel)]="selectedDay" mode="md">
|
||||
<ion-segment-button
|
||||
*ngFor="let day of dishes | keyvalue"
|
||||
[value]="day.key"
|
||||
>
|
||||
<ion-label class="ion-hide-sm-down">{{
|
||||
day.key | dateFormat: 'weekday:long,month:numeric,day:numeric'
|
||||
}}</ion-label>
|
||||
<ion-label class="ion-hide-sm-up">{{
|
||||
day.key | dateFormat: 'weekday:short,month:numeric,day:numeric'
|
||||
}}</ion-label>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
<ng-container [ngSwitch]="selectedDay">
|
||||
<ng-container *ngFor="let date of dishes | keyvalue">
|
||||
<ion-list *ngSwitchCase="date.key">
|
||||
<ng-container *ngFor="let dish of date.value; index as i">
|
||||
<stapps-data-list-item
|
||||
[item]="dish"
|
||||
[hideThumbnail]="true"
|
||||
></stapps-data-list-item>
|
||||
</ng-container>
|
||||
</ion-list>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<ng-template #loading>
|
||||
<ion-segment>
|
||||
<stapps-skeleton-segment-button
|
||||
@@ -38,4 +40,13 @@
|
||||
></stapps-skeleton-list-item>
|
||||
</ion-list>
|
||||
</ng-template>
|
||||
<ng-template #empty>
|
||||
<ion-card>
|
||||
<ion-card-header>
|
||||
<ion-label class="title">
|
||||
{{ 'data.types.dish.EMPTY_DISHES' | translate }}
|
||||
</ion-label>
|
||||
</ion-card-header>
|
||||
</ion-card>
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
|
||||
Reference in New Issue
Block a user