{# The chat's papers, where a chat starts and inside it: one row of tick boxes, papers in the chat ticked, papers found by a search added unticked. Every control belongs to the Ask form. #} {% macro field(ask, picked, page, stacked=False) %} {% set in_chat = ask.papers | map(attribute="stem") | list %} {% set found = [] %}{% for paper in picked.matches %}{% if paper.stem not in in_chat %}{% set _ = found.append(paper) %}{% endif %}{% endfor %}
Papers in the chat
{% if ask.lists %} {% endif %}
{% for paper in ask.pickable %} {% if picked.text and picked.matches %}

{{ picked.matches | length + picked.more }} paper{% if picked.matches | length + picked.more != 1 %}s have{% else %} has{% endif %} "{{ picked.text }}" in their name{% if found | length < picked.matches | length %}; the ticked ones are in the chat already{% endif %}. Tick the ones to add{% if picked.more %}, or type more of the name to see the other {{ picked.more }}{% endif %}.

{% elif picked.text and not picked.stems %}

No prepared paper has "{{ picked.text }}" in its name.

{% endif %} {% if ask.papers or found %}
{% for paper in ask.papers %} {% if stacked %} {% else %} {% endif %} {% endfor %} {% for paper in found %} {% if stacked %} {% else %} {% endif %} {% endfor %}
Ticked papers are read in full, every one of them. Untick a paper to leave it out. {% else %} Find a paper above, or press Ask on any row of the Library. {% endif %}
{% endmacro %}