{# Shared MARKS panel — included by booth.html (auto-gallery view) and by marks.html (the standalone page a VERBATIM index.html booth links to, since a verbatim page is served as-is and can never render this inline). One primitive, three shapes, one slot: pick — a session declared N options; the operator chooses. Renders as a radio form; answering POSTs to /answer and rewrites .marks.json. note — free text the operator volunteered, in either direction. flag — the operator pointing at one item. Rendered on the item's tile rather than here, so the judgment sits beside the artifact; the count below is the way back to them. Works with JS off — plain form POST, every shape. An answered pick shows the recorded judgment and a collapsed "change" form, because the mark is the CURRENT judgment and not a log. #} {% set picks = marks | selectattr('shape', 'equalto', 'pick') | list %} {% set notes = marks | selectattr('shape', 'equalto', 'note') | list %} {% set flags = marks | selectattr('shape', 'equalto', 'flag') | list %}
{% for a in picks %}
{% if a.error %}⚠ broken{% elif a.answer and a.answer.complete %}✓ answered{% elif a.answer %}◐ partial{% else %}? open{% endif %} {{ a.id }}{% if a.multi %} · {{ a.questions|length }} questions{% endif %} {% if a.target %}on {{ a.target }}{% endif %} {% if a.answer and not a.answer.complete %}{{ (a.questions|length) - (a.answer.unanswered|length) }}/{{ a.questions|length }}{% endif %} {% if a.answer %}{{ a.answer.answered_at }}{% if a.answer.answered_by %} · {{ a.answer.answered_by }}{% endif %}{% endif %}
{% if a.error %}

This question could not be read: {{ a.error }}

{% else %} {% if a.title and not a.multi %}

{{ a.title }}

{% endif %}

{{ a.prompt }}

{% if a.answer %}
{% if a.multi %} {% for q in a.questions %}{% set qa = a.answer.answers.get(q.key) %}
{{ q.prompt }}
{{ qa.label if (qa and qa.choice is not none) else 'left blank' }}
{% if qa and qa.notes %}
{{ qa.notes }}
{% endif %}
{% endfor %} {% else %}
{{ a.answer.label }}
{% endif %} {% if a.answer.notes %}
{{ a.answer.notes }}
{% endif %}
{% endif %}
{% if a.answer %}change answer{% else %}answer{% endif %}
{# The field is still `ask`: inline fragments in reports the operator has already published POST that name, and breaking every landed verbatim report to tidy a form field is not a trade worth making. #} {# On the standalone page, come back HERE — the booth's own page is a verbatim report that cannot show the recorded judgment. #} {% if marks_page %}{% endif %} {% for q in a.questions %} {% set field = 'choice.' ~ q.key if a.multi else 'choice' %} {% set qa = a.answer.answers.get(q.key) if (a.answer and a.multi) else a.answer %}
{% if a.multi %}{{ loop.index }}. {{ q.prompt }}{% endif %}
{% for o in q.options %} {% endfor %}
{% if q.notes %} {% endif %}
{% endfor %} {% if a.notes_enabled %} {% endif %}
{% endif %}
{% endfor %} {% for a in notes %}
note {% if a.target %}on {{ a.target }} {% else %}on this booth{% endif %} {{ a.created }}{% if a.by %} · {{ a.by }}{% endif %}
{% if marks_page %}{% endif %}
{{ a.text }}
{% endfor %} {% if flags %}
✔ flagged {{ flags|length }} item{{ '' if flags|length == 1 else 's' }}
{% endif %} {# The operator volunteering a remark, which before marks had no mechanism at all — this is the direction that was running through chat. #}
{% if marks_page %}{% endif %}