From bedfaa582cb1b0975ef09187ccfae9a14ec7c44d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 24 Feb 2021 17:58:43 +1100 Subject: [PATCH] Update "part" display to use new menubar --- InvenTree/InvenTree/static/css/inventree.css | 5 ++ InvenTree/part/templates/part/allocation.html | 14 +-- .../part/templates/part/attachments.html | 15 ++-- InvenTree/part/templates/part/bom.html | 12 ++- InvenTree/part/templates/part/build.html | 15 ++-- InvenTree/part/templates/part/detail.html | 11 ++- InvenTree/part/templates/part/navbar.html | 85 +++++++++++-------- InvenTree/part/templates/part/notes.html | 26 +++--- InvenTree/part/templates/part/orders.html | 13 +-- InvenTree/part/templates/part/params.html | 15 ++-- InvenTree/part/templates/part/part_base.html | 20 +++-- InvenTree/part/templates/part/part_tests.html | 15 ++-- InvenTree/part/templates/part/related.html | 13 +-- .../part/templates/part/sale_prices.html | 13 +-- .../part/templates/part/sales_orders.html | 13 +-- InvenTree/part/templates/part/stock.html | 15 ++-- InvenTree/part/templates/part/supplier.html | 15 ++-- InvenTree/part/templates/part/tabs.html | 73 ---------------- InvenTree/part/templates/part/used_in.html | 15 ++-- InvenTree/part/templates/part/variants.html | 19 ++--- 20 files changed, 205 insertions(+), 217 deletions(-) delete mode 100644 InvenTree/part/templates/part/tabs.html diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index 90210c6d70..b383d5bb58 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -699,6 +699,11 @@ input[type="submit"] { overflow-x: hidden; } +.sidenav .list-group-item.active { + background-color: #ddd; + border-color: #ccc; +} + /* The side navigation menu */ .sidenav-left { left: 0px; diff --git a/InvenTree/part/templates/part/allocation.html b/InvenTree/part/templates/part/allocation.html index e574742ad5..803df3906d 100644 --- a/InvenTree/part/templates/part/allocation.html +++ b/InvenTree/part/templates/part/allocation.html @@ -3,12 +3,15 @@ {% load i18n %} {% load inventree_extras %} +{% block menubar %} +{% include "part/navbar.html" with tab="allocation" %} +{% endblock %} + +{% block heading %} +{% trans "Part Stock Allocations" %} +{% endblock %} + {% block details %} - -{% include "part/tabs.html" with tab="allocation" %} - -

{% trans "Part Stock Allocations" %}

- @@ -34,6 +37,7 @@ {% endblock %} {% block js_ready %} +{{ block.super }} $("#build-table").inventreeTable({ columns: [ diff --git a/InvenTree/part/templates/part/attachments.html b/InvenTree/part/templates/part/attachments.html index aa31cd3f32..93440e13ed 100644 --- a/InvenTree/part/templates/part/attachments.html +++ b/InvenTree/part/templates/part/attachments.html @@ -1,14 +1,17 @@ {% extends "part/part_base.html" %} {% load static %} {% load i18n %} + +{% block menubar %} +{% include 'part/navbar.html' with tab='attachments' %} +{% endblock %} + +{% block heading %} +{% trans "Part Attachments" %} +{% endblock %} + {% block details %} -{% include 'part/tabs.html' with tab='attachments' %} - -

{% trans "Part Attachments" %}

- -
- {% include "attachment_table.html" with attachments=part.part_attachments %} {% endblock %} diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html index 322d637089..54f069257b 100644 --- a/InvenTree/part/templates/part/bom.html +++ b/InvenTree/part/templates/part/bom.html @@ -2,17 +2,15 @@ {% load static %} {% load i18n %} -{% block css %} +{% block menubar %} +{% include 'part/navbar.html' with tab='bom' %} +{% endblock %} +{% block heading %} +{% trans "Bill of Materials" %} {% endblock %} {% block details %} - -{% include 'part/tabs.html' with tab='bom' %} - -

{% trans "Bill of Materials" %}

-
- {% if part.bom_checked_date %} {% if part.is_bom_valid %}
diff --git a/InvenTree/part/templates/part/build.html b/InvenTree/part/templates/part/build.html index 46685ad064..0e7b5d4d8f 100644 --- a/InvenTree/part/templates/part/build.html +++ b/InvenTree/part/templates/part/build.html @@ -1,13 +1,16 @@ {% extends "part/part_base.html" %} {% load static %} {% load i18n %} + +{% block menubar %} +{% include 'part/navbar.html' with tab='build' %} +{% endblock %} + +{% block heading %} +{% trans "Part Builds" %} +{% endblock %} + {% block details %} - -{% include 'part/tabs.html' with tab='build' %} - -

{% trans "Part Builds" %}

-
-
{% if part.active %} diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index f5212d6312..bb808af264 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -2,13 +2,16 @@ {% load static %} {% load i18n %} -{% block details %} -{% include 'part/tabs.html' with tab='detail' %} +{% block menubar %} +{% include 'part/navbar.html' with tab='details' %} +{% endblock %} -

{% trans "Part Details" %}

+{% block heading %} +{% trans "Part Details" %} +{% endblock %} -
+{% block details %}
diff --git a/InvenTree/part/templates/part/navbar.html b/InvenTree/part/templates/part/navbar.html index 5e3b9ca19e..7b9babf422 100644 --- a/InvenTree/part/templates/part/navbar.html +++ b/InvenTree/part/templates/part/navbar.html @@ -5,106 +5,121 @@
  • - + {% trans "Part" %}
  • - {% trans "Details" %} + + + {% trans "Details" %} +
  • -
  • +
  • - + {% trans "Parameters" %}
  • -
  • + {% if part.is_template %} +
  • - + {% trans "Variants" %}
  • -
  • + {% endif %} +
  • - + {% trans "Stock" %}
  • -
  • + {% if part.component or part.salable %} +
  • - + {% trans "Allocations" %}
  • -
  • + {% endif %} + {% if part.assembly %} +
  • - + {% trans "Bill of Materials" %}
  • -
  • + {% if roles.build.view %} +
  • - + {% trans "Build Orders" %}
  • -
  • + {% endif %} + {% endif %} + {% if part.component %} +
  • - + {% trans "Used In" %}
  • - {% if roles.purchase_order.view %} -
  • + {% endif %} + {% if part.purchaseable and roles.purchase_order.view %} +
  • - + {% trans "Suppliers" %}
  • -
  • +
  • - + {% trans "Purchase Orders" %}
  • {% endif %} - {% if roles.sales_order.view %} -
  • + {% if part.salable and roles.sales_order.view %} +
  • - + {% trans "Sale Price" %}
  • -
  • +
  • - + {% trans "Sales Orders" %}
  • {% endif %} -
  • + {% if part.trackable %} +
  • - + {% trans "Tests" %}
  • -
  • + {% endif %} +
  • - + {% trans "Related Parts" %}
  • -
  • +
  • - - {% trans "Attacments" %} + + {% trans "Attachments" %}
  • -
  • +
  • - + {% trans "Notes" %}
  • diff --git a/InvenTree/part/templates/part/notes.html b/InvenTree/part/templates/part/notes.html index 1c46f53bcd..7b3fe8ca0f 100644 --- a/InvenTree/part/templates/part/notes.html +++ b/InvenTree/part/templates/part/notes.html @@ -4,14 +4,19 @@ {% load i18n %} {% load markdownify %} +{% block menubar %} +{% include 'part/navbar.html' with tab='notes' %} +{% endblock %} + +{% block heading %} +{% trans "Part Notes" %} +{% endblock %} + {% block details %} -{% include 'part/tabs.html' with tab='notes' %} {% if editing %} -

    {% trans "Part Notes" %}

    -
    {% csrf_token %} @@ -24,17 +29,10 @@ {{ form.media }} {% else %} -
    -
    -

    {% trans "Part Notes" %}

    -
    -
    - {% if roles.part.change %} - - {% endif %} -
    -
    -
    +{% if roles.part.change %} + +{% endif %} +
    {% if part.notes %} diff --git a/InvenTree/part/templates/part/orders.html b/InvenTree/part/templates/part/orders.html index 3611418c6c..24a1cdbf3c 100644 --- a/InvenTree/part/templates/part/orders.html +++ b/InvenTree/part/templates/part/orders.html @@ -2,13 +2,16 @@ {% load static %} {% load i18n %} +{% block menubar %} +{% include 'part/navbar.html' with tab='orders' %} +{% endblock %} + +{% block heading %} +{% trans "Purchase Orders" %} +{% endblock %} + {% block details %} -{% include 'part/tabs.html' with tab='orders' %} - -

    {% trans "Purchase Orders" %}

    -
    -
{% trans "Order" %}