From 381c85b5ef410ccae46d09ce4b2a45ca54fceb21 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Thu, 2 Aug 2018 16:14:40 -0400 Subject: [PATCH] jinja filter for getting an icon's SVG file contents --- atst/app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/atst/app.py b/atst/app.py index 46b017bb..1553679f 100644 --- a/atst/app.py +++ b/atst/app.py @@ -57,6 +57,11 @@ def make_flask_callbacks(app): "atat_permissions": [], } + @app.template_filter('iconSvg') + def iconSvg(name): + with open('static/icons/'+name+'.svg') as contents: + return contents.read() + def map_config(config): return {