From 57851b0eaf88029fc0eb044a43fdf4e1d11bf10f Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 15 Jul 2021 16:36:20 +1000 Subject: [PATCH] Refactor build orders display --- .../build/templates/build/build_base.html | 2 +- InvenTree/build/templates/build/detail.html | 2 +- InvenTree/part/templates/part/build.html | 48 ------------------- InvenTree/part/templates/part/detail.html | 36 ++++++++++++++ InvenTree/part/urls.py | 1 - 5 files changed, 38 insertions(+), 51 deletions(-) delete mode 100644 InvenTree/part/templates/part/build.html diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index ece6de36bb..7100e82838 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -126,7 +126,7 @@ src="{% static 'img/blank_image.png' %}" {% trans "Part" %} - {{ build.part.full_name }} + {{ build.part.full_name }} diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index 1b4c577b07..63c04f7590 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -24,7 +24,7 @@ {% trans "Part" %} - {{ build.part.full_name }}{% include "clip.html"%} + {{ build.part.full_name }}{% include "clip.html"%} diff --git a/InvenTree/part/templates/part/build.html b/InvenTree/part/templates/part/build.html deleted file mode 100644 index 29f32c770a..0000000000 --- a/InvenTree/part/templates/part/build.html +++ /dev/null @@ -1,48 +0,0 @@ -{% extends "part/part_base.html" %} -{% load static %} -{% load i18n %} - -{% block menubar %} -{% include 'part/navbar.html' with tab='build' %} -{% endblock %} - -{% block heading %} -{% trans "Part Builds" %} -{% endblock %} - -{% block details %} -
-
- {% if part.active %} - {% if roles.build.add %} - - {% endif %} - {% endif %} -
- -
-
-
- - -
- - -{% endblock %} - -{% block js_ready %} -{{ block.super }} - $("#start-build").click(function() { - newBuildOrder({ - part: {{ part.pk }}, - }); - }); - - loadBuildTable($("#build-table"), { - url: "{% url 'api-build-list' %}", - params: { - part: {{ part.id }}, - } - }); - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index 8910766972..afef20d714 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -229,6 +229,29 @@ +
+
+

{% trans "Part Builds" %}

+
+
+
+
+ {% if part.active %} + {% if roles.build.add %} + + {% endif %} + {% endif %} +
+ +
+
+
+ + +
+
+
+

{% trans "Part Manufacturers" %}

@@ -262,6 +285,19 @@ {% block js_ready %} {{ block.super }} + $("#start-build").click(function() { + newBuildOrder({ + part: {{ part.pk }}, + }); + }); + + loadBuildTable($("#build-table"), { + url: "{% url 'api-build-list' %}", + params: { + part: {{ part.id }}, + } + }); + $('#table-related-part').inventreeTable({ }); diff --git a/InvenTree/part/urls.py b/InvenTree/part/urls.py index 3d50e64261..3cf96604e4 100644 --- a/InvenTree/part/urls.py +++ b/InvenTree/part/urls.py @@ -49,7 +49,6 @@ part_detail_urls = [ url(r'^allocation/?', views.PartDetail.as_view(template_name='part/allocation.html'), name='part-allocation'), url(r'^bom/?', views.PartDetail.as_view(template_name='part/bom.html'), name='part-bom'), - url(r'^build/?', views.PartDetail.as_view(template_name='part/build.html'), name='part-build'), url(r'^used/?', views.PartDetail.as_view(template_name='part/used_in.html'), name='part-used-in'), url(r'^prices/', views.PartPricingView.as_view(template_name='part/prices.html'), name='part-prices'), url(r'^track/?', views.PartDetail.as_view(template_name='part/track.html'), name='part-track'),