{%- if not request.args.get('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 %} {% call check_error(error) %} {%- if request.args.get('modal') -%} {# content added to modal-content #} {{ lib.render_form(form, dir_url, action=request.url, is_modal=True) }} {%- else -%} {% block header_text -%}