|
@@ -4,97 +4,132 @@
|
|
|
{% load render_table from django_tables2 %}
|
|
{% load render_table from django_tables2 %}
|
|
|
{% load static %}
|
|
{% load static %}
|
|
|
|
|
|
|
|
-{% block title %}{{ content_type.model_class|meta:"verbose_name_plural"|bettertitle }}{% endblock %}
|
|
|
|
|
-
|
|
|
|
|
{% block controls %}
|
|
{% block controls %}
|
|
|
-<div class="controls">
|
|
|
|
|
- <div class="control-group">
|
|
|
|
|
- {% 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 %}
|
|
|
|
|
|
|
+ <div class="controls">
|
|
|
|
|
+ <div class="control-group">
|
|
|
|
|
+ {% 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 %}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
-</div>
|
|
|
|
|
{% endblock controls %}
|
|
{% 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" %}
|
|
|
|
|
- <div id="select-all-box" class="d-none card noprint">
|
|
|
|
|
- <form method="post" class="form col-md-12">
|
|
|
|
|
- {% csrf_token %}
|
|
|
|
|
- <div class="card-body">
|
|
|
|
|
- <div class="float-end">
|
|
|
|
|
- {% if bulk_edit_url and permissions.change %}
|
|
|
|
|
- <button type="submit" name="_edit" formaction="{% url bulk_edit_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-warning btn-sm" disabled>
|
|
|
|
|
- <span class="mdi mdi-pencil" aria-hidden="true"></span> Edit All
|
|
|
|
|
- </button>
|
|
|
|
|
- {% endif %}
|
|
|
|
|
- {% if bulk_delete_url and permissions.delete %}
|
|
|
|
|
- <button type="submit" name="_delete" formaction="{% url bulk_delete_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-danger btn-sm" disabled>
|
|
|
|
|
- <span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete All
|
|
|
|
|
- </button>
|
|
|
|
|
- {% endif %}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-check">
|
|
|
|
|
- <input type="checkbox" id="select-all" name="_all" class="form-check-input" />
|
|
|
|
|
- <label for="select-all" class="form-check-label">
|
|
|
|
|
- Select <strong>all {{ table.rows|length }} {{ table.data.verbose_name_plural }}</strong> matching query
|
|
|
|
|
- </label>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
- </div>
|
|
|
|
|
-{% endwith %}
|
|
|
|
|
-{% endif %}
|
|
|
|
|
|
|
+{% block tabs %}
|
|
|
|
|
+ <ul class="nav nav-tabs px-3">
|
|
|
|
|
+ {% block tab_items %}
|
|
|
|
|
+ <li class="nav-item" role="presentation">
|
|
|
|
|
+ <button class="nav-link active" id="object-list-tab" data-bs-toggle="tab" data-bs-target="#object-list" type="button" role="tab" aria-controls="edit-form" aria-selected="true">
|
|
|
|
|
+ {% block title %}{{ content_type.model_class|meta:"verbose_name_plural"|bettertitle }}{% endblock %}
|
|
|
|
|
+ {% badge table.page.paginator.count %}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ {% if filter_form %}
|
|
|
|
|
+ <li class="nav-item" role="presentation">
|
|
|
|
|
+ <button class="nav-link" id="filters-form-tab" data-bs-toggle="tab" data-bs-target="#filters-form" type="button" role="tab" aria-controls="object-list" aria-selected="false">
|
|
|
|
|
+ Filters
|
|
|
|
|
+ {% if filter_form %}{% badge filter_form.changed_data|length %}{% endif %}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+ {% endblock tab_items %}
|
|
|
|
|
+ </ul>
|
|
|
|
|
+{% endblock tabs %}
|
|
|
|
|
+
|
|
|
|
|
+{% block content-wrapper %}
|
|
|
|
|
+ <div class="tab-content">
|
|
|
|
|
|
|
|
-{# Object table #}
|
|
|
|
|
-<div class="row">
|
|
|
|
|
- <div class="col {% if filter_form %}col-md-7 col-lg-8 col-xl-9 col-xxl-10{% else %}col-12{% endif %}">
|
|
|
|
|
- {# Object list filter, table config #}
|
|
|
|
|
- {% include 'inc/table_controls.html' with table_modal="ObjectTable_config" %}
|
|
|
|
|
|
|
+ {# Object list #}
|
|
|
|
|
+ <div class="tab-pane show active" id="object-list" role="tabpanel" aria-labelledby="object-list-tab">
|
|
|
|
|
+ {% 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" %}
|
|
|
|
|
- {% 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 %}" />
|
|
|
|
|
- <div class="table-responsive">
|
|
|
|
|
- {% render_table table 'inc/table.html' %}
|
|
|
|
|
|
|
+ {# "Select all" form #}
|
|
|
|
|
+ {% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %}
|
|
|
|
|
+ <div id="select-all-box" class="d-none card noprint">
|
|
|
|
|
+ <form method="post" class="form col-md-12">
|
|
|
|
|
+ {% csrf_token %}
|
|
|
|
|
+ <div class="card-body">
|
|
|
|
|
+ <div class="float-end">
|
|
|
|
|
+ {% if bulk_edit_url and permissions.change %}
|
|
|
|
|
+ <button type="submit" name="_edit" formaction="{% url bulk_edit_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-warning btn-sm" disabled>
|
|
|
|
|
+ <span class="mdi mdi-pencil" aria-hidden="true"></span> Edit All
|
|
|
|
|
+ </button>
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+ {% if bulk_delete_url and permissions.delete %}
|
|
|
|
|
+ <button type="submit" name="_delete" formaction="{% url bulk_delete_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-danger btn-sm" disabled>
|
|
|
|
|
+ <span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete All
|
|
|
|
|
+ </button>
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-check">
|
|
|
|
|
+ <input type="checkbox" id="select-all" name="_all" class="form-check-input" />
|
|
|
|
|
+ <label for="select-all" class="form-check-label">
|
|
|
|
|
+ Select <strong>all {{ table.rows|length }} {{ table.data.verbose_name_plural }}</strong> matching query
|
|
|
|
|
+ </label>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="noprint bulk-buttons">
|
|
|
|
|
- <div class="bulk-button-group">
|
|
|
|
|
- {% block bulk_buttons %}{% endblock %}
|
|
|
|
|
- {% if bulk_edit_url and permissions.change %}
|
|
|
|
|
- <button type="submit" name="_edit" formaction="{% url bulk_edit_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-warning btn-sm">
|
|
|
|
|
- <i class="mdi mdi-pencil" aria-hidden="true"></i> Edit Selected
|
|
|
|
|
- </button>
|
|
|
|
|
- {% endif %}
|
|
|
|
|
- {% if bulk_delete_url and permissions.delete %}
|
|
|
|
|
- <button type="submit" name="_delete" formaction="{% url bulk_delete_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-danger btn-sm">
|
|
|
|
|
- <i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete Selected
|
|
|
|
|
- </button>
|
|
|
|
|
- {% endif %}
|
|
|
|
|
|
|
+ {% endwith %}
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+
|
|
|
|
|
+ {# Object table controls #}
|
|
|
|
|
+ {% include 'inc/table_controls.html' with table_modal="ObjectTable_config" %}
|
|
|
|
|
+
|
|
|
|
|
+ <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 %}" />
|
|
|
|
|
+
|
|
|
|
|
+ {# Object table #}
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="card-body">
|
|
|
|
|
+ <div class="table-responsive">
|
|
|
|
|
+ {% render_table table 'inc/table.html' %}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </form>
|
|
|
|
|
- {% else %}
|
|
|
|
|
- <div class="table-responsive">
|
|
|
|
|
- {% render_table table 'inc/table.html' %}
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- {% endif %}
|
|
|
|
|
- {% endwith %}
|
|
|
|
|
- {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
|
|
|
|
|
|
|
+
|
|
|
|
|
+ {# Form buttons #}
|
|
|
|
|
+ {% if permissions.change or permissions.delete %}
|
|
|
|
|
+ {% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %}
|
|
|
|
|
+ <div class="noprint bulk-buttons">
|
|
|
|
|
+ <div class="bulk-button-group">
|
|
|
|
|
+ {% block bulk_buttons %}{% endblock %}
|
|
|
|
|
+ {% if bulk_edit_url and permissions.change %}
|
|
|
|
|
+ <button type="submit" name="_edit" formaction="{% url bulk_edit_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-warning btn-sm">
|
|
|
|
|
+ <i class="mdi mdi-pencil" aria-hidden="true"></i> Edit Selected
|
|
|
|
|
+ </button>
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+ {% if bulk_delete_url and permissions.delete %}
|
|
|
|
|
+ <button type="submit" name="_delete" formaction="{% url bulk_delete_url %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-danger btn-sm">
|
|
|
|
|
+ <i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete Selected
|
|
|
|
|
+ </button>
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {% endwith %}
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+
|
|
|
|
|
+ </form>
|
|
|
|
|
+
|
|
|
|
|
+ {# Paginator #}
|
|
|
|
|
+ {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ {# Filter form #}
|
|
|
|
|
+ {% if filter_form %}
|
|
|
|
|
+ <div class="tab-pane show" id="filters-form" role="tabpanel" aria-labelledby="filters-form-tab">
|
|
|
|
|
+ {% include 'inc/filter_list.html' %}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {% endif %}
|
|
|
</div>
|
|
</div>
|
|
|
- {% if filter_form %}
|
|
|
|
|
- {% include 'inc/filter_list.html' %}
|
|
|
|
|
- {% endif %}
|
|
|
|
|
-</div>
|
|
|
|
|
-{% table_config_form table table_name="ObjectTable" %}
|
|
|
|
|
-{% endblock content %}
|
|
|
|
|
|
|
+
|
|
|
|
|
+ {# Table config form #}
|
|
|
|
|
+ {% table_config_form table table_name="ObjectTable" %}
|
|
|
|
|
+{% endblock content-wrapper %}
|