{%- 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') -%}
{# remove save and continue button for modal (it won't function properly) #}
{{ lib.render_form(form, return_url, extra=None, form_opts=form_opts,
action=url_for('.edit_view', id=request.args.get('id'), url=return_url),
is_modal=request.args.get('modal')) }}
{%- else -%}
{{ lib.render_form(form, return_url, extra(), form_opts,
action=url_for('.edit_view', id=request.args.get('id'), 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 %}