mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-24 11:59:31 +00:00
Implemented a treeview element using stimulus
This commit is contained in:
parent
91af024081
commit
8cf131a7d6
3 changed files with 102 additions and 22 deletions
19
templates/elements/_tree_view.html.twig
Normal file
19
templates/elements/_tree_view.html.twig
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<div {{ stimulus_controller('elements/tree') }} data-tree-data="{{ generateTreeData(entity) }}">
|
||||
<div class="row" >
|
||||
<div class="col-8">
|
||||
<input type="search" class="form-control" placeholder="{% trans %}search.placeholder{% endtrans %}" {{ stimulus_action('elements/tree', 'searchInput') }}>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm col-4" role="group">
|
||||
<button type="button" class="btn btn-outline-secondary" {{ stimulus_action('elements/tree', 'expandAll') }}
|
||||
title="{% trans %}expandAll{% endtrans %}">
|
||||
<i class="fas fa-plus fa-fw"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary" {{ stimulus_action('elements/tree', 'collapseAll') }}
|
||||
title="{% trans %}reduceAll{% endtrans %}">
|
||||
<i class="fas fa-minus fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="treeview-sm mt-2" {{ stimulus_target('elements/tree', 'tree') }}></div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue