Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(infobox): show the stay22 accommodation button on events with multiple venues in same city #5159

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions components/infobox/commons/infobox_league.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))

Expand Down
Loading