Better OH viz

This commit is contained in:
pietervdvn 2021-01-05 03:33:41 +01:00
parent 7e5e84b2f1
commit 6557c51493
4 changed files with 14 additions and 15 deletions

View file

@ -116,6 +116,7 @@ export default class AllTranslationAssets {
not_all_rules_parsed: new Translation( {"en":"The opening hours of this shop are complicated. The following rules are ignored in the input element:","fr":"Les heures d'ouvertures de ce magasin sont trop compliquées. Les heures suivantes ont été ignorées:","ca":"L'horari d'aquesta botiga és complicat. Les normes següents seran ignorades en l'entrada:","es":"El horario de esta tienda es complejo. Las normas siguientes serán ignoradas en la entrada:"} ),
closed_until: new Translation( {"en":"Closed until {date}","ca":"Tancat fins {date}","es":"Cerrado hasta {date}","nl":"Gesloten - open op {date}","fr":"Fermé jusqu'à"} ),
closed_permanently: new Translation( {"en":"Closed for an unkown duration","ca":"Tancat - sense dia d'obertura conegut","es":"Cerrado - sin día de apertura conocido","nl":"Gesloten voor onbepaalde tijd","fr":"Fermé"} ),
open_24_7: new Translation( {"en":"Opened around the clock","nl":"Dag en nacht open"} ),
ph_not_known: new Translation( {"en":" ","ca":" ","es":" ","nl":" "} ),
ph_closed: new Translation( {"en":"closed","ca":"tancat","es":"cerrado","nl":"gesloten","fr":"fermé"} ),
ph_open: new Translation( {"en":"opened","ca":"tancat","es":"abierto","nl":"open","fr":"ouvert"} ),

View file

@ -196,6 +196,14 @@ export default class OpeningHoursVisualization extends UIElement {
// Closed!
const opensAtDate = oh.getNextChange();
if(opensAtDate === undefined){
const comm = oh.getComment();
if(comm !== undefined){
return new FixedUiElement(comm).SetClass("ohviz-closed").Render();
}
if(oh.getState()){
return Translations.t.general.opening_hours.open_24_7.SetClass("ohviz-closed").Render()
}
return Translations.t.general.opening_hours.closed_permanently.SetClass("ohviz-closed").Render()
}
const moment = `${opensAtDate.getDay()}/${opensAtDate.getMonth() + 1} ${OH.hhmm(opensAtDate.getHours(), opensAtDate.getMinutes())}`

View file

@ -71,20 +71,6 @@
"freeform": {
"key": "opening_hours",
"type": "opening_hours"
},
"mappings": [
{
"if": {
"or": ["opening_hours=by appointment",
"opening_hours=by_appointment",
"opening_hours=\"by appointment\""]
},
"then": {
"en": "Only by appointment",
"nl": "Enkel op afspraak"
},
"hideInAnswer": true
}
]
}
}

View file

@ -900,6 +900,10 @@
"nl": "Gesloten voor onbepaalde tijd",
"fr": "Fermé"
},
"open_24_7": {
"en": "Opened around the clock",
"nl": "Dag en nacht open"
},
"ph_not_known": {
"en": " ",
"ca": " ",