{%- if not request.args.get('modal') -%} {% extends 'admin/master.html' %} {%- endif -%} {% import 'admin/lib.html' as lib with context %} {% macro extra() %} {% endmacro %} {% block head %} {%- if not request.args.get('modal') -%} {{ super() }} {{ lib.form_css() }} {%- endif -%} {% endblock %} {% block body %} {%- if request.args.get('modal') -%} {{ lib.render_form(form, return_url, extra=None, form_opts=form_opts, action=url_for('.create_view', url=return_url), is_modal=request.args.get('modal')) }} {%- else -%} {% block navlinks %} {% endblock %} {{ lib.render_form(form, return_url, extra(), form_opts=form_opts, action=url_for('.create_view', url=return_url), is_modal=request.args.get('modal')) }} {%- endif -%} {% endblock %} {% block tail %} {%- if request.args.get('modal') -%} {%- else -%} {{ super() }} {{ lib.form_js() }} {%- endif -%} {% endblock %}