From 322ad1ad4812e627f385004d4449e0aa6c7d7433 Mon Sep 17 00:00:00 2001 From: Rikard Blixt Date: Mon, 2 Dec 2024 10:51:42 +0100 Subject: [PATCH] feat(infobox): show the stay22 accommodation button on events with multiple venues in same city --- components/infobox/commons/infobox_league.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/infobox/commons/infobox_league.lua b/components/infobox/commons/infobox_league.lua index ae28d545f17..320a24d8f9d 100644 --- a/components/infobox/commons/infobox_league.lua +++ b/components/infobox/commons/infobox_league.lua @@ -231,8 +231,8 @@ function League:createInfobox() return end local locations = Locale.formatLocations(args) - -- If more than one venue, don't show the accommodation section, as it is unclear which one the link is for - if locations.venue2 or locations.city2 then + -- If more than one city, don't show the accommodation section, as it is unclear which one the link is for + if locations.city2 then return end -- Must have a venue or a city to show the accommodation section @@ -256,7 +256,8 @@ function League:createInfobox() end local addressParts = {} - table.insert(addressParts, locations.venue1) + -- Only add the venue if there is exactly one venue, otherwise we'll only use the city + country + table.insert(addressParts, not locations.venue2 and locations.venue1 or nil) table.insert(addressParts, locations.city1) table.insert(addressParts, Flags.CountryName(locations.country1 or locations.region1))