diff --git a/src/app/modules/data/elements/title-card.component.html b/src/app/modules/data/elements/title-card.component.html index ec4df2c1..28bca98c 100644 --- a/src/app/modules/data/elements/title-card.component.html +++ b/src/app/modules/data/elements/title-card.component.html @@ -13,8 +13,8 @@ ~ this program. If not, see . --> - - + +

{{ 'honorificPrefix' | thingTranslate: item @@ -24,9 +24,15 @@ 'honorificSuffix' | thingTranslate: item }}

-
+ + + +
+ +
-
{{ 'name' | thingTranslate: item }}

- {{ item.openingHours | openingHours }} + + +

. + */ + +import {Component, ContentChild, Input, TemplateRef} from '@angular/core'; + +@Component({ + selector: 'stapps-opening-hours', + templateUrl: 'opening-hours.html', +}) +export class OpeningHoursComponent { + @ContentChild(TemplateRef) content: TemplateRef; + + @Input() openingHours?: string; + + @Input() colorize = true; + + @Input() showNextChange = true; +} diff --git a/src/app/util/opening-hours.html b/src/app/util/opening-hours.html new file mode 100644 index 00000000..29d7af42 --- /dev/null +++ b/src/app/util/opening-hours.html @@ -0,0 +1,34 @@ + + + +

+ + + {{ openingHours | openingHours | slice: 1:2 }} + + + + {{ openingHours | openingHours | slice: 1:2 }} + + + {{ openingHours | openingHours | slice: 2:3 }} + +
+
diff --git a/src/app/util/util.module.ts b/src/app/util/util.module.ts index 338876c4..91dc8d08 100644 --- a/src/app/util/util.module.ts +++ b/src/app/util/util.module.ts @@ -25,9 +25,16 @@ import {BrowserModule} from '@angular/platform-browser'; import {IonicModule} from '@ionic/angular'; import {TranslateModule} from '@ngx-translate/core'; import {ElementSizeChangeDirective} from './element-size-change.directive'; +import {OpeningHoursComponent} from './opening-hours.component'; +import {ThingTranslateModule} from '../translation/thing-translate.module'; @NgModule({ - imports: [BrowserModule, IonicModule, TranslateModule], + imports: [ + BrowserModule, + IonicModule, + TranslateModule, + ThingTranslateModule.forChild(), + ], declarations: [ ElementSizeChangeDirective, ArrayLastPipe, @@ -38,6 +45,7 @@ import {ElementSizeChangeDirective} from './element-size-change.directive'; DaytimeKeyPipe, NextDateInListPipe, EditModalComponent, + OpeningHoursComponent, ], exports: [ ElementSizeChangeDirective, @@ -49,6 +57,7 @@ import {ElementSizeChangeDirective} from './element-size-change.directive'; DaytimeKeyPipe, NextDateInListPipe, EditModalComponent, + OpeningHoursComponent, ], }) export class UtilModule {} diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index 82955d53..83f2f1b9 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -54,10 +54,15 @@ }, "common": { "openingHours": { - "closed_until": "Geschlossen bis", - "closing_soon": "Schließt bald!", - "open_until": "Geöffnet bis", - "opening_soon": "Öffnet" + "closing": "Schließt {{relativeDateTime}}", + "closing_soon_warning": "Schließt bald! Um {{time}} Uhr", + "closing_today": "Schließt um {{time}} Uhr", + "state_closed": "Geschlossen", + "state_maybe": "Vielleicht Geöffnet", + "state_open": "Geöffnet", + "opening": "Öffnet {{relativeDateTime}}", + "opening_today": "Öffnet um {{time}} Uhr", + "opening_soon_warning": "Öffnet bald! Um {{time}} Uhr" } }, "dashboard": { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 5df64a73..78a45e46 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -54,10 +54,15 @@ }, "common": { "openingHours": { - "closed_until": "Closed until", - "closing_soon": "Closing soon!", - "open_until": "Open until", - "opening_soon": "Opens" + "closing": "Closing {{relativeDateTime}}", + "closing_soon_warning": "Closing soon! At {{time}}", + "closing_today": "Closing at {{time}}", + "state_closed": "Closed", + "state_maybe": "Maybe open", + "state_open": "Open", + "opening": "Opens {{relativeDateTime}}", + "opening_today": "Opens at {{time}}", + "opening_soon_warning": "Opens soon! At {{time}}" } }, "dashboard": { diff --git a/src/theme/common/_typo.scss b/src/theme/common/_typo.scss index b2709bb7..50d3119c 100644 --- a/src/theme/common/_typo.scss +++ b/src/theme/common/_typo.scss @@ -1,14 +1,18 @@ body app-root { .title, - .title-sub, - .title[class*='sc-ion-label'], - .title-sub[class*='sc-ion-label'] { + .title[class*='sc-ion-label'] { font-size: var(--font-size-md); font-weight: var(--font-weight-semi-bold); // TODO Condensed Font } + .title-sub, + .title-sub[class*='sc-ion-label'] { + font-size: var(--font-size-md); + font-weight: var(--font-weight-regular); + // TODO Condensed Font + } .title-sub { - color: var(--ion-color-primary); + color: var(--ion-color-text); } }