From a1c4662e9148eec05d24ea9c1317430f7a8035bb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 18 May 2021 19:11:37 +1000 Subject: [PATCH] Move status messages for stock item --- InvenTree/InvenTree/static/css/inventree.css | 8 ++ .../stock/templates/stock/item_base.html | 129 +++++++++--------- InvenTree/templates/two_column.html | 2 + 3 files changed, 77 insertions(+), 62 deletions(-) diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index e3191405d9..5271a9b362 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -901,6 +901,14 @@ input[type="submit"] { color: #e00; } +.info-messages { + padding: 5px; +} + +.info-messages .alert { + padding: 5px; +} + .part-allocation { padding: 3px 10px; border: 1px solid #ccc; diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index 54d6b12e4f..da770bab48 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -14,68 +14,6 @@ {% block pre_content %} {% include 'stock/loc_link.html' with location=item.location %} - -{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} -{% if owner_control.value == "True" %} - {% authorized_owners item.owner as owners %} - - {% if not user in owners and not user.is_superuser %} -
- {% trans "You are not in the list of owners of this item. This stock item cannot be edited." %}
-
- {% endif %} -{% endif %} - -{% if item.is_building %} -
- {% trans "This stock item is in production and cannot be edited." %}
- {% trans "Edit the stock item from the build view." %}
- - {% if item.build %} - - {{ item.build }} - - {% endif %} - -
-{% endif %} - -{% if item.hasRequiredTests and not item.passedAllRequiredTests %} -
- {% trans "This stock item has not passed all required tests" %} -
-{% endif %} - -{% for allocation in item.sales_order_allocations.all %} -
- {% object_link 'so-detail' allocation.line.order.id allocation.line.order as link %} - {% decimal allocation.quantity as qty %} - {% blocktrans %}This stock item is allocated to Sales Order {{ link }} (Quantity: {{ qty }}){% endblocktrans %} -
-{% endfor %} - -{% for allocation in item.allocations.all %} -
- {% object_link 'build-detail' allocation.build.id allocation.build %} - {% decimal allocation.quantity as qty %} - {% blocktrans %}This stock item is allocated to Build {{ link }} (Quantity: {{ qty }}){% endblocktrans %} -
-{% endfor %} - -{% 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 and item.can_delete %} -
- {% trans "This stock item will be automatically deleted when all stock is depleted." %} -
-{% endif %} - {% endblock %} {% block thumbnail %} @@ -221,6 +159,73 @@ {% endblock %} +{% block below_thumbnail %} +
+ + {% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} + {% if owner_control.value == "True" %} + {% authorized_owners item.owner as owners %} + + {% if not user in owners and not user.is_superuser %} +
+ {% trans "You are not in the list of owners of this item. This stock item cannot be edited." %}
+
+ {% endif %} + {% endif %} + + {% if item.is_building %} +
+ {% trans "This stock item is in production and cannot be edited." %}
+ {% trans "Edit the stock item from the build view." %}
+ + {% if item.build %} + + {{ item.build }} + + {% endif %} + +
+ {% endif %} + + {% if item.hasRequiredTests and not item.passedAllRequiredTests %} +
+ {% trans "This stock item has not passed all required tests" %} +
+ {% endif %} + + {% for allocation in item.sales_order_allocations.all %} +
+ {% object_link 'so-detail' allocation.line.order.id allocation.line.order as link %} + {% decimal allocation.quantity as qty %} + {% blocktrans %}This stock item is allocated to Sales Order {{ link }} (Quantity: {{ qty }}){% endblocktrans %} +
+ {% endfor %} + + {% for allocation in item.allocations.all %} +
+ {% object_link 'build-detail' allocation.build.id allocation.build %} + {% decimal allocation.quantity as qty %} + {% blocktrans %}This stock item is allocated to Build {{ link }} (Quantity: {{ qty }}){% endblocktrans %} +
+ {% endfor %} + + {% 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 and item.can_delete %} +
+ {% trans "This stock item will be automatically deleted when all stock is depleted." %} +
+ {% endif %} + +
+{% endblock %} + {% block page_details %}

{% trans "Stock Item Details" %}

diff --git a/InvenTree/templates/two_column.html b/InvenTree/templates/two_column.html index ce91dcfffb..1eb1b5388e 100644 --- a/InvenTree/templates/two_column.html +++ b/InvenTree/templates/two_column.html @@ -27,6 +27,8 @@ {% endblock %} + {% block below_thumbnail %} + {% endblock %}
{% block page_details %}