Skip to content

Conversation

@sea-kelp
Copy link
Collaborator

Description of Changes

Split map SVG into a separate route that can be reused

Notes for Deployment

None!

Screenshots (if appropriate)

N/A (Same as before)

Testing instructions

Checks

  • I have rebased my changes on main

  • just lint passes

  • just test passes

Comment on lines +26 to +27
<img alt="Map of states with departments in OpenOversight"
src="{{ url_for('main.render_map') }}" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using <img> here which renders it non-interactively on the front page

{% endif %}
{% endfor %}
</svg>
<object type="image/svg+xml" data="{{ url_for('main.render_map') }}"></object>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using <object> here to embed the SVG interactively on the browse page

</defs>
{% for state, path in map_paths.items() %}
{% if state in departments_by_state.keys() %}
<a href="{{ url_for('main.browse') }}#state-{{ state }}" target="_top">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Setting target="_top" here to open the link in the top-level browser rather than only in the <object> frame

Copy link
Collaborator

@AetherUnbound AetherUnbound left a comment

Choose a reason for hiding this comment

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

Sweet, looks great!

@sea-kelp sea-kelp merged commit d064d92 into main Apr 19, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Orca Collective Task Tracker Apr 19, 2025
@sea-kelp sea-kelp deleted the map-svg-route branch April 19, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants