{% comment %} One queue row (phase5-importer.md 4.6). Collapsed: name, the decision as a sentence, confidence, flags. Expanded (
, so it works without JS): source and Fincas side by side, the field diff with keep/take, the candidates, the AI suggestion, the raw record, and the actions. Buttons carry data-shortcut for the queue's keyboard handler. {% endcomment %} {% with row=item.row %}
  • {% if can_apply and item.decidable or can_apply and item.skippable %} {% endif %}
    {{ item.name }} — {{ item.sentence }} {% if item.confidence is not None %}{{ item.confidence|floatformat:2 }}{% else %}—{% endif %} {% if row.mapping_state != "proposed" %}{{ row.get_mapping_state_display }}{% if item.error_code %}: {{ item.error_code }}{% endif %}{% endif %} {% for code, text in item.flags %}{{ text }}{% endfor %} {% if item.claim %}{% if item.claim.mine %}Claimed by you{% else %}Claimed by {{ item.claim.by }}{% endif %} until {{ item.claim.until|date:"H:i" }}{% endif %}

    Row {{ row.row_number }} of the export · source id {{ row.raw.source_id|default:"—" }}{% if row.mapping_actor %} · last decided by {{ row.mapping_actor }}{% endif %}

    {% if row.error %}

    Error: {% if can_pii %}{{ row.error }}{% else %}{{ item.error_code }}{% endif %}

    {% endif %} {% if item.comparison %}
    {% for line in item.comparison %} {% endfor %}
    The source record next to {% if item.compared_name %}{{ item.compared_name }}{% else %}nothing in Fincas (a new record){% endif %}
    Field Source record {% if item.compared_name %}Fincas: {{ item.compared_name }}{% else %}Fincas (none: a new record){% endif %}
    {{ line.label }} {{ line.source|default:"—" }} {% if item.compared_name %}{{ line.golden|default:"—" }}{% else %}—{% endif %}
    {% if not can_pii %}

    Addresses and numbers are masked and other values hidden: unmasking needs “Can view unmasked values in CRM import reports”.

    {% endif %} {% endif %} {% if can_apply and item.decidable %}
    {% csrf_token %} {% endif %} {% if item.diff %}
    Fields the source changed
    {% for f in item.diff %} {% endfor %}
    Field Old (Fincas now) New (source) Choice
    {{ f.field }}{% if f.conflict %} staff changed{% endif %} {{ f.golden }} {{ f.source }} {% if f.conflict and can_apply and item.decidable %}
    {% elif f.conflict %}needs a choice{% else %}updated{% endif %}
    {% endif %} {% if item.candidates %}

    Candidates

      {% for cand in item.candidates %}
    • {% if can_apply and item.decidable %} {% else %}{{ cand.key }}.{% endif %} {{ cand.name }} {{ cand.rule }}{% if cand.confidence is not None %} · {{ cand.confidence|floatformat:2 }}{% endif %}{% if cand.chosen %} · proposed{% endif %}{% if ai_on and cand.ai_pick %} · AI's pick{% endif %}
    • {% endfor %}
    {% endif %} {% if ai_on and item.ai %}

    AI suggestion: {{ item.ai.label|default:item.ai.suggested }}{% if item.ai.confidence is not None %} ({{ item.ai.confidence|floatformat:2 }}){% endif %}{% if item.ai.reason %} — {{ item.ai.reason }}{% endif %}{% if item.ai.disagrees %} disagrees with the rule{% endif %} A suggestion, never a decision.

    {% endif %} {% if can_apply and item.decidable %} {% if item.outcome_choice %}
    {% endif %} {% for key in item.closed_stages %}
    {% endfor %}
    {% if item.decision != "none" %} {% endif %} {% if item.can_create and item.decision != "create" %} {% endif %} {% if item.skippable %} {% endif %}
    {% elif can_apply and item.skippable %}
    {% csrf_token %}
    {% endif %} {% if can_pii and item.raw_json %}
    Raw source record
    {{ item.raw_json }}
    {% endif %}
  • {% endwith %}