{% load i18n short_name %}

{% translate "Contrôles / Rapports de suivi" %}

{% if 'follow_up_reports' in allowed_update_fields %} {% endif %}
{% if is_user_intern %}
{% translate "Résultat du contrôle" %} : {% if 'follow_up_reports' in allowed_update_fields %}
{% else %} {% if intervention.follow_up_performed == 'ok' %}OK{% elif intervention.follow_up_performed == 'attention' %}{% translate "Points d’attention" %}{% elif intervention.follow_up_performed == 'not_ok' %}Not OK{% else %}–{% endif %} {% endif %}
{% endif %} {% if visible_controls %}
{% translate "Rapports de contrôle" %}
{% for control in visible_controls %} {% endfor %}
{% translate "Date" %} {% translate "Type" %} {% translate "Auteur" %} {% translate "Statut" %}
{{ control.updated_at|date:"d-m-Y H:i" }} {{ control.get_control_type_display }} {{ control.control_author }} {{ control.get_status_display }}
{% elif not visible_inspections %}

{% translate "Aucun contrôle ou rapport pour le moment." %}

{% endif %} {% if visible_inspections %}
{% translate "Inspections de terrain / conformité" %} {{ visible_inspections|length }}
{% for insp in visible_inspections %} {% endfor %}
{% translate "Inspection" %} {% translate "Date / Échéance" %} {% translate "Nature" %} {% translate "Cible" %} {% translate "Inspecteur" %} {% translate "Statut / Résultat" %} {% translate "Action" %}
#{{ insp.id }} {{ insp.inspection_date|date:"d/m/Y H:i"|default:"-" }} {% if insp.is_scheduled and insp.scheduled_start_date %}
{% translate "Prévue du" %} {{ insp.scheduled_start_date|date:"d/m/Y" }} {% translate "au" %} {{ insp.scheduled_due_date|date:"d/m/Y" }}
{% endif %}
{{ insp.get_nature_display }} {% if insp.asset and insp.asset.get_absolute_url %} {{ insp.target_display }} {% else %} {{ insp.target_display }} {% endif %} {{ insp.inspector|short_name|default:"-" }} {{ insp.get_result_status_display }} {% if insp.is_scheduled %} {% translate "Planifiée" %} {% endif %}
{% endif %}
{% for insp in visible_inspections %} {% endfor %}