Purchase Order now uses menu bar

This commit is contained in:
Oliver Walters 2021-02-24 20:01:05 +11:00
parent bedfaa582c
commit 213851e8aa
9 changed files with 112 additions and 75 deletions

View File

@ -135,6 +135,10 @@ src="{% static 'img/blank_image.png' %}"
{% block js_ready %} {% block js_ready %}
{{ block.super }} {{ block.super }}
enableRightNavbar({
minWidth: '50px'
});
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %} {% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
$("#place-order").click(function() { $("#place-order").click(function() {
launchModalForm("{% url 'po-issue' order.id %}", launchModalForm("{% url 'po-issue' order.id %}",

View File

@ -5,14 +5,17 @@
{% load static %} {% load static %}
{% load markdownify %} {% load markdownify %}
{% block menubar %}
{% include 'order/po_navbar.html' with tab='notes' %}
{% endblock %}
{% block heading %}
{% trans "Order Notes" %}
{% endblock %}
{% block details %} {% block details %}
{% include 'order/po_tabs.html' with tab='notes' %}
{% if editing %} {% if editing %}
<h4>{% trans "Order Notes" %}</h4>
<hr>
<form method='POST'> <form method='POST'>
{% csrf_token %} {% csrf_token %}
@ -24,25 +27,16 @@
{{ form.media }} {{ form.media }}
{% else %} {% else %}
<div class='row'> {% if roles.purchase_order.change %}
<div class='col-sm-6'> <button title='{% trans "Edit notes" %}' class='btn btn-default action-button' id='edit-notes'><span class='fas fa-edit'></span></button>
<h4>{% trans "Order Notes" %}</h4> {% endif %}
</div> {% endif %}
{% if roles.purchase_order.change %}
<div class='col-sm-6'>
<button title='{% trans "Edit notes" %}' class='btn btn-default action-button float-right' id='edit-notes'><span class='fas fa-edit'></span></button>
</div>
{% endif %}
</div>
<hr>
<div class='panel panel-default'> <div class='panel panel-default'>
<div class='panel-content'> <div class='panel-content'>
{{ order.notes | markdownify }} {{ order.notes | markdownify }}
</div> </div>
</div> </div>
{% endif %}
{% endblock %} {% endblock %}
{% block js_ready %} {% block js_ready %}

View File

@ -4,14 +4,15 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% block menubar %}
{% include 'order/po_navbar.html' with tab='attachments' %}
{% endblock %}
{% block heading %}
{% trans "Purchase Order Attachments" %}
{% endblock %}
{% block details %} {% block details %}
{% include 'order/po_tabs.html' with tab='attachments' %}
<h4>{% trans "Purchase Order Attachments" %}</h4>
<hr>
{% include "attachment_table.html" with attachments=order.attachments.all %} {% include "attachment_table.html" with attachments=order.attachments.all %}
{% endblock %} {% endblock %}

View File

@ -0,0 +1,35 @@
{% load i18n %}
{% load static %}
{% load inventree_extras %}
<ul class='list-group'>
<li class='list-group-item'>
<a href='#' id='po-menu-toggle'>
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
</a>
</li>
<li class='list-group-item {% if tab == "details" %}active{% endif %}' title='{% trans "Purchase Order Details" %}'>
<a href='{% url "po-detail" order.id %}'>
<span class='fas fa-info-circle'></span>
{% trans "Details" %}
</a>
</li>
<li class='list-group-item {% if tab == "received" %}active{% endif %}' title='{% trans "Received Stock Items" %}'>
<a href='{% url "po-received" order.id %}'>
<span class='fas fa-sign-in-alt'></span>
{% trans "Received Items" %}
</a>
</li>
<li class='list-group-item {% if tab == "attachments" %}active{% endif %}' title='{% trans "Purchase Order Attachments" %}'>
<a href='{% url "po-attachments" order.id %}'>
<span class='fas fa-paperclip'></span>
{% trans "Attachments" %}
</a>
</li>
<li class='list-group-item {% if tab == "notes" %}active{% endif %}' title='{% trans "Notes" %}'>
<a href='{% url "po-notes" order.id %}'>
<span class='fas fa-clipboard'></span>
{% trans "Notes" %}
</a>
</li>
</ul>

View File

@ -4,13 +4,16 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% block menubar %}
{% include 'order/po_navbar.html' with tab='received' %}
{% endblock %}
{% block heading %}
{% trans "Received Items" %}
{% endblock %}
{% block details %} {% block details %}
{% include 'order/po_tabs.html' with tab='received' %}
<h4>{% trans "Received Items" %}</h4>
<hr>
{% include "stock_table.html" with read_only=True %} {% include "stock_table.html" with read_only=True %}
{% endblock %} {% endblock %}

View File

@ -1,20 +0,0 @@
{% load i18n %}
<ul class='nav nav-tabs'>
<li{% ifequal tab 'details' %} class='active'{% endifequal %}>
<a href="{% url 'po-detail' order.id %}">{% trans "Line Items" %}</a>
</li>
<li {% if tab == 'received' %} class='active'{% endif %}>
<a href="{% url 'po-received' order.id %}">{% trans "Received Items" %}</a>
</li>
<li{% if tab == 'attachments' %} class='active'{% endif %}>
<a href="{% url 'po-attachments' order.id %}">{% trans "Attachments" %}
{% if order.attachments.count > 0 %}
<span class='badge'>{{ order.attachments.count }}</span>
{% endif %}
</a>
</li>
<li{% ifequal tab 'notes' %} class='active'{% endifequal %}>
<a href="{% url 'po-notes' order.id %}">{% trans "Notes" %}{% if order.notes %} <span class='fas fa-info-circle'></span>{% endif %}</a>
</li>
</ul>

View File

@ -5,11 +5,18 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% block menubar %}
{% include 'order/po_navbar.html' with tab='details' %}
{% endblock %}
{% block heading %}
{% trans "Purchase Order Items" %}
{% endblock %}
{% block details %} {% block details %}
{% include 'order/po_tabs.html' with tab='details' %}
<hr>
<div id='order-toolbar-buttons' class='btn-group' style='float: right;'> <div id='order-toolbar-buttons' class='btn-group' style='float: right;'>
{% if order.status == PurchaseOrderStatus.PENDING and roles.purchase_order.change %} {% if order.status == PurchaseOrderStatus.PENDING and roles.purchase_order.change %}
@ -18,7 +25,6 @@
{% endif %} {% endif %}
</div> </div>
<h4>{% trans "Purchase Order Items" %}</h4>
<table class='table table-striped table-condensed' id='po-table' data-toolbar='#order-toolbar-buttons'> <table class='table table-striped table-condensed' id='po-table' data-toolbar='#order-toolbar-buttons'>
</table> </table>

View File

@ -6,7 +6,6 @@
<li class='list-group-item'> <li class='list-group-item'>
<a href='#' id='part-menu-toggle'> <a href='#' id='part-menu-toggle'>
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span> <span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
<b>{% trans "Part" %}</b>
</a> </a>
</li> </li>
<li class='list-group-item {% if tab == "details" %}active{% endif %}' title='{% trans "Part Details" %}'> <li class='list-group-item {% if tab == "details" %}active{% endif %}' title='{% trans "Part Details" %}'>

View File

@ -3,34 +3,49 @@
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% block menubar %}
<!-- Custom menubar goes here -->
{% endblock %}
{% block content %} {% block content %}
<div class='row'> <div class='panel panel-default panel-inventree'>
<div class='col-sm-6'>
<div class='media-left'> <div class='row'>
{% block thumbnail %} <div class='col-sm-6'>
<!-- Image goes here --> <div class='media-left'>
{% block thumbnail %}
<!-- Image goes here -->
{% endblock %}
</div>
<div class='media-body'>
{% block page_data %}
<!-- Data next to image goes here -->
{% endblock %}
</div>
</div>
<div class='col-sm-6'>
{% block page_details %}
<!-- Right column data goes here -->
{% endblock %} {% endblock %}
</div> </div>
<div class='media-body'>
{% block page_data %}
<!-- Data next to image goes here -->
{% endblock %}
</div>
</div>
<div class='col-sm-6'>
{% block page_details %}
<!-- Right column data goes here -->
{% endblock %}
</div> </div>
</div> </div>
<hr> <div class='panel panel-default panel-inventree'>
<div class='panel-heading'>
<h4>
{% block heading %}
<!-- Heading goes here -->
{% endblock %}
</h4>
</div>
<div class='container-fluid'> <div class='panel-content'>
{% block details %} {% block details %}
<!-- Particular page detail views go here --> <!-- Particular page detail views go here -->
{% endblock %} {% endblock %}
</div>
</div> </div>
{% endblock %} {% endblock %}