{#- 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)) }}

{#- counted from the markers file as the box is drawn (#474, D-728 ruling 3) #} {% if removal.markers is none %}

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

{% elif removal.markers %}

{{ t('remove.markers', n=removal.markers) }}

{% 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 %}