diff --git a/Models/Denomination.ts b/Models/Denomination.ts index f3722b661..45b17f2a7 100644 --- a/Models/Denomination.ts +++ b/Models/Denomination.ts @@ -73,12 +73,25 @@ export class Denomination { * en: "meter" * } * }, "test") - * unit.canonicalValue("42m") // =>"42 m" + * unit.canonicalValue("42m") // =>"42 m" * unit.canonicalValue("42") // =>"42 m" * unit.canonicalValue("42 m") // =>"42 m" * unit.canonicalValue("42 meter") // =>"42 m" * * + * // Should be trimmed if canonical is empty + * const unit = new Denomination({ + * canonicalDenomination: "", + * alternativeDenomination: ["meter","m], + * 'default': true, + * human: { + * en: "meter" + * } + * }, "test") + * unit.canonicalValue("42m") // =>"42" + * unit.canonicalValue("42") // =>"42" + * unit.canonicalValue("42 m") // =>"42" + * unit.canonicalValue("42 meter") // =>"42" */ public canonicalValue(value: string, actAsDefault?: boolean) : string { if (value === undefined) { @@ -89,9 +102,9 @@ export class Denomination { return null; } if (stripped === "1" && this._canonicalSingular !== undefined) { - return "1 " + this._canonicalSingular + return ("1 " + this._canonicalSingular).trim() } - return stripped + " " + this.canonical; + return (stripped + " " + this.canonical).trim(); } /** diff --git a/UI/Popup/FeatureInfoBox.ts b/UI/Popup/FeatureInfoBox.ts index 55f1a0b67..43c56778a 100644 --- a/UI/Popup/FeatureInfoBox.ts +++ b/UI/Popup/FeatureInfoBox.ts @@ -64,8 +64,10 @@ export default class FeatureInfoBox extends ScrollableFullScreen { const title = new TagRenderingAnswer(tags, layerConfig.title ?? new TagRenderingConfig("POI"), state) .SetClass("break-words font-bold sm:p-0.5 md:p-1 sm:p-1.5 md:p-2 text-2xl"); const titleIcons = new Combine( - layerConfig.titleIcons.map(icon => new TagRenderingAnswer(tags, icon, state, - "block w-8 h-8 max-h-8 align-baseline box-content sm:p-0.5 w-10",) + layerConfig.titleIcons.map(icon => { + return new TagRenderingAnswer(tags, icon, state, + "block h-8 max-h-8 align-baseline box-content sm:p-0.5").SetClass("flex"); + } )) .SetClass("flex flex-row flex-wrap pt-0.5 sm:pt-1 items-center mr-2") diff --git a/UI/SubstitutedTranslation.ts b/UI/SubstitutedTranslation.ts index bccb6e4e2..856ff2482 100644 --- a/UI/SubstitutedTranslation.ts +++ b/UI/SubstitutedTranslation.ts @@ -35,7 +35,7 @@ export class SubstitutedTranslation extends VariableUiElement { ) }) - const linkToWeblate = new LinkToWeblate(translation.context, translation.translations) + const linkToWeblate = translation !== undefined ? new LinkToWeblate(translation.context, translation.translations) : undefined; super( Locale.language.map(language => { diff --git a/UI/i18n/Translation.ts b/UI/i18n/Translation.ts index f0504ada6..e9c815708 100644 --- a/UI/i18n/Translation.ts +++ b/UI/i18n/Translation.ts @@ -131,7 +131,6 @@ export class Translation extends BaseUIElement { const wrapper = document.createElement("span") wrapper.appendChild(el) - wrapper.classList.add("flex") Locale.showLinkToWeblate.addCallbackAndRun(doShow => { if (!doShow) { diff --git a/assets/themes/climbing/climbing.json b/assets/themes/climbing/climbing.json index f48ce9bfa..cc5af9e78 100644 --- a/assets/themes/climbing/climbing.json +++ b/assets/themes/climbing/climbing.json @@ -143,10 +143,6 @@ }, "id": "climbing_club-name" }, - { - "id": "minimap", - "render": "{minimap(18): height: 5rem; overflow: hidden; border-radius:3rem; }" - }, "website", "email", "phone", @@ -287,11 +283,6 @@ }, "tagRenderings": [ "images", - "questions", - { - "id": "minimap", - "render": "{minimap(18): height: 5rem; overflow: hidden; border-radius:3rem; }" - }, { "render": { "en": "{name}", @@ -320,8 +311,7 @@ "website", "phone", "email", - "opening_hours", - "reviews" + "opening_hours" ], "mapRendering": [ { @@ -397,11 +387,6 @@ }, "tagRenderings": [ "images", - "questions", - { - "id": "minimap", - "render": "{minimap(18): height: 5rem; overflow: hidden; border-radius:3rem; }" - }, { "render": { "en": "{name}", @@ -555,8 +540,7 @@ "key": "_embedding_features_with_rock:rock" }, "id": "Rock type" - }, - "reviews" + } ], "presets": [ { @@ -704,7 +688,6 @@ }, "tagRenderings": [ "images", - "questions", { "id": "minimap", "render": "{minimap(18, id, _contained_climbing_route_ids): height: 9rem; overflow: hidden; border-radius:3rem; }" @@ -846,8 +829,7 @@ ] }, "id": "Rock type (crag/rock/cliff only)" - }, - "reviews" + } ], "presets": [ { @@ -955,10 +937,6 @@ "it": "Un’opportunità di arrampicata?" }, "tagRenderings": [ - { - "id": "minimap", - "render": "{minimap(18): height: 5rem; overflow: hidden; border-radius:3rem; }" - }, { "id": "climbing-opportunity-name", "render": { @@ -1053,26 +1031,50 @@ } ], "overrideAll": { - "titleIcons": [ + "+titleIcons": [ { - "render": "