{# "Drop information" form, shared by a space's inbox and the drop page reachable from everywhere (`choices`: spaces offered, the space picker is shown). #} {% from "ui.html" import secret_confirm, file_input with context %} {% from "editor.html" import editor with context %} {# `heading`: card title (the drop page already has its h1); `back`: page to return to after the drop. #} {% macro deposit_form(action, form=None, form_error=None, choices=None, chosen='', heading=true, back='') -%}
{% if heading %}

{{ _("Drop information") }}

{% endif %} {% if form_error %}{% endif %} {% if back %}{% endif %} {% if choices is not none %}

{{ _("This space's tidy-up agent will add the information to the wiki on its next run.") }}

{% endif %}
{# The note's preview: in the space of the form, or in the one chosen in it. #} {{ editor(form.body if form else '', 8, "/o/{space}/-/inbox/preview" if choices is not none else action ~ "/preview", id="body", name="body", fields="title", space_field="space" if choices is not none else "", split=false, classes="") }}
{{ file_input("files", "files", multiple=true) }}{% if form %}

{{ _("Attach the files again: the browser does not keep them.") }}

{% endif %}
{{ secret_confirm(form_error) }}
{% if back %}{{ _("Cancel") }}{% endif %}
{%- endmacro %}