mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 03:38:47 +02:00
Reorganized treeview code for AdminPage treeview.
This commit is contained in:
parent
fc90259032
commit
5ec87f911b
4 changed files with 26 additions and 21 deletions
|
@ -1,3 +1,5 @@
|
|||
{% import "components/tree_macros.html.twig" as tree %}
|
||||
|
||||
{% extends "main_card.html.twig" %}
|
||||
|
||||
{% block title %}
|
||||
|
@ -23,7 +25,7 @@
|
|||
|
||||
<div class="col-sm-4">
|
||||
<turbo-frame id="admin-tree-frame" target="admin-content-frame" data-turbo-action="advance">
|
||||
{% include "elements/_tree_view.html.twig" %}
|
||||
{{ tree.treeview(entity) }}
|
||||
</turbo-frame>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% import "elements/tree_macros.html.twig" as tree %}
|
||||
{% import "components/tree_macros.html.twig" as tree %}
|
||||
|
||||
|
||||
<div class="nav flex-column">
|
||||
|
|
|
@ -37,4 +37,26 @@
|
|||
|
||||
<div id="tree-categories" {{ stimulus_target('elements/sidebar_tree', 'tree') }}></div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro treeview(entity) %}
|
||||
<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>
|
||||
{% endmacro %}
|
|
@ -1,19 +0,0 @@
|
|||
<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