Skip to content

Activity page map#298

Merged
paigewilliams merged 6 commits into
developfrom
activity-page-map
Jun 16, 2026
Merged

Activity page map#298
paigewilliams merged 6 commits into
developfrom
activity-page-map

Conversation

@paigewilliams

Copy link
Copy Markdown
Collaborator

asana task

Description

Displays a map on Activity and Place-Resource Event pages in the related materials section. It does not display a map for a related activity or place resource on a Place page, as there is already a map on that page.

I also simplified the logic in the record.html template since there are now more conditions to show the related map.

Screenshots

Activity Page

Screenshot 2026-06-15 at 5 05 54 PM

Place-Resource Page

Screenshot 2026-06-15 at 5 06 11 PM

Place page (no related map)

Screenshot 2026-06-15 at 5 06 26 PM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for rendering a related-record map on Activity and Place‑Resource Event record pages (while intentionally avoiding related maps on Place pages) by including map geometry in related objects’ get_query_json() output and updating the record view/template to conditionally render the map block.

Changes:

  • Add Places.get_query_json() override to include map geometry when available.
  • Update get_by_model_id to detect related geo records and control map rendering via a show_map flag on relationships.
  • Simplify record.html map condition to rely on relationship.show_map, and add model tests for new get_query_json() behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
TEKDB/TEKDB/models.py Adds Places.get_query_json() map data so related places can drive map rendering.
TEKDB/explore/views.py Computes whether to load map context and whether a relationship should render a map.
TEKDB/explore/templates/record.html Switches map rendering condition to use the new relationship.show_map flag.
TEKDB/TEKDB/tests/test_models.py Adds tests asserting Places.get_query_json() includes/omits map appropriately.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TEKDB/explore/views.py Outdated
Comment on lines +213 to +217
if "map" in value.keys() and value["map"] is not None:
hasPlaceResourceRelationships = True
break
if hasPlaceResourceRelationships:
break
found_related_geo_record = True
relationship["show_map"] = True
else:
relationship["show_map"] = False
Comment on lines +516 to +518
"""
Test that the response from get_query_json includes no map data when map is False
"""
@paigewilliams paigewilliams merged commit 64ad114 into develop Jun 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants