Refactor sidebar for "sales order" page

This commit is contained in:
Oliver 2021-10-29 01:08:18 +11:00
parent 5a2c20ea55
commit 00a0311c63
5 changed files with 12 additions and 54 deletions

View File

@ -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 %}', {

View File

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

View File

@ -1,40 +0,0 @@
{% load i18n %}
{% load static %}
{% load inventree_extras %}
<ul class='list-group'>
<li class='list-group-item'>
<a href='#' id='so-menu-toggle'>
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
</a>
</li>
<li class='list-group-item' title='{% trans "Sales Order Line Items" %}'>
<a href='#' id='select-order-items' class='nav-toggle'>
<span class='fas fa-list-ol sidebar-icon'></span>
{% trans "Order Items" %}
</a>
</li>
<li class='list-group-item' title='{% trans "Build Orders" %}'>
<a href='#' id='select-order-builds' class='nav-toggle'>
<span class='fas fa-tools sidebar-icon'></span>
{% trans "Build Orders" %}
</a>
</li>
<li class='list-group-item' title='{% trans "Sales Order Attachments" %}'>
<a href='#' id='select-order-attachments' class='nav-toggle'>
<span class='fas fa-paperclip sidebar-icon'></span>
{% trans "Attachments" %}
</a>
</li>
<li class='list-group-item' title='{% trans "Notes" %}'>
<a href='#' id='select-order-notes' class='nav-toggle'>
<span class='fas fa-clipboard sidebar-icon'></span>
{% trans "Notes" %}
</a>
</li>
</ul>

View File

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

View File

@ -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}`;