From e38d740bbc4ab59e4e5be1cd34affdbce378c932 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 15 Jul 2021 16:44:46 +1000 Subject: [PATCH] Refactor "used in" page --- InvenTree/part/templates/part/detail.html | 26 +++++++++++++++ InvenTree/part/templates/part/used_in.html | 39 ---------------------- InvenTree/part/urls.py | 2 -- 3 files changed, 26 insertions(+), 41 deletions(-) delete mode 100644 InvenTree/part/templates/part/used_in.html diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index 3def22cf03..6949879aa4 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -238,6 +238,22 @@ +
+
+

{% trans "Assemblies" %}

+
+
+
+
+ +
+
+ + +
+
+
+

{% trans "Part Builds" %}

@@ -294,6 +310,16 @@ {% block js_ready %} {{ block.super }} + loadPartTable('#used-table', + '{% url "api-part-list" %}', + { + params: { + uses: {{ part.pk }}, + }, + filterTarget: '#filter-list-usedin', + } + ); + // Load the BOM table data loadBomTable($("#bom-table"), { editable: {{ editing_enabled }}, diff --git a/InvenTree/part/templates/part/used_in.html b/InvenTree/part/templates/part/used_in.html deleted file mode 100644 index e7d8863d42..0000000000 --- a/InvenTree/part/templates/part/used_in.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "part/part_base.html" %} -{% load i18n %} - -{% block menubar %} -{% include 'part/navbar.html' with tab='used' %} -{% endblock %} - -{% block heading %} -{% trans "Assemblies" %} -{% endblock %} - -{% block details %} - -
-
- -
-
- - -
- -{% endblock %} - -{% block js_ready %} -{{ block.super }} - - loadPartTable('#used-table', - '{% url "api-part-list" %}', - { - params: { - uses: {{ part.pk }}, - }, - filterTarget: '#filter-list-usedin', - } - ); - - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/urls.py b/InvenTree/part/urls.py index 3cf96604e4..ded9e0b3c4 100644 --- a/InvenTree/part/urls.py +++ b/InvenTree/part/urls.py @@ -48,8 +48,6 @@ part_detail_urls = [ url(r'^bom-duplicate/?', views.BomDuplicate.as_view(), name='duplicate-bom'), 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'^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'),