From 372958d939a636badc3cc3689ae404961b877f28 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 22 Apr 2020 09:50:10 +1000 Subject: [PATCH] Migrate more pages to the two_column template --- .../templates/company/company_base.html | 4 +- .../templates/company/supplier_part_base.html | 170 ++++---- .../order/templates/order/order_base.html | 205 +++++---- .../templates/order/sales_order_base.html | 164 ++++---- .../stock/templates/stock/item_base.html | 394 +++++++++--------- .../stock/templates/stock/stock_app_base.html | 4 +- InvenTree/templates/two_column.html | 1 - 7 files changed, 457 insertions(+), 485 deletions(-) diff --git a/InvenTree/company/templates/company/company_base.html b/InvenTree/company/templates/company/company_base.html index fdd6abddd9..8e1a743d10 100644 --- a/InvenTree/company/templates/company/company_base.html +++ b/InvenTree/company/templates/company/company_base.html @@ -19,7 +19,9 @@ InvenTree | {% trans "Company" %} - {{ company.name }} {% endblock %} {% block page_data %} -

{{ company.name }}

+

{% trans "Company" %}

+
+

{{ company.name }}

{{ company.description }}

{% if company.is_supplier %} diff --git a/InvenTree/company/templates/company/supplier_part_base.html b/InvenTree/company/templates/company/supplier_part_base.html index 665abbeea2..5083af4f3a 100644 --- a/InvenTree/company/templates/company/supplier_part_base.html +++ b/InvenTree/company/templates/company/supplier_part_base.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "two_column.html" %} {% load static %} {% load i18n %} @@ -6,104 +6,86 @@ InvenTree | {% trans "Supplier Part" %} {% endblock %} -{% block content %} +{% block thumbnail %} + +{% endblock %} -
-
-
-
- -
-
-

{% trans "Supplier Part" %}

-
-
- - -
-
-
-
-
-
-

{% trans "Supplier Part Details" %}

- - - - - - - - {% if part.description %} - - - - - - {% endif %} - {% if part.link %} - - - - - - {% endif %} - - - - - - - - - - {% if part.manufacturer %} - - - - - - - - - - {% endif %} - {% if part.note %} - - - - - - {% endif %} -
{% trans "Internal Part" %} - {% if part.part %} - {{ part.part.full_name }} - {% endif %} -
{% trans "Description" %}{{ part.description }}
{% trans "External Link" %}{{ part.link }}
{% trans "Supplier" %}{{ part.supplier.name }}
{% trans "SKU" %}{{ part.SKU }}
{% trans "Manufacturer" %}{{ part.manufacturer.name }}
{% trans "MPN" %}{{ part.MPN }}
{% trans "Note" %}{{ part.note }}
+{% block page_data %} +

{% trans "Supplier Part" %}

+

{{ part.supplier.name }} - {{ part.SKU }}

+
+
+ +
+{% endblock %} +{% block page_details %} - - - -
- -
- {% block details %} - - {% endblock %} -
- +

{% trans "Supplier Part Details" %}

+ + + + + + + + {% if part.description %} + + + + + + {% endif %} + {% if part.link %} + + + + + + {% endif %} + + + + + + + + + + {% if part.manufacturer %} + + + + + + + + + + {% endif %} + {% if part.note %} + + + + + + {% endif %} +
{% trans "Internal Part" %} + {% if part.part %} + {{ part.part.full_name }} + {% endif %} +
{% trans "Description" %}{{ part.description }}
{% trans "External Link" %}{{ part.link }}
{% trans "Supplier" %}{{ part.supplier.name }}
{% trans "SKU" %}{{ part.SKU }}
{% trans "Manufacturer" %}{{ part.manufacturer.name }}
{% trans "MPN" %}{{ part.MPN }}
{% trans "Note" %}{{ part.note }}
{% endblock %} {% block js_ready %} diff --git a/InvenTree/order/templates/order/order_base.html b/InvenTree/order/templates/order/order_base.html index 7576f061bc..64026f2c5f 100644 --- a/InvenTree/order/templates/order/order_base.html +++ b/InvenTree/order/templates/order/order_base.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "two_column.html" %} {% load i18n %} {% load static %} @@ -9,120 +9,105 @@ InvenTree | {% trans "Purchase Order" %} {% endblock %} -{% block content %} +{% block thumbnail %} + +{% endblock %} -
-
-
-
- -
-
-

{{ order }}

-

{{ order.description }}

-

-

-
- - - {% if order.status == OrderStatus.PENDING and order.lines.count > 0 %} - - {% elif order.status == OrderStatus.PLACED %} - - - {% endif %} - {% if order.status == OrderStatus.PENDING or order.status == OrderStatus.PLACED %} - - {% endif %} -
-
-

-
+{% block page_data %} +

{% trans "Purchase Order" %}

+
+

{{ order }}

+

{{ order.description }}

+

+

+
+ + + {% if order.status == OrderStatus.PENDING and order.lines.count > 0 %} + + {% elif order.status == OrderStatus.PLACED %} + + + {% endif %} + {% if order.status == OrderStatus.PENDING or order.status == OrderStatus.PLACED %} + + {% endif %}
-
-

{% trans "Purchase Order Details" %}

- - - - - - - - - - - - - - - - - - {% if order.supplier_reference %} - - - - - - {% endif %} - {% if order.link %} - - - - - - {% endif %} - - - - - - {% if order.issue_date %} - - - - - - {% endif %} - {% if order.status == OrderStatus.COMPLETE %} - - - - - - {% endif %} -
{% trans "Order Reference" %}{{ order.reference }}
{% trans "Order Status" %}{% order_status order.status %}
{% trans "Supplier" %}{{ order.supplier.name }}
{% trans "Supplier Reference" %}{{ order.supplier_reference }}
External Link{{ order.link }}
{% trans "Created" %}{{ order.creation_date }}{{ order.created_by }}
{% trans "Issued" %}{{ order.issue_date }}
{% trans "Received" %}{{ order.complete_date }}{{ order.received_by }}
-
-
- -
-
-{% block details %} - - - +

{% endblock %} -
+{% block page_details %} +

{% trans "Purchase Order Details" %}

+ + + + + + + + + + + + + + + + + + {% if order.supplier_reference %} + + + + + + {% endif %} + {% if order.link %} + + + + + + {% endif %} + + + + + + {% if order.issue_date %} + + + + + + {% endif %} + {% if order.status == OrderStatus.COMPLETE %} + + + + + + {% endif %} +
{% trans "Order Reference" %}{{ order.reference }}
{% trans "Order Status" %}{% order_status order.status %}
{% trans "Supplier" %}{{ order.supplier.name }}
{% trans "Supplier Reference" %}{{ order.supplier_reference }}
External Link{{ order.link }}
{% trans "Created" %}{{ order.creation_date }}{{ order.created_by }}
{% trans "Issued" %}{{ order.issue_date }}
{% trans "Received" %}{{ order.complete_date }}{{ order.received_by }}
{% endblock %} {% block js_ready %} diff --git a/InvenTree/order/templates/order/sales_order_base.html b/InvenTree/order/templates/order/sales_order_base.html index ed8be4256b..98faadb1f4 100644 --- a/InvenTree/order/templates/order/sales_order_base.html +++ b/InvenTree/order/templates/order/sales_order_base.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "two_column.html" %} {% load i18n %} {% load static %} @@ -9,99 +9,83 @@ InvenTree | {% trans "Sales Order" %} {% endblock %} -{% block content %} - - -
-
-
-
- -
-
-

{{ order }}

-

{{ order.description }}

-

-

-
- -
-
-

-
-
-
-
-

{% trans "Sales Order Details" %}

- - - - - - - - - - - - - - - - - - {% if order.customer_reference %} - - - - - - {% endif %} - {% if order.link %} - - - - - - {% endif %} - - - - - - {% if order.issue_date %} - - - - - - {% endif %} - {% if order.status == OrderStatus.COMPLETE %} - - - - - - {% endif %} -
{% trans "Order Reference" %}{{ order.reference }}
{% trans "Order Status" %}{% order_status order.status %}
{% trans "Customer" %}{{ order.customer.name }}
{% trans "Customer Reference" %}{{ order.customer_reference }}
External Link{{ order.link }}
{% trans "Created" %}{{ order.creation_date }}{{ order.created_by }}
{% trans "Issued" %}{{ order.issue_date }}
{% trans "Received" %}{{ order.complete_date }}{{ order.received_by }}
-
-
+{% block thumbnail %} + +{% endblock %} +{% block page_data %} +

{% trans "Sales Order" %}


-
- {% block details %} - - {% endblock %} +

{{ order }}

+

{{ order.description }}

+
+
+ +
+{% endblock %} +{% block page_details %} +

{% trans "Sales Order Details" %}

+ + + + + + + + + + + + + + + + + + {% if order.customer_reference %} + + + + + + {% endif %} + {% if order.link %} + + + + + + {% endif %} + + + + + + {% if order.issue_date %} + + + + + + {% endif %} + {% if order.status == OrderStatus.COMPLETE %} + + + + + + {% endif %} +
{% trans "Order Reference" %}{{ order.reference }}
{% trans "Order Status" %}{% order_status order.status %}
{% trans "Customer" %}{{ order.customer.name }}
{% trans "Customer Reference" %}{{ order.customer_reference }}
External Link{{ order.link }}
{% trans "Created" %}{{ order.creation_date }}{{ order.created_by }}
{% trans "Issued" %}{{ order.issue_date }}
{% trans "Received" %}{{ order.complete_date }}{{ order.received_by }}
{% endblock %} {% block js_ready %} diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index bcb6de9af8..da002c2ac9 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -1,9 +1,19 @@ -{% extends "stock/stock_app_base.html" %} +{% extends "two_column.html" %} {% load static %} {% load inventree_extras %} {% load status_codes %} {% load i18n %} -{% block content %} + +{% block page_title %} +InvenTree | {% trans "Stock Item" %} - {{ item }} +{% endblock %} + +{% block sidenav %} +
+{% endblock %} + +{% block pre_content %} +{% include 'stock/loc_link.html' with location=item.location %} {% if item.sales_order_line %}
@@ -12,200 +22,212 @@
{% endif %} -
-
-

{% trans "Stock Item Details" %}

- {% if item.serialized %} -

{{ item.part.full_name}} # {{ item.serial }}

- {% else %} -

{% decimal item.quantity %} × {{ item.part.full_name }}

- {% endif %} -

-

- {% include "qr_button.html" %} - {% if item.in_stock %} - {% if not item.serialized %} - - - - {% if item.part.trackable %} - - {% endif %} - {% endif %} - - - {% endif %} - - {% if item.can_delete %} - - {% endif %} -
-

- {% if item.serialized %} -
- {% trans "This stock item is serialized - it has a unique serial number and the quantity cannot be adjusted." %} -
- {% elif item.child_count > 0 %} -
- {% trans "This stock item cannot be deleted as it has child items" %} -
- {% elif item.delete_on_deplete %} -
- {% trans "This stock item will be automatically deleted when all stock is depleted." %} -
- {% endif %} - {% if item.parent %} -
- {% trans "This stock item was split from " %}{{ item.parent }} -
- {% endif %} -
- -
-
- - - - - - - - {% if item.belongs_to %} - - - - - - {% elif item.location %} - - - - - - {% endif %} - {% if item.uid %} - - - - - - {% endif %} - {% if item.serialized %} - - - - - - {% else %} - - - - - - {% endif %} - {% if item.batch %} - - - - - - {% endif %} - {% if item.build %} - - - - - - {% endif %} - {% if item.purchase_order %} - - - - - - {% endif %} - {% if item.customer %} - - - - - - {% endif %} - {% if item.link %} - - - - - {% endif %} - {% if item.supplier_part %} - - - - - - - - - - - {% endif %} - - - - - - - - - {% if item.stocktake_date %} - - {% else %} - - {% endif %} - - - - - - -
Part - {% include "hover_image.html" with image=item.part.image hover=True %} - {{ item.part.full_name }} -
{% trans "Belongs To" %}{{ item.belongs_to }}
{% trans "Location" %}{{ item.location.name }}
{% trans "Unique Identifier" %}{{ item.uid }}
{% trans "Serial Number" %}{{ item.serial }}
{% trans "Quantity" %}{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}
{% trans "Batch" %}{{ item.batch }}
{% trans "Build" %}{{ item.build }}
{% trans "Purchase Order" %}{{ item.purchase_order }}
{% trans "Customer" %}{{ item.customer.name }}
- {% trans "External Link" %}{{ item.link }}
{% trans "Supplier" %}{{ item.supplier_part.supplier.name }}
{% trans "Supplier Part" %}{{ item.supplier_part.SKU }}
{% trans "Last Updated" %}{{ item.updated }}
{% trans "Last Stocktake" %}{{ item.stocktake_date }} {{ item.stocktake_user }}{% trans "No stocktake performed" %}
{% trans "Status" %}{% stock_status item.status %}
-
-
+{% if item.serialized %} +
+ {% trans "This stock item is serialized - it has a unique serial number and the quantity cannot be adjusted." %} +
+{% elif item.child_count > 0 %} +
+ {% trans "This stock item cannot be deleted as it has child items" %} +
+{% elif item.delete_on_deplete %} +
+ {% trans "This stock item will be automatically deleted when all stock is depleted." %} +
+{% endif %} +{% if item.parent %} +
+ {% trans "This stock item was split from " %}{{ item.parent }} +
+{% endif %} - -
-
-{% block details %} - {% endblock %} + +{% block thumbnail %} + +{% endblock %} + +{% block page_data %} +

{% trans "Stock Item" %}

+
+

+{% if item.serialized %} +{{ item.part.full_name}} # {{ item.serial }} +{% else %} +{% decimal item.quantity %} × {{ item.part.full_name }} +{% endif %} +

+ +
+ {% include "qr_button.html" %} + {% if item.in_stock %} + {% if not item.serialized %} + + + + {% if item.part.trackable %} + + {% endif %} + {% endif %} + + + {% endif %} + + {% if item.can_delete %} + + {% endif %}
{% endblock %} +{% block page_details %} +

{% trans "Stock Item Details" %}

+ + + + + + + + {% if item.belongs_to %} + + + + + + {% elif item.location %} + + + + + + {% endif %} + {% if item.uid %} + + + + + + {% endif %} + {% if item.serialized %} + + + + + + {% else %} + + + + + + {% endif %} + {% if item.batch %} + + + + + + {% endif %} + {% if item.build %} + + + + + + {% endif %} + {% if item.purchase_order %} + + + + + + {% endif %} + {% if item.customer %} + + + + + + {% endif %} + {% if item.link %} + + + + + {% endif %} + {% if item.supplier_part %} + + + + + + + + + + + {% endif %} + + + + + + + + + {% if item.stocktake_date %} + + {% else %} + + {% endif %} + + + + + + +
Part + {% include "hover_image.html" with image=item.part.image hover=True %} + {{ item.part.full_name }} +
{% trans "Belongs To" %}{{ item.belongs_to }}
{% trans "Location" %}{{ item.location.name }}
{% trans "Unique Identifier" %}{{ item.uid }}
{% trans "Serial Number" %}{{ item.serial }}
{% trans "Quantity" %}{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}
{% trans "Batch" %}{{ item.batch }}
{% trans "Build" %}{{ item.build }}
{% trans "Purchase Order" %}{{ item.purchase_order }}
{% trans "Customer" %}{{ item.customer.name }}
+ {% trans "External Link" %}{{ item.link }}
{% trans "Supplier" %}{{ item.supplier_part.supplier.name }}
{% trans "Supplier Part" %}{{ item.supplier_part.SKU }}
{% trans "Last Updated" %}{{ item.updated }}
{% trans "Last Stocktake" %}{{ item.stocktake_date }} {{ item.stocktake_user }}{% trans "No stocktake performed" %}
{% trans "Status" %}{% stock_status item.status %}
+{% endblock %} + {% block js_ready %} {{ block.super }} +loadTree("{% url 'api-stock-tree' %}", + "#stock-tree", + { + name: 'stock', + } + ); + + $("#toggle-stock-tree").click(function() { + toggleSideNav("#sidenav"); + return false; + }) + + initSideNav(); + $("#stock-serialize").click(function() { launchModalForm( "{% url 'stock-item-serialize' item.id %}", diff --git a/InvenTree/stock/templates/stock/stock_app_base.html b/InvenTree/stock/templates/stock/stock_app_base.html index 8f5f051003..7f31ac21b0 100644 --- a/InvenTree/stock/templates/stock/stock_app_base.html +++ b/InvenTree/stock/templates/stock/stock_app_base.html @@ -3,9 +3,7 @@ {% load i18n %} {% block page_title %} -{% if item %} -InvenTree | {% trans "Stock Item" %} - {{ item }} -{% elif location %} +{% if location %} InvenTree | {% trans "Stock Location" %} - {{ location }} {% else %} InvenTree | Stock diff --git a/InvenTree/templates/two_column.html b/InvenTree/templates/two_column.html index 0aa3b441e2..1c90887b3c 100644 --- a/InvenTree/templates/two_column.html +++ b/InvenTree/templates/two_column.html @@ -17,7 +17,6 @@ {% endblock %}
-
{% block page_details %}