PHACDataHub / django-phac_aspc-helpers

Provides a series of helpers to provide a consistent experience accross PHAC-ASPC's Django based projects.
MIT License
0 stars 0 forks source link

Templatetag for inlining svg content from an svg file #59

Closed Stephen-ONeil closed 1 year ago

Stephen-ONeil commented 1 year ago

Inlines the content of a svg from static files in to a template. There are cases where this is going to be preferred over an <img src="..."> or <object.... E.g. if the svg itself includes a11y markup (img is opaque to that, object is reportedly inconsistent depending on browser and screen reader).

Jinja templates can use this too, via the standard pattern of adding templatetags to the jinja env.globals. I could extract it in to a util that could be used directly in jinja, and just wrap that for a templatetag, but ehh.

github-actions[bot] commented 1 year ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
phac_aspc/django
   excel.py1482881%17–18, 49, 71, 81, 85, 119–121, 125–129, 132–133, 162, 170, 187–188, 214, 217, 219, 221, 224, 230, 236, 255–256, 263–264
   fields.py791680%46, 67–80, 102–105, 120–125, 128–132
phac_aspc/django/admin/decorators
   admin_decorators.py18289%37–38
phac_aspc/django/helpers
   jinja_dtl_interop_utils.py7186%21
phac_aspc/django/helpers/auth
   backend.py28280%2–36
   views.py442739%22, 27–30, 35–43, 48–100
phac_aspc/django/helpers/locale
   code.py8362%10, 13–14
phac_aspc/django/helpers/logging
   configure_logging.py31197%124
   json_post_handlers.py27389%8–9, 61
   utils.py11282%43, 48
phac_aspc/django/helpers/templatetags
   phac_aspc_auth.py7186%14
   phac_aspc_localization.py11464%11, 26–29
phac_aspc/django/helpers/views
   wet.py10640%12–19
phac_aspc/django/localization
   hooks.py660%2–16
phac_aspc/django/localization/decorators
   __init__.py220%4–6
   localization_decorators.py11110%4–46
phac_aspc/django/settings
   logging.py271544%29–37, 47–66
   security.py21957%34–45
phac_aspc/django/settings/utils
   configure_settings_for_tests.py3233%15–19
TOTAL72816777% 

Tests Skipped Failures Errors Time
39 0 :zzz: 0 :x: 0 :fire: 2.388s :stopwatch: