mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-01 13:26:25 -06:00
Rearrange table controls
This commit is contained in:
parent
ed7af5af3c
commit
d5a7cc5891
@ -82,41 +82,43 @@
|
|||||||
{# Object table controls #}
|
{# Object table controls #}
|
||||||
{% include 'inc/table_controls.html' with table_modal="ObjectTable_config" %}
|
{% include 'inc/table_controls.html' with table_modal="ObjectTable_config" %}
|
||||||
|
|
||||||
{# Object table #}
|
<form method="post" class="form form-horizontal">
|
||||||
<div class="card">
|
{% csrf_token %}
|
||||||
<div class="card-body">
|
<input type="hidden" name="return_url" value="{% if return_url %}{{ return_url }}{% else %}{{ request.path }}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}{% endif %}" />
|
||||||
{% 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 %}
|
{# Object table #}
|
||||||
<form method="post" class="form form-horizontal">
|
<div class="card">
|
||||||
{% csrf_token %}
|
<div class="card-body">
|
||||||
<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">
|
||||||
<div class="table-responsive">
|
{% render_table table 'inc/table.html' %}
|
||||||
{% render_table table 'inc/table.html' %}
|
</div>
|
||||||
</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 %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
<div class="table-responsive">
|
|
||||||
{% render_table table 'inc/table.html' %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
{# 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 %}
|
{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,19 +1,4 @@
|
|||||||
<div class="row mb-3 justify-content-between">
|
<div class="row mb-3 justify-content-between">
|
||||||
<div class="col col-md-2 mb-0 d-flex noprint table-controls">
|
|
||||||
{% if request.user.is_authenticated and table_modal %}
|
|
||||||
<div class="input-group input-group-sm">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
data-bs-toggle="modal"
|
|
||||||
title="Configure Table"
|
|
||||||
data-bs-target="#{{ table_modal }}"
|
|
||||||
class="btn btn-sm btn-outline-dark"
|
|
||||||
>
|
|
||||||
<i class="mdi mdi-cog"></i> Configure Table
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="col col-12 col-lg-4 my-3 my-lg-0 d-flex noprint table-controls">
|
<div class="col col-12 col-lg-4 my-3 my-lg-0 d-flex noprint table-controls">
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<input
|
<input
|
||||||
@ -24,4 +9,17 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col col-md-2 mb-0 d-flex justify-content-end noprint table-controls">
|
||||||
|
{% if request.user.is_authenticated and table_modal %}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
data-bs-toggle="modal"
|
||||||
|
title="Configure Table"
|
||||||
|
data-bs-target="#{{ table_modal }}"
|
||||||
|
class="btn btn-sm btn-outline-dark"
|
||||||
|
>
|
||||||
|
<i class="mdi mdi-cog"></i> Configure Table
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user