diff --git a/otterdog/webapp/filters.py b/otterdog/webapp/filters.py index d94852da..b7fce6a3 100644 --- a/otterdog/webapp/filters.py +++ b/otterdog/webapp/filters.py @@ -5,6 +5,7 @@ # which is available at http://www.eclipse.org/legal/epl-v20.html # SPDX-License-Identifier: EPL-2.0 # ******************************************************************************* +import json def register_filters(app): @@ -22,6 +23,17 @@ def status_color(status): case _: return "info" + @app.template_filter("int_status") + def int_status_color(value): + if value == 0: + return "success" + else: + return "warning" + + @app.template_filter("from_json") + def from_json(value): + return json.loads(value) + @app.template_filter("is_dict") def is_dict(value): return isinstance(value, dict) diff --git a/otterdog/webapp/templates/home/organization.html b/otterdog/webapp/templates/home/organization.html index a82bc9c6..abaa018d 100644 --- a/otterdog/webapp/templates/home/organization.html +++ b/otterdog/webapp/templates/home/organization.html @@ -138,7 +138,7 @@