{#- Removing a document (#120, D-359 to D-362, #470, D-751): a disclosure that says what goes and what stays; the press of its one button is the confirmation, and it is the only button in the box, after everything that stays (D-733). The same markup serves the library's rows and the document page (#390). Import it "with context". -#} {% from "_icons.html" import icon %} {% macro remove_box(document, removal, busy, named) %}
{{ icon('x', 's') }}{% if named %}{{ t('remove.summary_named', name=document.name) }}{% else %}{{ t('remove.summary') }}{% endif %}

{{ t('remove.goes', size=size_text(removal.bytes)) }}

{#- the captures by type, in the dock's order, counted as the box is drawn from captures.json, or from the v1.3 markers.json before the carry-over (D-728 ruling 3, ADR-008 2.1 items 4 and 5) #} {% set captures = removal.captures %} {% if captures.unread == 'captures' %}

{{ t('remove.captures_unread') }}

{% elif captures.unread == 'markers' %}

{{ t('remove.markers_unread') }}

{% elif captures.note or captures.quote or captures.mark %}

{{ [t('remove.notes', n=captures.note) if captures.note else '', t('remove.quotes', n=captures.quote) if captures.quote else '', t('remove.marks', n=captures.mark) if captures.mark else ''] | select | join(' ') }}

{% endif %} {#- the project's own audiobook folders (#470, D-751): what goes unless kept #} {% for audiobook in removal.audiobooks %}

{{ t('remove.audiobook', n=audiobook.files, folder=audiobook.folder, size=size_text(audiobook.bytes)) }}

{% endfor %} {% if removal.audiobooks %}

{% endif %}

{{ t('remove.original') }}

{% if removal.audiobooks %}

{{ t('remove.others_stay') }}

{% endif %} {% if removal.record_unread %}

{{ t('remove.record_unread', path=removal.record_unread) }}

{% elif removal.folder %}

{{ t('remove.stays_earlier', folder=removal.folder) }}

{% elif removal.has_audio and not removal.audiobooks %}

{{ t('remove.stays') }}

{% endif %} {% if busy %}

{{ t('remove.busy') }}

{% else %}

{% endif %}
{% endmacro %}