{% load i18n %}
{% load permissions %}
{% load translations %}

{% perm 'unit.check' object as user_can_ignore_check %}
{% perm 'source.edit' object as user_can_edit_source %}

{% for check in checks %}
<div class="list-group-item list-group-item-{{ check.get_severity }} check">
    <span class="check-number pull-right flip"></span>
    <h4 class="list-group-item-heading">{{ check.get_name }} {% documentation_icon 'user/checks' check.check_obj.doc_id %}</h4>
    <p class="list-group-item-text">{{ check.get_description }}</p>
    <p class="list-group-item-text list-buttons">
        {% with fixup=check.get_fixup_json %}
        {% if fixup %}
        <a data-check-fixup="{{ fixup }}" class="btn btn-primary btn-sm">{% trans "Fix string" %}</a>
        {% endif %}
        {% endwith %}
        {% if user_can_ignore_check %}
        <a href="{% url 'js-ignore-check' check_id=check.id %}" class="btn btn-primary btn-sm dismiss-single">{% trans "Dismiss" %}</a>
        {% if source and user_can_edit_source and check.language %}
        <a href="{% url 'js-ignore-check-source' check_id=check.id pk=source.pk %}" class="btn btn-primary btn-sm dismiss-all">{% trans "Dismiss for all languages" %}</a>
        {% endif %}
        {% endif %}
    </p>
</div>

{% endfor %}
