mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-02 01:04:41 +02:00
Enabled treeview with turbo frames.
This commit is contained in:
parent
7b244d3034
commit
41e0b251a9
5 changed files with 211 additions and 17 deletions
|
@ -1,16 +1,17 @@
|
|||
|
||||
{% 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>
|
||||
<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">
|
||||
|
|
|
@ -58,7 +58,9 @@
|
|||
|
||||
<header>
|
||||
|
||||
{% include "_navbar.html.twig" %}
|
||||
<turbo-frame id="navbar-frame" target="content" data-turbo-action="advance">
|
||||
{% include "_navbar.html.twig" %}
|
||||
</turbo-frame>
|
||||
|
||||
{% include "_flash.html.twig" %}
|
||||
|
||||
|
@ -69,7 +71,9 @@
|
|||
<div class="row">
|
||||
<div class="collapse d-md-block bg-light" id="sidebar-container">
|
||||
<nav class="fixed-sidebar col-md-3 col-lg-2 " id="fixed-sidebar">
|
||||
{% include "_sidebar.html.twig" %}
|
||||
<turbo-frame id="sidebar" target="content" data-turbo-action="advance">
|
||||
{% include "_sidebar.html.twig" %}
|
||||
</turbo-frame>
|
||||
<noscript><b>{% trans %}vendor.base.javascript_hint{% endtrans %}</b></noscript>
|
||||
</nav>
|
||||
</div>
|
||||
|
@ -79,7 +83,7 @@
|
|||
<i class="fas fa-angle-left"></i>
|
||||
</button>
|
||||
<div class="container-fluid mr-0 pr-0" id="content-container">
|
||||
<turbo-frame id="content">
|
||||
<turbo-frame id="content" data-turbo-action="advance">
|
||||
{# Here will be the real content be injected#}
|
||||
|
||||
{% block content %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue