Merge pull request #120 from dod-ccpo/fix-icons

Fix icons
This commit is contained in:
andrewdds 2018-08-02 16:21:49 -04:00 committed by GitHub
commit 07d2f3a124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -57,6 +57,11 @@ def make_flask_callbacks(app):
"atat_permissions": [], "atat_permissions": [],
} }
@app.template_filter('iconSvg')
def iconSvg(name):
with open('static/icons/'+name+'.svg') as contents:
return contents.read()
def map_config(config): def map_config(config):
return { return {

View File

@ -1,6 +1,6 @@
{% macro Icon(name, classes="") -%} {% macro Icon(name, classes="") -%}
{% autoescape false %} {% autoescape false %}
<span class="icon icon--{{name}} {{classes}}" aria-hidden="true">{{ svg }}</span> <span class="icon icon--{{name}} {{classes}}" aria-hidden="true">{{ name | iconSvg }}</span>
{% endautoescape %} {% endautoescape %}
{%- endmacro %} {%- endmacro %}