2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Part Category now uses menubar display

This commit is contained in:
Oliver Walters 2021-02-24 21:39:45 +11:00
parent a0eec930bb
commit 48d2a395de
5 changed files with 162 additions and 118 deletions

View File

@ -4,6 +4,7 @@
{% block content %}
<div class='panel panel-default panel-inventree'>
<div class='row'>
<div class='col-sm-6'>
{% if category %}
@ -104,7 +105,8 @@
{% elif children|length > 0 %}
{% include "part/subcategories.html" with children=children collapse_id="categories" %}
{% endif %}
<hr>
</div>
<div id='button-toolbar'>
<div class='btn-group'>
@ -132,19 +134,38 @@
</div>
</div>
<div class='panel panel-default panel-inventree'>
<div class='panel-heading'>
<h4>
{% block heading %}
<!-- Heading goes here -->
{% endblock %}
</h4>
</div>
<div class='panel-content'>
{% block details %}
<!-- Content goes here -->
{% endblock %}
</div>
</div>
{% block category_tables %}
<table class='table table-striped table-condensed' data-toolbar='#button-toolbar' id='part-table'>
</table>
{% endblock category_tables %}
{% endblock %}
{% block js_load %}
{{ block.super }}
{% endblock %}
{% block js_ready %}
{{ block.super }}
enableRightNavbar({
minWidth: '50px',
});
if (inventreeLoadInt("show-part-cats") == 1) {
$("#collapse-item-categories").collapse('show');
}

View File

@ -0,0 +1,24 @@
{% load i18n %}
<ul class='list-group'>
<li class='list-group-item'>
<a href='#' id='category-menu-toggle'>
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
</a>
</li>
<li class='list-group-item {% if tab == "parts" %}active{% endif %}' title='{% trans "Parts" %}'>
<a href='{% url "category-detail" category.id %}'>
<span class='fas fa-shapes'></span>
{% trans "Parts" %}
</a>
</li>
<li class='list-group-item {% if tab == "parameters" %}active{% endif %}' title='{% trans "Parameters" %}'>
<a href='{% url "category-parametric" category.id %}'>
<span class='fas fa-tasks'></span>
{% trans "Parameters" %}
</a>
</li>
</ul>

View File

@ -2,9 +2,15 @@
{% load static %}
{% load i18n %}
{% block category_tables %}
{% block menubar %}
{% include 'part/category_navbar.html' with tab='parameters' %}
{% endblock %}
{% include 'part/category_tabs.html' with tab='parametric-table' %}
{% block heading %}
{% trans "Part Parameters" %}
{% endblock %}
{% block details %}
<table class='table table-striped table-condensed' data-toolbar='#button-toolbar' id='parametric-part-table'>
</table>

View File

@ -2,11 +2,15 @@
{% load static %}
{% load i18n %}
{% block category_tables %}
{% block menubar %}
{% include 'part/category_navbar.html' with tab='parts' %}
{% endblock %}
{% include 'part/category_tabs.html' with tab='part-list' %}
{% block heading %}
{% trans "Parts" %}
{% endblock %}
{% block details %}
<table class='table table-striped table-condensed' data-toolbar='#button-toolbar' id='part-table'>
</table>
{% endblock %}

View File

@ -1,11 +0,0 @@
{% load i18n %}
{% load inventree_extras %}
<ul class="nav nav-tabs">
<li{% ifequal tab 'part-list' %} class="active"{% endifequal %}>
<a href="{% url 'category-detail' category.id %}">{% trans "Parts" %} <span class="badge">{% decimal part_count %}</span></a>
</li>
<li{% ifequal tab 'parametric-table' %} class='active'{% endifequal %}>
<a href="{% url 'category-parametric' category.id %}">{% trans "Parametric Table" %}</a>
</li>
</ul>