From 5a2c20ea553316f7ccc116db7bf1416759068d69 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 29 Oct 2021 01:05:39 +1100 Subject: [PATCH] Refactor sidebar for "company" display --- .../templates/company/company_base.html | 5 -- .../company/templates/company/detail.html | 9 +-- .../company/templates/company/navbar.html | 70 ------------------- .../company/templates/company/sidebar.html | 19 +++++ 4 files changed, 22 insertions(+), 81 deletions(-) delete mode 100644 InvenTree/company/templates/company/navbar.html create mode 100644 InvenTree/company/templates/company/sidebar.html diff --git a/InvenTree/company/templates/company/company_base.html b/InvenTree/company/templates/company/company_base.html index 708fd97290..9fcf2be16a 100644 --- a/InvenTree/company/templates/company/company_base.html +++ b/InvenTree/company/templates/company/company_base.html @@ -130,11 +130,6 @@ {% block js_ready %} {{ block.super }} - enableNavbar({ - label: 'company', - toggleId: '#company-menu-toggle' - }); - $('#company-edit').click(function() { editCompany({{ company.id }}); }); diff --git a/InvenTree/company/templates/company/detail.html b/InvenTree/company/templates/company/detail.html index 8ac4f53af1..5f2c144c2a 100644 --- a/InvenTree/company/templates/company/detail.html +++ b/InvenTree/company/templates/company/detail.html @@ -3,8 +3,8 @@ {% load i18n %} {% load markdownify %} -{% block menubar %} -{% include 'company/navbar.html' with tab='details' %} +{% block sidebar %} +{% include 'company/sidebar.html' %} {% endblock %} {% block page_content %} @@ -405,9 +405,6 @@ {% endif %} - attachNavCallbacks({ - name: 'company', - default: 'company-stock' - }); + enableSidebar('company'); {% endblock %} \ No newline at end of file diff --git a/InvenTree/company/templates/company/navbar.html b/InvenTree/company/templates/company/navbar.html deleted file mode 100644 index b652d6b603..0000000000 --- a/InvenTree/company/templates/company/navbar.html +++ /dev/null @@ -1,70 +0,0 @@ -{% load i18n %} -{% load static %} -{% load inventree_extras %} - - \ No newline at end of file diff --git a/InvenTree/company/templates/company/sidebar.html b/InvenTree/company/templates/company/sidebar.html new file mode 100644 index 0000000000..5481aa013a --- /dev/null +++ b/InvenTree/company/templates/company/sidebar.html @@ -0,0 +1,19 @@ +{% load i18n %} +{% load static %} +{% load inventree_extras %} + +{% if company.is_manufacturer %} +{% include "sidebar_item.html" with label='manufacturer-parts' text="Manufactured Parts" icon="fa-industry" %} +{% endif %} +{% if company.is_supplier %} +{% include "sidebar_item.html" with label='supplier-parts' text="Supplied Parts" icon="fa-building" %} +{% include "sidebar_item.html" with label='purchase-orders' text="Purchase Orders" icon="fa-shopping-cart" %} +{% endif %} +{% if company.is_manufacturer or company.is_supplier %} +{% include "sidebar_item.html" with label='company-stock' text="Supplied Stock Items" icon="fa-boxes" %} +{% endif %} +{% if company.is_customer %} +{% include "sidebar_item.html" with label='sales-orders' text="Sales Orders" icon="fa-truck" %} +{% include "sidebar_item.html" with label='assigned-stock' text="Assigned Stock Items" icon="fa-sign-out-alt" %} +{% endif %} +{% include "sidebar_item.html" with label='company-notes' text="Notes" icon="fa-clipboard" %}