2020-04-10 10:21:02 -04:00
{% extends 'base.html' %}
2020-02-13 13:13:27 -05:00
{% load buttons %}
{% load helpers %}
2020-10-21 14:52:50 -04:00
{% load static %}
2020-02-13 13:13:27 -05:00
{% block content %}
< div class = "pull-right noprint" >
2020-02-13 17:22:17 -05:00
{% block buttons %}{% endblock %}
2020-05-06 23:44:06 -04:00
{% if request.user.is_authenticated and table_config_form %}
2020-11-06 14:33:20 -05:00
< button type = "button" class = "btn btn-default" data-toggle = "modal" data-target = "#ObjectTable_config" title = "Configure table" > < i class = "mdi mdi-cog" > < / i > Configure< / button >
2020-04-28 14:27:27 -04:00
{% endif %}
2020-02-13 14:07:15 -05:00
{% if permissions.add and 'add' in action_buttons %}
2020-06-25 16:50:35 -04:00
{% add_button content_type.model_class|validated_viewname:"add" %}
2020-02-13 14:07:15 -05:00
{% endif %}
{% if permissions.add and 'import' in action_buttons %}
2020-06-25 16:50:35 -04:00
{% import_button content_type.model_class|validated_viewname:"import" %}
2020-02-13 13:13:27 -05:00
{% endif %}
2020-02-13 14:07:15 -05:00
{% if 'export' in action_buttons %}
{% export_button content_type %}
{% endif %}
2020-02-13 13:13:27 -05:00
< / div >
2020-03-09 10:50:46 -04:00
< h1 > {% block title %}{{ content_type.model_class|meta:"verbose_name_plural"|bettertitle }}{% endblock %}< / h1 >
2020-02-13 13:13:27 -05:00
< div class = "row" >
2020-11-10 16:00:21 -05:00
< div class = "col-md-12" >
{% if filter_form %}
< div class = "col-md-3 pull-right right-side-panel noprint" >
{% include 'inc/search_panel.html' %}
{% block sidebar %}{% endblock %}
< / div >
{% endif %}
2020-06-25 16:50:35 -04:00
{% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %}
2020-02-14 13:21:32 -05:00
{% if permissions.change or permissions.delete %}
< form method = "post" class = "form form-horizontal" >
{% csrf_token %}
< input type = "hidden" name = "return_url" value = "{% if return_url %}{{ return_url }}{% else %}{{ request.path }}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}{% endif %}" / >
{% if table.paginator.num_pages > 1 %}
< div id = "select_all_box" class = "hidden panel panel-default noprint" >
< div class = "panel-body" >
< div class = "checkbox-inline" >
< label for = "select_all" >
< input type = "checkbox" id = "select_all" name = "_all" / >
Select < strong > all {{ table.rows|length }} {{ table.data.verbose_name_plural }}< / strong > matching query
< / label >
< / div >
< div class = "pull-right" >
{% if bulk_edit_url and permissions.change %}
2020-02-21 20:44:53 -05:00
< button type = "submit" name = "_edit" formaction = "{% url bulk_edit_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class = "btn btn-warning btn-sm" disabled = "disabled" >
2020-11-06 14:49:14 -05:00
< span class = "mdi mdi-pencil" aria-hidden = "true" > < / span > Edit All
2020-02-14 13:21:32 -05:00
< / button >
{% endif %}
{% if bulk_delete_url and permissions.delete %}
2020-02-21 20:44:53 -05:00
< button type = "submit" name = "_delete" formaction = "{% url bulk_delete_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class = "btn btn-danger btn-sm" disabled = "disabled" >
2020-11-06 14:49:14 -05:00
< span class = "mdi mdi-trash-can-outline" aria-hidden = "true" > < / span > Delete All
2020-02-14 13:21:32 -05:00
< / button >
{% endif %}
< / div >
< / div >
< / div >
{% endif %}
{% include table_template|default:'responsive_table.html' %}
< div class = "pull-left noprint" >
{% block bulk_buttons %}{% endblock %}
{% if bulk_edit_url and permissions.change %}
2020-02-21 20:44:53 -05:00
< button type = "submit" name = "_edit" formaction = "{% url bulk_edit_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class = "btn btn-warning btn-sm" >
2020-11-06 14:49:14 -05:00
< span class = "mdi mdi-pencil" aria-hidden = "true" > < / span > Edit Selected
2020-02-14 13:21:32 -05:00
< / button >
{% endif %}
{% if bulk_delete_url and permissions.delete %}
2020-02-21 20:44:53 -05:00
< button type = "submit" name = "_delete" formaction = "{% url bulk_delete_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class = "btn btn-danger btn-sm" >
2020-11-06 14:49:14 -05:00
< span class = "mdi mdi-trash-can-outline" aria-hidden = "true" > < / span > Delete Selected
2020-02-14 13:21:32 -05:00
< / button >
{% endif %}
< / div >
< / form >
{% else %}
{% include table_template|default:'responsive_table.html' %}
{% endif %}
{% endwith %}
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
< div class = "clearfix" > < / div >
2020-02-13 17:11:39 -05:00
< / div >
2020-02-13 13:13:27 -05:00
< / div >
2020-10-23 16:47:53 -04:00
{% table_config_form table table_name="ObjectTable" %}
2020-02-13 13:13:27 -05:00
{% endblock %}
2020-10-21 14:52:50 -04:00
{% block javascript %}
< script src = "{% static 'js/tableconfig.js' %}" > < / script >
{% endblock %}