{% if status == "ok" %}
  <a role="button" class="btn btn-success btn-sm ara-result-status-badge" title="Task completed successfully" {% if search_url %}href="{{ search_url | add:'?status=ok#results' }}"{% endif %}>{{ status | upper }}</a>
{% elif status == "failed" or status == "unreachable" %}
  <a role="button" class="btn btn-danger btn-sm ara-result-status-badge" title="Task failed" {% if search_url %}href="{{ search_url | add:'?status=failed#results' }}"{% endif %}>{{ status | upper }}</a>
{% elif status == "ignored" %}
  <a role="button" class="btn btn-info btn-sm ara-result-status-badge" title="Task failed but was ignored" {% if search_url %}href="{{ search_url | add:'?status=failed#results' }}"{% endif %}>{{ status | upper }}</a>
{% elif status == "skipped" %}
  <a role="button" class="btn btn-info btn-sm ara-result-status-badge" title="Task was skipped" {% if search_url %}href="{{ search_url | add:'?status=skipped#results' }}"{% endif %}>{{ status | upper }}</a>
{% elif status == "changed" %}
  <a role="button" class="btn btn-warning btn-sm ara-result-status-badge" title="Task resulted in a change" {% if search_url %}href="{{ search_url | add:'?changed=true#results' }}"{% endif %}>{{ status | upper }}</a>
{% else %}
  <a role="button" class="btn btn-warning btn-sm ara-result-status-badge" title="Task result is unknown" {% if search_url %}href="{{ search_url | add:'?status=unknown#results' }}"{% endif %}>{{ status | upper }}</a>
{% endif %}