{% extends 'base.html' %} {% autoescape None %} {% block content %} {% module Template( 'modules/header.html', admin=admin, heading='%s / %s' % (admin.name, 'Edit' if obj else 'Add new'), back_button=True, add_button=True, absolute_url=obj.get_absolute_url() if hasattr(obj, 'get_absolute_url') else None ) %}
{% for field in form %}
{% if field.type in ['BooleanField', 'RadioField'] %}
{{ field(class_='form-check-input') }} {{ field.label(class_='form-check-label') }}
{% else %} {{ field.label }} {{ field(class_='form-control') }} {% end %} {% if field.errors %}
{{ field.errors[0] }}
{% end %}
{% end %}
{% end %}