mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 18:25:04 +02:00
Use stimulus controller for sidebar treeviews.
This commit is contained in:
parent
2d1aa829f6
commit
fc90259032
6 changed files with 157 additions and 169 deletions
|
@ -1,21 +1,13 @@
|
|||
{% import "elements/tree_macros.html.twig" as tree %}
|
||||
|
||||
{% macro sidebar_dropdown(target) %}
|
||||
<li class="dropdown-header">{% trans %}actions{% endtrans %}</li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="expand" data-target="{{ target }}">{% trans %}expandAll{% endtrans %}</a></li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="collapse" data-target="{{ target }}">{% trans %}reduceAll{% endtrans %}</a></li>
|
||||
<li role="separator" class="dropdown-divider"></li>
|
||||
<li class="dropdown-header">{% trans %}datasource{% endtrans %}</li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="categories" data-target="{{ target }}">{% trans %}category.labelp{% endtrans %}</a></li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="locations" data-target="{{ target }}">{% trans %}storelocation.labelp{% endtrans %}</a></li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="footprints" data-target="{{ target }}">{% trans %}footprint.labelp{% endtrans %}</a></li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="manufacturers" data-target="{{ target }}">{% trans %}manufacturer.labelp{% endtrans %}</a></li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="suppliers" data-target="{{ target }}">{% trans %}supplier.labelp{% endtrans %}</a></li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="devices" data-target="{{ target }}">{% trans %}device.labelp{% endtrans %}</a></li>
|
||||
<li><a href="#" class="tree-btns dropdown-item" data-mode="tools" data-target="{{ target }}">{% trans %}tools.label{% endtrans %}</a></li>
|
||||
{% endmacro %}
|
||||
|
||||
<ul class="nav flex-column">
|
||||
<li id="treeBox-categories">
|
||||
<div class="nav flex-column">
|
||||
|
||||
{{ tree.treeview_sidebar('sidebar-panel-1', 'categories') }}
|
||||
{{ tree.treeview_sidebar('sidebar-panel-2', 'devices') }}
|
||||
{{ tree.treeview_sidebar('sidebar-panel-3', 'tools') }}
|
||||
|
||||
{# <li id="treeBox-categories">
|
||||
<div class="input-group input-group-sm mb-2 mt-1">
|
||||
<button class="btn btn-light dropdown-toggle" type="button"
|
||||
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||
|
@ -58,5 +50,5 @@
|
|||
</div>
|
||||
|
||||
<div id="tree-tools" data-tree-search="#tree-tools-search"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li> #}
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue