use macro for request review fields

This commit is contained in:
dandds
2018-09-05 15:41:51 -04:00
parent 038cceb34b
commit 50c8766a7a
2 changed files with 55 additions and 195 deletions

View File

@@ -50,6 +50,15 @@ def mixedContentToJson(value):
return app.jinja_env.filters["tojson"](value)
def findFilter(value, filter_name, filter_args=[]):
if not filter_name:
return value
elif filter_name in app.jinja_env.filters:
return app.jinja_env.filters[filter_name](value, *filter_args)
else:
raise ValueError("filter name {} not found".format(filter_name))
def register_filters(app):
app.jinja_env.filters["iconSvg"] = iconSvg
app.jinja_env.filters["dollars"] = dollars
@@ -57,3 +66,4 @@ def register_filters(app):
app.jinja_env.filters["readableInteger"] = readableInteger
app.jinja_env.filters["getOptionLabel"] = getOptionLabel
app.jinja_env.filters["mixedContentToJson"] = mixedContentToJson
app.jinja_env.filters["findFilter"] = findFilter