{% load lookup %}
{% for project in user_active_projects %}
{% if sla|lookup:project|lookup:"resolution" == "red" %} {% elif sla|lookup:project|lookup:"resolution" == "green" %} {% endif %} {{ project }}
{% endfor %}
{% for project in user_old_projects %}
{{ project }}
{% endfor %}