From 8f6ebf9057c96ecf6ea3ad2d479c33c1bd6b0cfa Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 23 May 2022 14:18:03 +0100 Subject: [PATCH] Show maps on daily events --- webapp_calendar.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webapp_calendar.py b/webapp_calendar.py index 7f70c9c08..2d3dab1d0 100644 --- a/webapp_calendar.py +++ b/webapp_calendar.py @@ -31,6 +31,7 @@ from webapp_utils import html_header_with_external_style from webapp_utils import html_footer from webapp_utils import html_hide_from_screen_reader from webapp_utils import html_keyboard_navigation +from maps import html_open_street_map def html_calendar_delete_confirm(css_cache: {}, translate: {}, base_dir: str, @@ -183,6 +184,14 @@ def _html_calendar_day(person_cache: {}, css_cache: {}, translate: {}, elif evnt['type'] == 'Place': if evnt.get('name'): event_place = evnt['name'] + if '://' in event_place: + bounding_box_degrees = 0.001 + event_map = \ + html_open_street_map(event_place, + bounding_box_degrees, + translate) + if event_map: + event_place = event_map # prepend a link to the sender of the calendar item if sender_name and event_description: