{%- if not modal -%} {% extends 'admin/master.html' %} {%- endif -%} {% import 'admin/lib.html' as lib with context %} {% macro check_error(error) %} {% if error %} {{ _gettext('This file cannot be edited for now.') }} {% else %} {{ caller() }} {% endif %} {% endmacro %} {% block body %} {%- if modal -%} {# content added to modal-content #} {%- else -%} {{ self.header_text() }} {% call check_error(error) %} {{ lib.render_form(form, dir_url) }} {% endcall %} {%- endif -%} {% endblock %} {% block tail %} {%- if modal -%} {%- endif -%} {% endblock %}