From 89bdfd1c62e462275ff1ac2d632c91f489a9baf5 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 24 Feb 2021 21:27:44 +1100 Subject: [PATCH] StockItem display now uses menubar --- InvenTree/stock/templates/stock/item.html | 11 +++- .../templates/stock/item_attachments.html | 14 +++-- .../stock/templates/stock/item_base.html | 5 +- .../stock/templates/stock/item_childs.html | 16 ++--- .../stock/templates/stock/item_installed.html | 14 +++-- .../stock/templates/stock/item_notes.html | 35 ++++------- .../stock/templates/stock/item_tests.html | 14 +++-- InvenTree/stock/templates/stock/navbar.html | 61 +++++++++++++++++++ InvenTree/stock/templates/stock/tabs.html | 49 --------------- 9 files changed, 118 insertions(+), 101 deletions(-) create mode 100644 InvenTree/stock/templates/stock/navbar.html delete mode 100644 InvenTree/stock/templates/stock/tabs.html diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index 74fe8acdcd..6f13de30a3 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -4,16 +4,21 @@ {% load inventree_extras %} {% load i18n %} -{% block details %} +{% block menubar %} +{% include "stock/navbar.html" with tab="tracking" %} +{% endblock %} -{% include "stock/tabs.html" with tab="tracking" %} +{% block heading %} +{% trans "Stock Tracking Information" %} +{% endblock %} + +{% block details %} {% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} {% if owner_control.value == "True" %} {% authorized_owners item.owner as owners %} {% endif %} -

{% trans "Stock Tracking Information" %}


diff --git a/InvenTree/stock/templates/stock/item_attachments.html b/InvenTree/stock/templates/stock/item_attachments.html index 3861bebe6a..a022403d02 100644 --- a/InvenTree/stock/templates/stock/item_attachments.html +++ b/InvenTree/stock/templates/stock/item_attachments.html @@ -3,13 +3,15 @@ {% load static %} {% load i18n %} +{% block menubar %} +{% include "stock/navbar.html" with tab='attachments' %} +{% endblock %} + +{% block heading %} +{% trans "Stock Item Attachments" %} +{% endblock %} + {% block details %} - -{% include "stock/tabs.html" with tab='attachments' %} - -

{% trans "Stock Item Attachments" %}

-
- {% include "attachment_table.html" with attachments=item.attachments.all %} {% endblock %} diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index c61add6905..28fc9969fc 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -381,9 +381,12 @@ InvenTree | {% trans "Stock Item" %} - {{ item }} {% endblock %} {% block js_ready %} - {{ block.super }} +enableRightNavbar({ + minWidth: '50px' +}); + loadTree("{% url 'api-stock-tree' %}", "#stock-tree", { diff --git a/InvenTree/stock/templates/stock/item_childs.html b/InvenTree/stock/templates/stock/item_childs.html index a271852846..eaa6eef1e3 100644 --- a/InvenTree/stock/templates/stock/item_childs.html +++ b/InvenTree/stock/templates/stock/item_childs.html @@ -3,14 +3,16 @@ {% load static %} {% load i18n %} + +{% block menubar %} +{% include "stock/navbar.html" with tab='children' %} +{% endblock %} + +{% block heading %} +{% trans "Child Stock Items" %} +{% endblock %} + {% block details %} - -{% include "stock/tabs.html" with tab='children' %} - -
- -

{% trans "Child Stock Items" %}

- {% if item.child_count > 0 %} {% include "stock_table.html" %} {% else %} diff --git a/InvenTree/stock/templates/stock/item_installed.html b/InvenTree/stock/templates/stock/item_installed.html index 2a6a0db057..8902fe00ef 100644 --- a/InvenTree/stock/templates/stock/item_installed.html +++ b/InvenTree/stock/templates/stock/item_installed.html @@ -3,13 +3,15 @@ {% load static %} {% load i18n %} +{% block menubar %} +{% include "stock/navbar.html" with tab='installed' %} +{% endblock %} + +{% block heading %} +{% trans "Installed Stock Items" %} +{% endblock %} + {% block details %} - -{% include "stock/tabs.html" with tab='installed' %} - -

{% trans "Installed Stock Items" %}

-
-
{% endblock %} diff --git a/InvenTree/stock/templates/stock/item_notes.html b/InvenTree/stock/templates/stock/item_notes.html index 9dd21331b4..a50f0e8acd 100644 --- a/InvenTree/stock/templates/stock/item_notes.html +++ b/InvenTree/stock/templates/stock/item_notes.html @@ -5,15 +5,16 @@ {% load i18n %} {% load markdownify %} +{% block menubar %} +{% include "stock/navbar.html" with tab="notes" %} +{% endblock %} + +{% block heading %} +{% trans "Stock Item Notes" %} +{% endblock %} + {% block details %} - -{% include "stock/tabs.html" with tab="notes" %} - {% if editing %} - -

{% trans "Stock Item Notes" %}

-
-
{% csrf_token %} @@ -25,22 +26,10 @@ {{ form.media }} {% else %} -
-
-

{% trans "Stock Item Notes" %}

-
-
- -
-
-
-
-
- {% if item.notes %} - {{ item.notes | markdownify }} - {% endif %} -
-
+ +{% if item.notes %} +{{ item.notes | markdownify }} +{% endif %} {% endif %} diff --git a/InvenTree/stock/templates/stock/item_tests.html b/InvenTree/stock/templates/stock/item_tests.html index e2ccf22037..1640013e89 100644 --- a/InvenTree/stock/templates/stock/item_tests.html +++ b/InvenTree/stock/templates/stock/item_tests.html @@ -3,13 +3,15 @@ {% load static %} {% load i18n %} +{% block menubar %} +{% include "stock/navbar.html" with tab='tests' %} +{% endblock %} + +{% block heading %} +{% trans "Test Data" %} +{% endblock %} + {% block details %} - -{% include "stock/tabs.html" with tab='tests' %} - -

{% trans "Test Data" %}

-
-
diff --git a/InvenTree/stock/templates/stock/navbar.html b/InvenTree/stock/templates/stock/navbar.html new file mode 100644 index 0000000000..4019f3be28 --- /dev/null +++ b/InvenTree/stock/templates/stock/navbar.html @@ -0,0 +1,61 @@ +{% load i18n %} + + \ No newline at end of file diff --git a/InvenTree/stock/templates/stock/tabs.html b/InvenTree/stock/templates/stock/tabs.html deleted file mode 100644 index cb4021f34e..0000000000 --- a/InvenTree/stock/templates/stock/tabs.html +++ /dev/null @@ -1,49 +0,0 @@ -{% load i18n %} - -