Skip to content

Commit

Permalink
Merge pull request #1599 from emfcamp/lukegb/map-link-in-ics
Browse files Browse the repository at this point in the history
Add a map link to the event description in the ICS view
  • Loading branch information
lukegb authored May 24, 2024
2 parents 0aa4b61 + 10fc95d commit 563ae85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion apps/schedule/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,18 @@ def _format_event_description(event):
description += "\n\nAttending this workshop will cost: " + event["cost"]
description += "\nSuitable age range: " + event["age_range"]
description += "\nAttendees should bring: " + event["equipment"]

footer_block = []
if event["link"]:
description += "\n\nLink: " + event["link"]
footer_block.append(f'Link: {event["link"]}')
if event["venue"]:
venue_str = event["venue"]
if event["map_link"]:
venue_str = f'{venue_str} ({event["map_link"]})'
footer_block.append(f'Venue: {venue_str}')
if footer_block:
description += '\n\n' + '\n'.join(footer_block)

return description


Expand Down
2 changes: 1 addition & 1 deletion models/cfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def latlon(self):
def map_link(self) -> Optional[str]:
latlon = self.latlon
if latlon:
return "https://map.emfcamp.org/#18.5/%s/%s" % (latlon[0], latlon[1])
return "https://map.emfcamp.org/#18.5/%s/%s/m=%s,%s" % (latlon[0], latlon[1], latlon[0], latlon[1])
return None

@property
Expand Down

0 comments on commit 563ae85

Please sign in to comment.