From 00a0311c63d3cdea4eefe343c7b679d558f02e55 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 29 Oct 2021 01:08:18 +1100 Subject: [PATCH] Refactor sidebar for "sales order" page --- .../templates/order/sales_order_base.html | 5 --- .../templates/order/sales_order_detail.html | 11 ++--- .../order/templates/order/so_navbar.html | 40 ------------------- .../order/templates/order/so_sidebar.html | 8 ++++ InvenTree/templates/js/dynamic/nav.js | 2 - 5 files changed, 12 insertions(+), 54 deletions(-) delete mode 100644 InvenTree/order/templates/order/so_navbar.html create mode 100644 InvenTree/order/templates/order/so_sidebar.html diff --git a/InvenTree/order/templates/order/sales_order_base.html b/InvenTree/order/templates/order/sales_order_base.html index cd87da6aad..1c679fdc04 100644 --- a/InvenTree/order/templates/order/sales_order_base.html +++ b/InvenTree/order/templates/order/sales_order_base.html @@ -161,11 +161,6 @@ src="{% static 'img/blank_image.png' %}" {% block js_ready %} {{ block.super }} -enableNavbar({ - label: 'so', - toggleId: '#so-menu-toggle', -}); - $("#edit-order").click(function() { constructForm('{% url "api-so-detail" order.pk %}', { diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index 6203b7909a..e890c7caab 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -6,8 +6,8 @@ {% load static %} {% load markdownify %} -{% block menubar %} -{% include "order/so_navbar.html" %} +{% block sidebar %} +{% include "order/so_sidebar.html" %} {% endblock %} {% block page_content %} @@ -191,9 +191,6 @@ } ); - attachNavCallbacks({ - name: 'sales-order', - default: 'order-items' - }); - + enableSidebar('salesorder'); + {% endblock %} \ No newline at end of file diff --git a/InvenTree/order/templates/order/so_navbar.html b/InvenTree/order/templates/order/so_navbar.html deleted file mode 100644 index 710976ed3f..0000000000 --- a/InvenTree/order/templates/order/so_navbar.html +++ /dev/null @@ -1,40 +0,0 @@ -{% load i18n %} -{% load static %} -{% load inventree_extras %} - - \ No newline at end of file diff --git a/InvenTree/order/templates/order/so_sidebar.html b/InvenTree/order/templates/order/so_sidebar.html new file mode 100644 index 0000000000..be924eb37b --- /dev/null +++ b/InvenTree/order/templates/order/so_sidebar.html @@ -0,0 +1,8 @@ +{% load i18n %} +{% load static %} +{% load inventree_extras %} + +{% include "sidebar_item.html" with label='order-items' text="Line Items" icon="fa-list-ol" %} +{% include "sidebar_item.html" with label='order-builds' text="Build Orders" icon="fa-tools" %} +{% include "sidebar_item.html" with label='order-attachments' text="Attachments" icon="fa-paperclip" %} +{% include "sidebar_item.html" with label='order-notes' text="Notes" icon="fa-clipboard" %} diff --git a/InvenTree/templates/js/dynamic/nav.js b/InvenTree/templates/js/dynamic/nav.js index 7d804f2925..19e9a5e45b 100644 --- a/InvenTree/templates/js/dynamic/nav.js +++ b/InvenTree/templates/js/dynamic/nav.js @@ -17,8 +17,6 @@ function activatePanel(label, panel_name, options={}) { $('.panel-visible').hide(); $('.panel-visible').removeClass('panel-visible'); - console.log('active panel:', label, panel_name); - // Find the target panel var panel = `#panel-${panel_name}`; var select = `#select-${panel_name}`;