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.super }}
enableRightNavbar({
minWidth: '50px'
});
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
$("#place-order").click(function() {
launchModalForm("{% url 'po-issue' order.id %}",

View File

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

View File

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

View File

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

View File

@ -3,9 +3,15 @@
{% load static %}
{% load i18n %}
{% block menubar %}
<!-- Custom menubar goes here -->
{% endblock %}
{% block content %}
<div class='row'>
<div class='panel panel-default panel-inventree'>
<div class='row'>
<div class='col-sm-6'>
<div class='media-left'>
{% block thumbnail %}
@ -23,14 +29,23 @@
<!-- Right column data goes here -->
{% endblock %}
</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 %}
<!-- Particular page detail views go here -->
{% endblock %}
</div>
</div>
{% endblock %}