From c04118ed8ac8afd650585a14db4975f516f5fcf2 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 29 Oct 2021 22:20:06 +1100 Subject: [PATCH] Driving the refactor tractor around the farm --- InvenTree/build/templates/build/detail.html | 51 +++++++++------ InvenTree/build/templates/build/index.html | 47 +++++++------- .../company/templates/company/detail.html | 52 ++++++++++----- .../company/templates/company/index.html | 33 ++++++---- .../templates/company/manufacturer_part.html | 30 ++++++--- .../templates/company/supplier_part.html | 39 +++++++---- .../order/purchase_order_detail.html | 35 +++++----- .../templates/order/purchase_orders.html | 64 ++++++++++-------- .../templates/order/sales_order_base.html | 2 +- .../templates/order/sales_order_detail.html | 19 ++++-- .../order/templates/order/sales_orders.html | 65 ++++++++++--------- InvenTree/part/templates/part/bom.html | 12 ++-- InvenTree/part/templates/part/category.html | 25 ++++--- InvenTree/part/templates/part/detail.html | 4 +- InvenTree/templates/page_base.html | 8 ++- InvenTree/templates/spacer.html | 1 + 16 files changed, 287 insertions(+), 200 deletions(-) create mode 100644 InvenTree/templates/spacer.html diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index 20424e3fd2..f2a16613b8 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -170,24 +170,29 @@
-

{% trans "Allocate Stock to Build" %}

+
+

{% trans "Allocate Stock to Build" %}

+ {% include "spacer.html" %} +
+ {% if build.active and build.has_untracked_bom_items %} + + + + {% endif %} +
+
{% if build.has_untracked_bom_items %} {% if build.active %} -
- - - -
{% if build.areUntrackedPartsFullyAllocated %}
{% trans "Untracked stock has been fully allocated for this Build Order" %} @@ -221,23 +226,31 @@
-

{% trans "Incomplete Build Outputs" %}

+
+

{% trans "Incomplete Build Outputs" %}

+ {% include "spacer.html" %} +
+ {% if build.active %} + + {% endif %} +
+
{% if build.active %} diff --git a/InvenTree/build/templates/build/index.html b/InvenTree/build/templates/build/index.html index f0346b7984..01970c45aa 100644 --- a/InvenTree/build/templates/build/index.html +++ b/InvenTree/build/templates/build/index.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "page_base.html" %} {% load inventree_extras %} {% load static %} @@ -8,33 +8,32 @@ {% inventree_title %} | {% trans "Build Orders" %} {% endblock %} -{% block content %} +{% block heading %} +{% trans "Build Orders" %} +{% endblock %} -
-
-

{% trans "Build Orders" %}

-
-
+{% block actions %} +{% if roles.build.add %} + +{% endif %} +{% endblock %} -
- -
+{% block page_info %} +
-
- {% if roles.build.add %} - - {% endif %} -
+
+ +
+ + +
+ +
- - -
- -
- + {% endblock %} {% block js_load %} diff --git a/InvenTree/company/templates/company/detail.html b/InvenTree/company/templates/company/detail.html index 5f2c144c2a..6aec397e47 100644 --- a/InvenTree/company/templates/company/detail.html +++ b/InvenTree/company/templates/company/detail.html @@ -11,18 +11,23 @@
-

{% trans "Supplier Parts" %}

+
+

{% trans "Supplier Parts" %}

+ {% include "spacer.html" %} +
+ {% if roles.purchase_order.add %} + + {% endif %} +
+
{% if roles.purchase_order.change %}
- {% if roles.purchase_order.add %} - - {% endif %}
+ {% endif %} +
+
- {% if roles.purchase_order.add %}
-
- {% endif %}
@@ -129,21 +140,26 @@
-

{% trans "Sales Orders" %}

-
-
- {% if roles.sales_order.add %} -
-
+
+

{% trans "Sales Orders" %}

+ {% include "spacer.html" %} +
+ {% if roles.sales_order.add %} + {% endif %} +
+
+
+
+
+
- {% endif %}
diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index 672d82fdb7..1654ab04b5 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "page_base.html" %} {% load static %} {% load i18n %} @@ -8,23 +8,28 @@ {% inventree_title %} | {% trans "Supplier List" %} {% endblock %} -{% block content %} - -

{{ title }}

-
+{% block heading %} +{{ title }} +{% endblock %} +{% block actions %} {% if pagetype == 'manufacturers' and roles.purchase_order.add or pagetype == 'suppliers' and roles.purchase_order.add or pagetype == 'customers' and roles.sales_order.add %} -
- -
-
-
+ {% endif %} +{% endblock %} - -
+{% block page_info %} + +
+ +
+
+ + +
+
{% endblock %} {% block js_ready %} diff --git a/InvenTree/company/templates/company/manufacturer_part.html b/InvenTree/company/templates/company/manufacturer_part.html index 09affcfd11..dad72e5558 100644 --- a/InvenTree/company/templates/company/manufacturer_part.html +++ b/InvenTree/company/templates/company/manufacturer_part.html @@ -104,18 +104,23 @@ src="{% static 'img/blank_image.png' %}"
-

{% trans "Suppliers" %}

+
+

{% trans "Suppliers" %}

+ {% include "spacer.html" %} +
+ +
+
-
@@ -128,18 +133,23 @@ src="{% static 'img/blank_image.png' %}"
-

{% trans "Parameters" %}

+
+

{% trans "Parameters" %}

+ {% include "spacer.html" %} +
+ +
+
-
diff --git a/InvenTree/company/templates/company/supplier_part.html b/InvenTree/company/templates/company/supplier_part.html index 1450ac4c35..2f68f9b12b 100644 --- a/InvenTree/company/templates/company/supplier_part.html +++ b/InvenTree/company/templates/company/supplier_part.html @@ -143,17 +143,23 @@ src="{% static 'img/blank_image.png' %}"
-

{% trans "Supplier Part Orders" %}

-
-
- {% if roles.purchase_order.add %} -
-
+
+

{% trans "Supplier Part Orders" %}

+ {% include "spacer.html" %} +
+ {% if roles.purchase_order.add %} + {% trans "Order Part" %} + + {% endif %} +
+
+
+
+
+
- {% endif %}
@@ -161,16 +167,21 @@ src="{% static 'img/blank_image.png' %}"
-

{% trans "Pricing Information" %}

+
+

{% trans "Pricing Information" %}

+ {% include "spacer.html" %} +
+ {% if roles.purchase_order.add %} + + {% endif %} +
+
- {% if roles.purchase_order.add %}
-
- {% endif %}
diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index 347d6b7389..c57d88fe57 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -14,24 +14,29 @@
-

{% trans "Purchase Order Items" %}

+
+

{% trans "Purchase Order Items" %}

+ {% include "spacer.html" %} +
+ {% if roles.purchase_order.change %} + {% if order.status == PurchaseOrderStatus.PENDING %} + + {% trans "Upload File" %} + + + {% elif order.status == PurchaseOrderStatus.PLACED %} + + {% endif %} + {% endif %} +
+
- {% if roles.purchase_order.change %} - {% if order.status == PurchaseOrderStatus.PENDING %} - - - {% trans "Upload File" %} - - {% elif order.status == PurchaseOrderStatus.PLACED %} - - {% endif %} - {% endif %}
diff --git a/InvenTree/order/templates/order/purchase_orders.html b/InvenTree/order/templates/order/purchase_orders.html index cf509a68d2..4be817f8d2 100644 --- a/InvenTree/order/templates/order/purchase_orders.html +++ b/InvenTree/order/templates/order/purchase_orders.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "page_base.html" %} {% load inventree_extras %} {% load static %} @@ -8,40 +8,48 @@ {% inventree_title %} | {% trans "Purchase Orders" %} {% endblock %} -{% block content %} +{% block heading %} +{% trans "Purchase Orders" %} +{% endblock %} -

{% trans "Purchase Orders" %}

-
+{% block actions %} +{% if roles.purchase_order.add %} + +{% endif %} +{% endblock %} -
-
-
- {% if roles.purchase_order.add %} - - {% endif %} - - - -
- +{% block page_info %} + +
+
+
+
+ + + + +
+ +
+ + +
+ +
+
- -
- -
- {% endblock %} {% block js_load %} diff --git a/InvenTree/order/templates/order/sales_order_base.html b/InvenTree/order/templates/order/sales_order_base.html index 6200df1183..42a09e8ede 100644 --- a/InvenTree/order/templates/order/sales_order_base.html +++ b/InvenTree/order/templates/order/sales_order_base.html @@ -42,7 +42,7 @@ src="{% static 'img/blank_image.png' %}"
  • {% trans "Print sales order report" %}
  • {% trans "Export order to file" %}
  • diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index e890c7caab..e5f047b520 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -14,20 +14,25 @@
    -

    {% trans "Sales Order Items" %}

    -
    -
    - {% if roles.sales_order.change %} -
    -
    +
    +

    {% trans "Sales Order Items" %}

    + {% include "spacer.html" %} +
    + {% if roles.sales_order.change %} + {% endif %} +
    +
    +
    +
    +
    +
    - {% endif %}
    diff --git a/InvenTree/order/templates/order/sales_orders.html b/InvenTree/order/templates/order/sales_orders.html index a4d4d27280..048296c16b 100644 --- a/InvenTree/order/templates/order/sales_orders.html +++ b/InvenTree/order/templates/order/sales_orders.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "page_base.html" %} {% load inventree_extras %} {% load static %} @@ -11,40 +11,47 @@ {% block breadcrumb_list %} {% endblock %} -{% block content %} +{% block heading %} +{% trans "Sales Orders" %} +{% endblock %} -

    {% trans "Sales Orders" %}

    -
    +{% block actions %} +{% if roles.sales_order.add %} + +{% endif %} +{% endblock %} -
    -
    -
    - {% if roles.sales_order.add %} - - {% endif %} - - - -
    - +{% block page_info %} + +
    +
    +
    +
    + + + + +
    + +
    + + +
    + +
    - - -
    - -
    - + {% endblock %} {% block js_load %} diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html index 89cacd7c3c..f245ff0102 100644 --- a/InvenTree/part/templates/part/bom.html +++ b/InvenTree/part/templates/part/bom.html @@ -30,8 +30,8 @@
    {% if roles.part.change %} @@ -41,14 +41,14 @@
    {% endif %} {% endblock %} @@ -116,19 +116,24 @@
    -

    {% trans "Parts" %}

    +
    +

    {% trans "Parts" %}

    + {% include "spacer.html" %} +
    + {% if roles.part.add %} + + {% endif %} +
    +
    - - {% if roles.part.add %} - - {% endif %}
    + diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index b62058aa1f..638482f9e3 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -373,7 +373,7 @@
    @@ -396,7 +396,7 @@
    diff --git a/InvenTree/templates/page_base.html b/InvenTree/templates/page_base.html index 92130ea7a3..fc00fb1f7f 100644 --- a/InvenTree/templates/page_base.html +++ b/InvenTree/templates/page_base.html @@ -13,7 +13,7 @@ -- page header goes here -- {% endblock %} - + {% include "spacer.html" %}
    {% block actions %} -- actions go here -- @@ -21,6 +21,8 @@
    + + {% block page_info %}
    @@ -48,11 +50,11 @@
    + {% endblock %} +
    - {% block page_content %} -block page_content {% endblock %} {% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/spacer.html b/InvenTree/templates/spacer.html new file mode 100644 index 0000000000..ca2342cd28 --- /dev/null +++ b/InvenTree/templates/spacer.html @@ -0,0 +1 @@ + \ No newline at end of file