From c0e66dd9a015d7a7aee3552c9cda14388056a6e4 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 18 Jun 2019 23:56:00 +1000 Subject: [PATCH 1/6] Added pretty buttons to stock item page --- .../order/purchase_order_detail.html | 11 ++--- .../part/templates/part/partial_delete.html | 4 +- InvenTree/stock/templates/stock/item.html | 49 ++++++++++--------- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index a0b780408c..99694f430f 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -62,6 +62,9 @@ InvenTree | {{ order }}
+ {% if order.status == OrderStatus.PENDING %} + + {% endif %} {% if order.status == OrderStatus.PENDING and order.lines.count > 0 %} @@ -73,10 +76,6 @@ InvenTree | {{ order }}

Order Items

-{% if order.status == OrderStatus.PENDING %} - -{% endif %} - @@ -122,10 +121,10 @@ InvenTree | {{ order }} {% if order.status == OrderStatus.PENDING %} {% endif %} {% if item.supplier_part %} + + + + @@ -134,7 +135,7 @@ {% block js_ready %} {{ block.super }} - $("#duplicate-item").click(function() { + $("#stock-duplicate").click(function() { launchModalForm( "{% url 'stock-item-create' %}", { From 7effe3af9d325f43c9922b8aa78c8dd0ae5579fb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 19 Jun 2019 00:01:30 +1000 Subject: [PATCH 2/6] Add buttons to company page --- .../templates/company/company_base.html | 24 +++++++++++++ .../company/templates/company/detail.html | 35 ++----------------- 2 files changed, 26 insertions(+), 33 deletions(-) diff --git a/InvenTree/company/templates/company/company_base.html b/InvenTree/company/templates/company/company_base.html index 6de8d83bbb..26acdb159b 100644 --- a/InvenTree/company/templates/company/company_base.html +++ b/InvenTree/company/templates/company/company_base.html @@ -24,6 +24,14 @@ InvenTree | Company - {{ company.name }}

{{ company.name }}

{{ company.description }}

+
+ + +
@@ -77,6 +85,22 @@ InvenTree | Company - {{ company.name }} {% block js_ready %} + $('#company-edit').click(function() { + launchModalForm( + "{% url 'company-edit' company.id %}", + { + reload: true + }); + }); + + $('#company-delete').click(function() { + launchModalForm( + "{% url 'company-delete' company.id %}", + { + redirect: "{% url 'company-index' %}" + }); + }); + enableDragAndDrop( "#company-thumb", "{% url 'company-image' company.id %}", diff --git a/InvenTree/company/templates/company/detail.html b/InvenTree/company/templates/company/detail.html index fa40913f98..52a0ec6b78 100644 --- a/InvenTree/company/templates/company/detail.html +++ b/InvenTree/company/templates/company/detail.html @@ -4,24 +4,7 @@ {% include 'company/tabs.html' with tab='details' %} -
-
-

Company Details

-
-
-

- -

-
-
- +

Company Details


- -
diff --git a/InvenTree/part/templates/part/partial_delete.html b/InvenTree/part/templates/part/partial_delete.html index baa429e2a5..b6516057bb 100644 --- a/InvenTree/part/templates/part/partial_delete.html +++ b/InvenTree/part/templates/part/partial_delete.html @@ -2,7 +2,9 @@ {% block pre_form_content %} -Are you sure you want to delete part '{{ part.full_name }}'? +
+ Are you sure you want to delete part '{{ part.full_name }}'? +
{% if part.used_in_count %}
diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index 7300855389..02287d8669 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -9,32 +9,29 @@

{% include "qr_button.html" %} + {% if item.in_stock %} + + + + + {% endif %} + +

-
-

-
- -
-

-
-
@@ -90,6 +87,10 @@
Supplier{{ item.supplier_part.supplier.name }}
Supplier Part {{ item.supplier_part.SKU }}
@@ -45,19 +28,5 @@ {% endblock %} {% block js_ready %} {{ block.super }} - $('#edit-company').click(function() { - launchModalForm( - "{% url 'company-edit' company.id %}", - { - reload: true - }); - }); - - $('#delete-company').click(function() { - launchModalForm( - "{% url 'company-delete' company.id %}", - { - redirect: "{% url 'company-index' %}" - }); - }); + {% endblock %} \ No newline at end of file From 3e6cdb15bedf0680ba5b4179e8f5f84b1461d1eb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 19 Jun 2019 07:48:05 +1000 Subject: [PATCH 3/6] Clean up display of company pages - Add some more buttons - visual style consolidation --- .../templates/company/company_base.html | 9 ++++-- .../templates/company/detail_part.html | 2 ++ .../company/detail_purchase_orders.html | 29 ++++++++++++++----- .../templates/company/detail_stock.html | 2 ++ InvenTree/order/templates/order/po_table.html | 12 +++++--- InvenTree/static/css/inventree.css | 4 +++ 6 files changed, 44 insertions(+), 14 deletions(-) diff --git a/InvenTree/company/templates/company/company_base.html b/InvenTree/company/templates/company/company_base.html index 26acdb159b..2c1efbb7e5 100644 --- a/InvenTree/company/templates/company/company_base.html +++ b/InvenTree/company/templates/company/company_base.html @@ -25,11 +25,16 @@ InvenTree | Company - {{ company.name }}

{{ company.name }}

{{ company.description }}

+ {% if company.is_supplier %} + + {% endif %} -
diff --git a/InvenTree/company/templates/company/detail_part.html b/InvenTree/company/templates/company/detail_part.html index d0ec6ce66a..d6aa0697ee 100644 --- a/InvenTree/company/templates/company/detail_part.html +++ b/InvenTree/company/templates/company/detail_part.html @@ -6,6 +6,8 @@

Supplier Parts

+
+
+
+ - - - + + + + + {% for order in orders %} @@ -15,4 +18,5 @@ {% endfor %} +
CompanyOrder ReferenceDescriptionCompanyOrder ReferenceDescription Status Items
{% include "hover_image.html" with image=order.supplier.image hover=True %}{{ order.supplier.name }}{{ order.lines.count }}
\ No newline at end of file diff --git a/InvenTree/static/css/inventree.css b/InvenTree/static/css/inventree.css index e4ebd182ee..1b9caaa891 100644 --- a/InvenTree/static/css/inventree.css +++ b/InvenTree/static/css/inventree.css @@ -158,6 +158,10 @@ .navigation { } +.nav-tabs { + margin-bottom: 20px; +} + .breadcrump { margin-bottom: 5px; } From afcbd73026cbd1b247255638e3eec01f9941664b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 19 Jun 2019 07:58:14 +1000 Subject: [PATCH 4/6] Consolidate visual style for "Part" tabs --- .../order/order_wizard/select_parts.html | 2 +- .../part/templates/part/attachments.html | 63 ++++++++++--------- InvenTree/part/templates/part/detail.html | 6 +- InvenTree/part/templates/part/orders.html | 31 +++++++-- InvenTree/part/templates/part/stock.html | 8 +-- InvenTree/part/templates/part/supplier.html | 9 +-- InvenTree/part/templates/part/tabs.html | 4 +- InvenTree/part/templates/part/used_in.html | 10 +-- 8 files changed, 69 insertions(+), 64 deletions(-) diff --git a/InvenTree/order/templates/order/order_wizard/select_parts.html b/InvenTree/order/templates/order/order_wizard/select_parts.html index f8ed6e2a93..b872e5aa71 100644 --- a/InvenTree/order/templates/order/order_wizard/select_parts.html +++ b/InvenTree/order/templates/order/order_wizard/select_parts.html @@ -3,7 +3,7 @@ {% block form %}

- Step 1 of 2 - Select Parts + Step 1 of 2 - Select Part Suppliers

{% if parts|length > 0 %} diff --git a/InvenTree/part/templates/part/attachments.html b/InvenTree/part/templates/part/attachments.html index 493002d2f0..882d9aee8d 100644 --- a/InvenTree/part/templates/part/attachments.html +++ b/InvenTree/part/templates/part/attachments.html @@ -5,37 +5,39 @@ {% include 'part/tabs.html' with tab='attachments' %} -
-
-

Part Attachments

-
-
-
- -
-
-
+

Part Attachments


- - - - - - -{% for attachment in part.attachments.all %} - - - - - -{% endfor %} +
+
+ +
+
+ + +
FileComment
{{ attachment.basename }}{{ attachment.comment }} -
- - -
-
+ + + + + + + + + {% for attachment in part.attachments.all %} + + + + + + {% endfor %} + {% if part.variant_of and part.variant_of.attachments.count > 0 %}
FileComment
{{ attachment.basename }}{{ attachment.comment }} +
+ + +
+
@@ -83,4 +85,9 @@ }); }); + $("#attachment-table").bootstrapTable({ + search: true, + sortable: true, + }); + {% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index ef47e70515..68ae0ed3bd 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -4,9 +4,12 @@ {% include 'part/tabs.html' with tab='detail' %} +

Part Details

+ +
+
-

Part Details

@@ -75,7 +78,6 @@
Part name
-

Part Type

diff --git a/InvenTree/part/templates/part/orders.html b/InvenTree/part/templates/part/orders.html index 8c9f0c3cee..975a41049a 100644 --- a/InvenTree/part/templates/part/orders.html +++ b/InvenTree/part/templates/part/orders.html @@ -5,19 +5,38 @@ {% include 'part/tabs.html' with tab='orders' %} -
-
-

Open Part Orders

-
-
+

Part Orders

+
+ +
+
+
-{% include "order/po_table.html" with orders=part.open_purchase_orders %} +{% include "order/po_table.html" with orders=part.open_purchase_orders toolbar='#button-bar' %} {% if part.closed_purchase_orders|length > 0 %}

Closed Orders

{% include "order/po_table.html" with orders=part.closed_purchase_orders %} {% endif %} +{% endblock %} + +{% block js_ready %} +{{ block.super }} + +$("#po-table").bootstrapTable({ + search: true, + sortable: true, +}); + +$("#part-order-2").click(function() { + launchModalForm("/order/purchase-order/order-parts/", { + data: { + part: {{ part.id }}, + }, + }); +}); + {% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/stock.html b/InvenTree/part/templates/part/stock.html index 04d1b0278a..a41d5fd32a 100644 --- a/InvenTree/part/templates/part/stock.html +++ b/InvenTree/part/templates/part/stock.html @@ -4,13 +4,7 @@ {% include 'part/tabs.html' with tab='stock' %} -
-
-

Part Stock

-
-
-
-
+

Part Stock


{% if part.is_template %} diff --git a/InvenTree/part/templates/part/supplier.html b/InvenTree/part/templates/part/supplier.html index ea5baa2759..30fe9ecc0b 100644 --- a/InvenTree/part/templates/part/supplier.html +++ b/InvenTree/part/templates/part/supplier.html @@ -4,14 +4,7 @@ {% include 'part/tabs.html' with tab='suppliers' %} -
-
-

Part Suppliers

-
-
-
-
- +

Part Suppliers


diff --git a/InvenTree/part/templates/part/tabs.html b/InvenTree/part/templates/part/tabs.html index c7dbb2418f..aa7a9fa885 100644 --- a/InvenTree/part/templates/part/tabs.html +++ b/InvenTree/part/templates/part/tabs.html @@ -48,6 +48,4 @@ Attachments {% if part.attachment_count > 0 %}{{ part.attachment_count }}{% endif %} - - -
\ No newline at end of file + \ No newline at end of file diff --git a/InvenTree/part/templates/part/used_in.html b/InvenTree/part/templates/part/used_in.html index 135427e313..fb7e76e7e9 100644 --- a/InvenTree/part/templates/part/used_in.html +++ b/InvenTree/part/templates/part/used_in.html @@ -4,15 +4,7 @@ {% include 'part/tabs.html' with tab='used' %} -
-
-

Used to Build

-
-
-
-
-
-
+

Assemblies


From 776ca7db12b908e1cff5343c8378dc3771e1ff73 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 19 Jun 2019 08:03:39 +1000 Subject: [PATCH 5/6] Visual style for build --- InvenTree/build/templates/build/allocate_view.html | 3 ++- InvenTree/build/templates/build/detail.html | 2 ++ InvenTree/build/templates/build/tabs.html | 4 +--- InvenTree/company/templates/company/detail_part.html | 2 -- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/InvenTree/build/templates/build/allocate_view.html b/InvenTree/build/templates/build/allocate_view.html index b37f079b9d..c688171f7e 100644 --- a/InvenTree/build/templates/build/allocate_view.html +++ b/InvenTree/build/templates/build/allocate_view.html @@ -1,6 +1,7 @@

Required Parts

+
-
+
diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index 6b916d08bf..744ed56582 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -7,6 +7,8 @@

Build Details

+
+
Virtual
diff --git a/InvenTree/build/templates/build/tabs.html b/InvenTree/build/templates/build/tabs.html index 2f27f11fc0..03b7172742 100644 --- a/InvenTree/build/templates/build/tabs.html +++ b/InvenTree/build/templates/build/tabs.html @@ -5,6 +5,4 @@ Parts - - -
\ No newline at end of file + \ No newline at end of file diff --git a/InvenTree/company/templates/company/detail_part.html b/InvenTree/company/templates/company/detail_part.html index d6aa0697ee..2cc100390b 100644 --- a/InvenTree/company/templates/company/detail_part.html +++ b/InvenTree/company/templates/company/detail_part.html @@ -19,8 +19,6 @@ -
-
Title{{ build.title }}
From 05a5ab222d53d2cf313d1e33894c09edd336e062 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 19 Jun 2019 08:09:05 +1000 Subject: [PATCH 6/6] Some more changes --- .../company/templates/company/index.html | 17 ++++++---------- .../templates/order/purchase_orders.html | 20 ++++++++++--------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index 84fd85732e..d4193960d3 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -8,20 +8,15 @@ InvenTree | Supplier List {% block content %} -
-
-

Supplier List

-
-
-
-
- -
-
+

Supplier List

+
+ +
+
+
-
diff --git a/InvenTree/order/templates/order/purchase_orders.html b/InvenTree/order/templates/order/purchase_orders.html index 0c7ac717cd..78649ca6de 100644 --- a/InvenTree/order/templates/order/purchase_orders.html +++ b/InvenTree/order/templates/order/purchase_orders.html @@ -8,18 +8,16 @@ InvenTree | Purchase Orders {% block content %} -
-
-

Purchase Orders

-
-
-
- -
+

Purchase Orders

+
+ +
+
+
-{% include "order/po_table.html" %} +{% include "order/po_table.html" with toolbar='#table-buttons' %} {% endblock %} @@ -34,4 +32,8 @@ $("#po-create").click(function() { ); }); +$("#po-table").bootstrapTable({ + search: true, +}); + {% endblock %} \ No newline at end of file