From 613b135edfaad8eab1ee7a57b59b41aa932e60d5 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 29 Oct 2021 01:00:39 +1100 Subject: [PATCH] Refactor sidebar for "build order" display --- .../build/templates/build/build_base.html | 11 ---- InvenTree/build/templates/build/detail.html | 7 +- InvenTree/build/templates/build/navbar.html | 66 ------------------- InvenTree/build/templates/build/sidebar.html | 15 +++++ 4 files changed, 20 insertions(+), 79 deletions(-) delete mode 100644 InvenTree/build/templates/build/navbar.html create mode 100644 InvenTree/build/templates/build/sidebar.html diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index bbdf626b87..155f665548 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -186,11 +186,6 @@ src="{% static 'img/blank_image.png' %}" {% block js_ready %} - enableNavbar({ - label: 'build', - toggleId: '#build-menu-toggle' - }); - $("#build-edit").click(function () { editBuildOrder({{ build.pk }}); }); @@ -233,11 +228,5 @@ src="{% static 'img/blank_image.png' %}" } ); }); - - attachNavCallbacks({ - name: 'buildorder', - default: 'details' - }); - {% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index e621b24763..20424e3fd2 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -4,8 +4,8 @@ {% load status_codes %} {% load markdownify %} -{% block menubar %} -{% include "build/navbar.html" %} +{% block sidebar %} +{% include "build/sidebar.html" %} {% endblock %} {% block page_content %} @@ -552,4 +552,7 @@ $("#btn-order-parts").click(function() { {% endif %} +enableSidebar('buildorder'); + + {% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/navbar.html b/InvenTree/build/templates/build/navbar.html deleted file mode 100644 index 9b159503dc..0000000000 --- a/InvenTree/build/templates/build/navbar.html +++ /dev/null @@ -1,66 +0,0 @@ -{% load i18n %} -{% load static %} -{% load inventree_extras %} - - - diff --git a/InvenTree/build/templates/build/sidebar.html b/InvenTree/build/templates/build/sidebar.html new file mode 100644 index 0000000000..c542708cd4 --- /dev/null +++ b/InvenTree/build/templates/build/sidebar.html @@ -0,0 +1,15 @@ +{% load i18n %} +{% load static %} +{% load inventree_extras %} + +{% include "sidebar_item.html" with label='details' text="Build Order Details" icon="fa-info-circle" %} +{% if build.active %} +{% include "sidebar_item.html" with label='allocate' text="Allocate Stock" icon="fa-tasks" %} +{% endif %} +{% if not build.is_complete %} +{% include "sidebar_item.html" with label='outputs' text="Pending Items" icon="fa-tools" %} +{% endif %} +{% include "sidebar_item.html" with label='completed' text="Completed Items" icon="fa-boxes" %} +{% include "sidebar_item.html" with label='children' text="Child Build Orders" icon="fa-sitemap" %} +{% include "sidebar_item.html" with label='attachments' text="Attachments" icon="fa-paperclip" %} +{% include "sidebar_item.html" with label='notes' text="Notes" icon="fa-clipboard" %}