{% extends 'base/layout.html' %} {% load buttons %} {% load helpers %} {% load render_table from django_tables2 %} {% load static %} {% block title %}{{ content_type.model_class|meta:"verbose_name_plural"|bettertitle }}{% endblock %} {% block controls %}
{% block extra_controls %}{% endblock %} {% if permissions.add and 'add' in action_buttons %} {% add_button content_type.model_class|validated_viewname:"add" %} {% endif %} {% if permissions.add and 'import' in action_buttons %} {% import_button content_type.model_class|validated_viewname:"import" %} {% endif %} {% if 'export' in action_buttons %} {% export_button content_type %} {% endif %}
{% endblock controls %} {% block content %} {% if table.paginator.num_pages > 1 %} {% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %}
{% csrf_token %}
{% if bulk_edit_url and permissions.change %} {% endif %} {% if bulk_delete_url and permissions.delete %} {% endif %}
{% endwith %} {% endif %} {# Object table #}
{# Object list filter, table config #} {% include 'inc/table_controls.html' with table_modal="ObjectTable_config" %} {% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %} {% if permissions.change or permissions.delete %}
{% csrf_token %}
{% render_table table 'inc/table.html' %}
{% block bulk_buttons %}{% endblock %} {% if bulk_edit_url and permissions.change %} {% endif %} {% if bulk_delete_url and permissions.delete %} {% endif %}
{% else %}
{% render_table table 'inc/table.html' %}
{% endif %} {% endwith %} {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
{% if filter_form %} {% include 'inc/filter_list.html' %} {% endif %}
{% table_config_form table table_name="ObjectTable" %} {% endblock content %}