mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
#6372: Simplify & streamline table config & table filter elements
This commit is contained in:
parent
7449ea28a5
commit
ae5c2d49c6
@ -6,11 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end noprint">
|
{% include 'inc/table_controls.html' with table_modal="DeviceConsolePortTable_config" %}
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#DeviceConsolePortTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% render_table consoleport_table 'inc/table.html' %}
|
{% render_table consoleport_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_consoleport %}
|
{% if perms.dcim.change_consoleport %}
|
||||||
|
@ -6,11 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end noprint">
|
{% include 'inc/table_controls.html' with table_modal="DeviceConsoleServerPortTable_config" %}
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#DeviceConsoleServerPortTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% render_table consoleserverport_table 'inc/table.html' %}
|
{% render_table consoleserverport_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_consoleserverport %}
|
{% if perms.dcim.change_consoleserverport %}
|
||||||
|
@ -6,11 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end noprint">
|
{% include 'inc/table_controls.html' with table_modal="DeviceDeviceBayTable_config" %}
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#DeviceDeviceBayTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% render_table devicebay_table 'inc/table.html' %}
|
{% render_table devicebay_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_devicebay %}
|
{% if perms.dcim.change_devicebay %}
|
||||||
|
@ -6,11 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end noprint">
|
{% include 'inc/table_controls.html' with table_modal="DeviceFrontPortTable_config" %}
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#DeviceFrontPortTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% render_table frontport_table 'inc/table.html' %}
|
{% render_table frontport_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_frontport %}
|
{% if perms.dcim.change_frontport %}
|
||||||
|
@ -6,28 +6,34 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end col-md-4 noprint table-controls mw-33">
|
<div class="row mb-3 justify-content-between">
|
||||||
|
<div class="col col-md-2 float-end noprint table-controls mb-0 mw-33">
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<input type="text" class="form-control interface-filter" placeholder="Filter" title="Filter text (regular expressions supported)" />
|
|
||||||
<button class="btn btn-sm btn-outline-dark dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
||||||
<i class="mdi mdi-table-cog"></i>
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="dropdown-item"
|
class="btn btn-sm btn-outline-dark"
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
data-bs-target="#DeviceInterfaceTable_config"
|
data-bs-target="#DeviceInterfaceTable_config"
|
||||||
title="Configure Table">
|
title="Configure Table">
|
||||||
Configure Table
|
<i class="mdi mdi-cog"></i> Configure Table
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<button class="btn btn-sm btn-outline-dark dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
<i class="mdi mdi-eye"></i>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
<button type="button" class="dropdown-item toggle-enabled" data-state="show">Hide Enabled</button>
|
<button type="button" class="dropdown-item toggle-enabled" data-state="show">Hide Enabled</button>
|
||||||
<button type="button" class="dropdown-item toggle-disabled" data-state="show">Hide Disabled</button>
|
<button type="button" class="dropdown-item toggle-disabled" data-state="show">Hide Disabled</button>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col col-md-4 float-end noprint table-controls mw-33">
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<input type="text" class="form-control interface-filter" placeholder="Filter" title="Filter text (regular expressions supported)" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% render_table interface_table 'inc/table.html' %}
|
{% render_table interface_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_interface %}
|
{% if perms.dcim.change_interface %}
|
||||||
|
@ -6,11 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end noprint">
|
{% include 'inc/table_controls.html' with table_modal="DeviceInventoryItemTable_config" %}
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#DeviceInventoryItemTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% render_table inventoryitem_table 'inc/table.html' %}
|
{% render_table inventoryitem_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_inventoryitem %}
|
{% if perms.dcim.change_inventoryitem %}
|
||||||
|
@ -6,11 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end noprint">
|
{% include 'inc/table_controls.html' with table_modal="DevicePowerOutletTable_config" %}
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#DevicePowerOutletTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% render_table poweroutlet_table 'inc/table.html' %}
|
{% render_table poweroutlet_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_powerport %}
|
{% if perms.dcim.change_powerport %}
|
||||||
|
@ -6,11 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end noprint">
|
{% include 'inc/table_controls.html' with table_modal="DevicePowerPortTable_config" %}
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#DevicePowerPortTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% render_table powerport_table 'inc/table.html' %}
|
{% render_table powerport_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_powerport %}
|
{% if perms.dcim.change_powerport %}
|
||||||
|
@ -6,11 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end noprint">
|
{% include 'inc/table_controls.html' with table_modal="DeviceRearPortTable_config" %}
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#DeviceRearPortTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% render_table rearport_table 'inc/table.html' %}
|
{% render_table rearport_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.dcim.change_rearport %}
|
{% if perms.dcim.change_rearport %}
|
||||||
|
@ -58,27 +58,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Object list filter, table config #}
|
{# Object list filter, table config #}
|
||||||
<div class="row mb-3">
|
{% include 'inc/table_controls.html' with table_modal="ObjectTable_config" %}
|
||||||
<div class="col col-md-4 offset-md-8 d-flex noprint table-controls">
|
|
||||||
<div class="input-group input-group-sm">
|
|
||||||
<input type="text" class="form-control object-filter" placeholder="Filter" title="Filter text (regular expressions supported)" />
|
|
||||||
{% if request.user.is_authenticated and table_config_form %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#ObjectTable_config" title="Configure Table">
|
|
||||||
<i class="mdi mdi-table-eye"></i>
|
|
||||||
</button>
|
|
||||||
{% endif %}
|
|
||||||
{% if filter_form %}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-sm btn-outline-dark"
|
|
||||||
data-bs-toggle="collapse"
|
|
||||||
data-bs-target="#advanced-search-content">
|
|
||||||
Advanced Search
|
|
||||||
</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{# Object table #}
|
{# Object table #}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
37
netbox/templates/inc/table_controls.html
Normal file
37
netbox/templates/inc/table_controls.html
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<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 %}
|
||||||
|
<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-md-4 d-flex noprint table-controls">
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control object-filter"
|
||||||
|
placeholder="Filter"
|
||||||
|
title="Filter text (regular expressions supported)"
|
||||||
|
/>
|
||||||
|
{% if filter_form %}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-sm btn-outline-dark"
|
||||||
|
data-bs-toggle="collapse"
|
||||||
|
data-bs-target="#advanced-search-content"
|
||||||
|
>
|
||||||
|
Advanced Search
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -6,14 +6,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="float-end col-md-4 noprint table-controls mw-33">
|
{% include 'inc/table_controls.html' with table_modal="VirtualMachineVMInterfaceTable_config" %}
|
||||||
<div class="input-group input-group-sm">
|
|
||||||
<input type="text" class="form-control interface-filter" placeholder="Filter" title="Filter text (regular expressions supported)" />
|
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm" data-bs-toggle="modal" data-bs-target="#VirtualMachineVMInterfaceTable_config" title="Configure Table"><i class="mdi mdi-table-eye"></i></button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% render_table interface_table 'inc/table.html' %}
|
{% render_table interface_table 'inc/table.html' %}
|
||||||
<div class="noprint">
|
<div class="noprint">
|
||||||
{% if perms.virtualization.change_vminterface %}
|
{% if perms.virtualization.change_vminterface %}
|
||||||
|
Loading…
Reference in New Issue
Block a user