#]
% if field.name in ['video', 'audio', 'image', 'picture', 'photo']
% else
% set _dummy = kwargs.setdefault('class', 'input')
% endif
% if is_required
[[ field(required='', **kwargs)|safe ]]
% else
[[ field(**kwargs)|safe ]]
% endif
[# [[ field_extra(field) ]] #]
% if field.name in ['video', 'audio', 'image', 'photo', 'picture']
% endif
% for f in fields
[% if f in ['start', 'end'] and field.name in ['video', 'audio', 'youtube_id', 'spotify_id', 'archive_id', 'soundcloud_id', 'bandcamp_id'] %]
[[ media_option_field(form[f], False) ]]
% elif f in ['anchor'] and field.name in ['image', 'photo', 'picture']
[[ media_option_field(form[f], False) ]]
[# % elif field.name in ['image', 'photo', 'picture']
#]
% endif
% endfor
% endmacro
% macro media_option_field(field, is_required)
% if field.name in ['start', 'anchor']
% endif
% if field.type == 'Select2Field'
% set _dummy = kwargs.setdefault('class', 'input select')
% else
% endmacro
% macro render_form_fields(form, form_opts=None, model_name=None)
% if form.hidden_tag is defined
[[ form.hidden_tag() ]]
% else
% if csrf_token
% endif
% for f in form if f.widget.input_type == 'hidden'
[[ f ]]
% endfor
% endif
% if form_opts and form_opts.form_rules
% for r in form_opts.form_rules
[[ r(form, form_opts=form_opts) ]]
% endfor
% else
% for f in form if f.widget.input_type != 'hidden'
[# % if f.name in ['anchor', 'start', 'end']
% continue #]
% if f.name.endswith('_id') and f.name not in ['youtube_id', 'spotify_id', 'archive_id', 'soundcloud_id', 'bandcamp_id']
% continue
% endif
% if form_opts
% set kwargs = form_opts.widget_args.get(f.short_name, {})
% else
% set kwargs = {}
% endif
[[ render_field(form, f, kwargs, model_name=model_name) ]]
% endfor
% endif
% endmacro
% macro form_tag(form=None, action=None)
% endmacro
% macro render_form_buttons(cancel_url, extra=None, is_modal=False)