Refactor sidebar for "company" display

This commit is contained in:
Oliver 2021-10-29 01:05:39 +11:00
parent 613b135edf
commit 5a2c20ea55
4 changed files with 22 additions and 81 deletions

View File

@ -130,11 +130,6 @@
{% block js_ready %}
{{ block.super }}
enableNavbar({
label: 'company',
toggleId: '#company-menu-toggle'
});
$('#company-edit').click(function() {
editCompany({{ company.id }});
});

View File

@ -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 %}

View File

@ -1,70 +0,0 @@
{% load i18n %}
{% load static %}
{% load inventree_extras %}
<ul class='list-group'>
<li class='list-group-item'>
<a href='#' id='company-menu-toggle'>
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
</a>
</li>
{% if company.is_manufacturer %}
<li class='list-group-item' title='{% trans "Manufactured Parts" %}'>
<a href='#' id='select-manufacturer-parts' class='nav-toggle'>
<span class='fas fa-industry sidebar-icon'></span>
{% trans "Manufactured Parts" %}
</a>
</li>
{% endif %}
{% if company.is_supplier %}
<li class='list-group-item' title='{% trans "Supplied Parts" %}'>
<a href='#' id='select-supplier-parts' class='nav-toggle'>
<span class='fas fa-building sidebar-icon'></span>
{% trans "Supplied Parts" %}
</a>
</li>
{% endif %}
{% if company.is_manufacturer or company.is_supplier %}
<li class='list-group-item' title='{% trans "Stock Items" %}'>
<a href='#' id='select-company-stock' class='nav-toggle'>
<span class='fas fa-boxes sidebar-icon'></span>
{% trans "Stock" %}
</a>
</li>
{% endif %}
{% if company.is_supplier %}
<li class='list-group-item' title='{% trans "Purchase Orders" %}'>
<a href='#' id='select-purchase-orders' class='nav-toggle'>
<span class='fas fa-shopping-cart sidebar-icon'></span>
{% trans "Purchase Orders" %}
</a>
</li>
{% endif %}
{% if company.is_customer %}
<li class='list-group-item' title='{% trans "Sales Orders" %}'>
<a href='#' id='select-sales-orders' class='nav-toggle'>
<span class='fas fa-truck sidebar-icon'></span>
{% trans "Sales Orders" %}
</a>
</li>
<li class='list-group-item' title='{% trans "Assigned Stock" %}'>
<a href='#' id='select-assigned-stock' class='nav-toggle'>
<span class='fas fa-sign-out-alt sidebar-icon'></span>
{% trans "Assigned Stock" %}
</a>
</li>
{% endif %}
<li class='list-group-item' title='{% trans "Notes" %}'>
<a href='#' id='select-company-notes' class='nav-toggle'>
<span class='fas fa-clipboard sidebar-icon'></span>
{% trans "Notes" %}
</a>
</li>
</ul>

View File

@ -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" %}