From 0fc558068fad936f3a80b9e8ad74c9b11d2aa8bf Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 15 Jul 2021 22:40:14 +1000 Subject: [PATCH] Refactor BuildOrder pages --- InvenTree/build/templates/build/allocate.html | 101 ---- .../build/templates/build/attachments.html | 84 --- .../build/templates/build/build_base.html | 6 + .../build/templates/build/build_children.html | 40 -- .../build/templates/build/build_output.html | 103 ---- InvenTree/build/templates/build/detail.html | 558 ++++++++++++++---- InvenTree/build/templates/build/navbar.html | 25 +- InvenTree/build/templates/build/notes.html | 51 -- InvenTree/build/urls.py | 15 +- InvenTree/build/views.py | 56 +- InvenTree/templates/js/nav.js | 1 - 11 files changed, 458 insertions(+), 582 deletions(-) delete mode 100644 InvenTree/build/templates/build/allocate.html delete mode 100644 InvenTree/build/templates/build/attachments.html delete mode 100644 InvenTree/build/templates/build/build_children.html delete mode 100644 InvenTree/build/templates/build/build_output.html delete mode 100644 InvenTree/build/templates/build/notes.html diff --git a/InvenTree/build/templates/build/allocate.html b/InvenTree/build/templates/build/allocate.html deleted file mode 100644 index de07614c8e..0000000000 --- a/InvenTree/build/templates/build/allocate.html +++ /dev/null @@ -1,101 +0,0 @@ -{% extends "build/build_base.html" %} -{% load static %} -{% load i18n %} -{% load inventree_extras %} - -{% block page_title %} -{% inventree_title %} | {% trans "Allocate Parts" %} -{% endblock %} - -{% block menubar %} -{% include "build/navbar.html" with tab='allocate' %} -{% endblock %} - -{% block heading %} -{% trans "Allocate Stock to Build" %} -{% endblock %} - -{% block details %} -{% if build.has_untracked_bom_items %} -{% if build.active %} -
- - - -
-{% if build.areUntrackedPartsFullyAllocated %} -
- {% trans "Untracked stock has been fully allocated for this Build Order" %} -
-{% else %} -
- {% trans "Untracked stock has not been fully allocated for this Build Order" %} -
-{% endif %} -{% endif %} -
-{% else %} -
- {% trans "This Build Order does not have any associated untracked BOM items" %} -
-{% endif %} -{% endblock %} - -{% block js_ready %} -{{ block.super }} - - var buildInfo = { - pk: {{ build.pk }}, - quantity: {{ build.quantity }}, - completed: {{ build.completed }}, - part: {{ build.part.pk }}, - }; - - {% if build.has_untracked_bom_items %} - // Load allocation table for un-tracked parts - loadBuildOutputAllocationTable(buildInfo, null); - {% endif %} - - function reloadTable() { - $('#allocation-table-untracked').bootstrapTable('refresh'); - } - - {% if build.active %} - $("#btn-auto-allocate").on('click', function() { - launchModalForm( - "{% url 'build-auto-allocate' build.id %}", - { - success: reloadTable, - } - ); - }); - - $('#btn-unallocate').on('click', function() { - launchModalForm( - "{% url 'build-unallocate' build.id %}", - { - success: reloadTable, - } - ); - }); - - $("#btn-order-parts").click(function() { - launchModalForm("/order/purchase-order/order-parts/", { - data: { - build: {{ build.id }}, - }, - }); - }); - - {% endif %} - -{% endblock %} - \ No newline at end of file diff --git a/InvenTree/build/templates/build/attachments.html b/InvenTree/build/templates/build/attachments.html deleted file mode 100644 index e969756b81..0000000000 --- a/InvenTree/build/templates/build/attachments.html +++ /dev/null @@ -1,84 +0,0 @@ -{% extends "build/build_base.html" %} - -{% load static %} -{% load i18n %} -{% load markdownify %} - -{% block menubar %} -{% include "build/navbar.html" with tab='attachments' %} -{% endblock %} - -{% block heading %} -{% trans "Attachments" %} -{% endblock %} - -{% block details %} -{% include "attachment_table.html" with attachments=build.attachments.all %} - -{% endblock %} - -{% block js_ready %} -{{ block.super }} - -enableDragAndDrop( - '#attachment-dropzone', - '{% url "api-build-attachment-list" %}', - { - data: { - build: {{ build.id }}, - }, - label: 'attachment', - success: function(data, status, xhr) { - location.reload(); - } - } -); - -// Callback for creating a new attachment -$('#new-attachment').click(function() { - - constructForm('{% url "api-build-attachment-list" %}', { - fields: { - attachment: {}, - comment: {}, - build: { - value: {{ build.pk }}, - hidden: true, - } - }, - method: 'POST', - onSuccess: reloadAttachmentTable, - title: '{% trans "Add Attachment" %}', - }); -}); - -loadAttachmentTable( - '{% url "api-build-attachment-list" %}', - { - filters: { - build: {{ build.pk }}, - }, - onEdit: function(pk) { - var url = `/api/build/attachment/${pk}/`; - - constructForm(url, { - fields: { - comment: {}, - }, - onSuccess: reloadAttachmentTable, - title: '{% trans "Edit Attachment" %}', - }); - }, - onDelete: function(pk) { - - constructForm(`/api/build/attachment/${pk}/`, { - method: 'DELETE', - confirmMessage: '{% trans "Confirm Delete Operation" %}', - title: '{% trans "Delete Attachment" %}', - onSuccess: reloadAttachmentTable, - }); - } - } -); - -{% endblock %} diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index 7100e82838..5770777d28 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -238,4 +238,10 @@ src="{% static 'img/blank_image.png' %}" ); }); + attachNavCallbacks({ + name: 'buildorder', + default: 'details' + }); + + {% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/build_children.html b/InvenTree/build/templates/build/build_children.html deleted file mode 100644 index 3bab257d81..0000000000 --- a/InvenTree/build/templates/build/build_children.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends "build/build_base.html" %} -{% load static %} -{% load i18n %} - -{% block menubar %} -{% include "build/navbar.html" with tab="children" %} -{% endblock %} - -{% block heading %} -{% trans "Child Build Orders" %} -{% endblock %} - - -{% block details %} -
-
-
- -
-
- -
- -
- -{% endblock %} - -{% block js_ready %} - -{{ block.super }} - -loadBuildTable($('#sub-build-table'), { - url: '{% url "api-build-list" %}', - filterTarget: "#filter-list-sub-build", - params: { - ancestor: {{ build.pk }}, - } -}); - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/build_output.html b/InvenTree/build/templates/build/build_output.html deleted file mode 100644 index 00d7c5d5d2..0000000000 --- a/InvenTree/build/templates/build/build_output.html +++ /dev/null @@ -1,103 +0,0 @@ -{% extends "build/build_base.html" %} -{% load static %} -{% load i18n %} - -{% block menubar %} -{% include "build/navbar.html" with tab='output' %} -{% endblock %} - -{% block content_panels %} - -{% if not build.is_complete %} -
-
-

- {% trans "Incomplete Build Outputs" %} -

-
- -
-
- {% if build.active %} - - {% endif %} -
- - {% if build.incomplete_outputs %} -
- {% for item in build.incomplete_outputs %} - {% include "build/allocation_card.html" with item=item tracked_items=build.has_tracked_bom_items %} - {% endfor %} -
- {% else %} -
- {% trans "Create a new build output" %}
- {% trans "No incomplete build outputs remain." %}
- {% trans "Create a new build output using the button above" %} -
- {% endif %} - -
-
-{% endif %} - -
-
-

- {% trans "Completed Build Outputs" %} -

-
- -
- {% include "stock_table.html" with read_only=True %} -
-
- -{% endblock %} - -{% block js_ready %} -{{ block.super }} - -$('#btn-create-output').click(function() { - launchModalForm('{% url "build-output-create" build.id %}', - { - reload: true, - } - ); -}); - -loadStockTable($("#stock-table"), { - params: { - location_detail: true, - part_detail: true, - build: {{ build.id }}, - }, - groupByField: 'location', - buttons: [ - '#stock-options', - ], - url: "{% url 'api-stock-list' %}", -}); - -var buildInfo = { - pk: {{ build.pk }}, - quantity: {{ build.quantity }}, - completed: {{ build.completed }}, - part: {{ build.part.pk }}, -}; - -{% for item in build.incomplete_outputs %} -// Get the build output as a javascript object -inventreeGet('{% url 'api-stock-detail' item.pk %}', {}, - { - success: function(response) { - loadBuildOutputAllocationTable(buildInfo, response); - } - } -); -{% endfor %} - - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index 63c04f7590..fe716b87f2 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -2,142 +2,446 @@ {% load static %} {% load i18n %} {% load status_codes %} +{% load markdownify %} {% block menubar %} -{% include "build/navbar.html" with tab='details' %} +{% include "build/navbar.html" %} {% endblock %} -{% block heading %} -{% trans "Build Details" %} -{% endblock %} +{% block page_content %} -{% block details %} -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% if build.batch %} - - - - - - {% endif %} - {% if build.parent %} - - - - - - {% endif %} - {% if build.sales_order %} - - - - - - {% endif %} - {% if build.link %} - - - - - - {% endif %} - {% if build.issued_by %} - - - - - - {% endif %} - {% if build.responsible %} - - - - - - {% endif %} -
{% trans "Description" %}{{ build.title }}{% include "clip.html"%}
{% trans "Part" %}{{ build.part.full_name }}{% include "clip.html"%}
{% trans "Quantity" %}{{ build.quantity }}
{% trans "Stock Source" %} - {% if build.take_from %} - {{ build.take_from }}{% include "clip.html"%} - {% else %} - {% trans "Stock can be taken from any available location." %} - {% endif %} -
{% trans "Destination" %} - {% if build.destination %} - - {{ build.destination }} - {% include "clip.html"%} - {% else %} - {% trans "Destination location not specified" %} - {% endif %} -
{% trans "Status" %}{% build_status_label build.status %}
{% trans "Progress" %}{{ build.completed }} / {{ build.quantity }}
{% trans "Batch" %}{{ build.batch }}{% include "clip.html"%}
{% trans "Parent Build" %}{{ build.parent }}{% include "clip.html"%}
{% trans "Sales Order" %}{{ build.sales_order }}{% include "clip.html"%}
{% trans "External Link" %}{{ build.link }}{% include "clip.html"%}
{% trans "Issued By" %}{{ build.issued_by }}
{% trans "Responsible" %}{{ build.responsible }}
+
+
+

{% trans "Build Details" %}

-
- - - - - - - - - - - {% if build.target_date %} - - {% else %} - +
+
+
+
{% trans "Created" %}{{ build.creation_date }}
{% trans "Target Date" %} - {{ build.target_date }}{% if build.is_overdue %} {% endif %} - {% trans "No target date set" %}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% if build.batch %} + + + + + {% endif %} - - - - - {% if build.completion_date %} - - {% else %} - + {% if build.parent %} + + + + + {% endif %} - -
{% trans "Description" %}{{ build.title }}{% include "clip.html"%}
{% trans "Part" %}{{ build.part.full_name }}{% include "clip.html"%}
{% trans "Quantity" %}{{ build.quantity }}
{% trans "Stock Source" %} + {% if build.take_from %} + {{ build.take_from }}{% include "clip.html"%} + {% else %} + {% trans "Stock can be taken from any available location." %} + {% endif %} +
{% trans "Destination" %} + {% if build.destination %} + + {{ build.destination }} + {% include "clip.html"%} + {% else %} + {% trans "Destination location not specified" %} + {% endif %} +
{% trans "Status" %}{% build_status_label build.status %}
{% trans "Progress" %}{{ build.completed }} / {{ build.quantity }}
{% trans "Batch" %}{{ build.batch }}{% include "clip.html"%}
{% trans "Completed" %}{{ build.completion_date }}{% if build.completed_by %}{{ build.completed_by }}{% endif %}{% trans "Build not complete" %}
{% trans "Parent Build" %}{{ build.parent }}{% include "clip.html"%}
+ {% if build.sales_order %} + + + {% trans "Sales Order" %} + {{ build.sales_order }}{% include "clip.html"%} + + {% endif %} + {% if build.link %} + + + {% trans "External Link" %} + {{ build.link }}{% include "clip.html"%} + + {% endif %} + {% if build.issued_by %} + + + {% trans "Issued By" %} + {{ build.issued_by }} + + {% endif %} + {% if build.responsible %} + + + {% trans "Responsible" %} + {{ build.responsible }} + + {% endif %} + +
+
+ + + + + + + + + + + {% if build.target_date %} + + {% else %} + + {% endif %} + + + + + {% if build.completion_date %} + + {% else %} + + {% endif %} + +
{% trans "Created" %}{{ build.creation_date }}
{% trans "Target Date" %} + {{ build.target_date }}{% if build.is_overdue %} {% endif %} + {% trans "No target date set" %}
{% trans "Completed" %}{{ build.completion_date }}{% if build.completed_by %}{{ build.completed_by }}{% endif %}{% trans "Build not complete" %}
+
+
+
+
+

{% trans "Child Build Orders" %}

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

{% trans "Allocate Stock to Build" %}

+
+
+ {% if build.has_untracked_bom_items %} + {% if build.active %} +
+ + + +
+ {% if build.areUntrackedPartsFullyAllocated %} +
+ {% trans "Untracked stock has been fully allocated for this Build Order" %} +
+ {% else %} +
+ {% trans "Untracked stock has not been fully allocated for this Build Order" %} +
+ {% endif %} + {% endif %} +
+ {% else %} +
+ {% trans "This Build Order does not have any associated untracked BOM items" %} +
+ {% endif %} +
+
+ +
+ {% if not build.is_complete %} +
+

{% trans "Incomplete Build Outputs" %}

+
+
+
+ {% if build.active %} + + {% endif %} +
+ + {% if build.incomplete_outputs %} +
+ {% for item in build.incomplete_outputs %} + {% include "build/allocation_card.html" with item=item tracked_items=build.has_tracked_bom_items %} + {% endfor %} +
+ {% else %} +
+ {% trans "Create a new build output" %}
+ {% trans "No incomplete build outputs remain." %}
+ {% trans "Create a new build output using the button above" %} +
+ {% endif %} +
+ {% endif %} + +
+

+ {% trans "Completed Build Outputs" %} +

+
+ +
+ {% include "stock_table.html" with read_only=True prefix="build-" %} +
+
+ +
+
+

{% trans "Attachments" %}

+
+
+ {% include "attachment_table.html" %} +
+
+ +
+
+
+
+

{% trans "Build Notes" %}

+
+
+
+ +
+
+
+
+
+ {% if build.notes %} + {{ build.notes | markdownify }} + {% endif %} +
+
+ + {% endblock %} + +{% block js_ready %} +{{ block.super }} + +$('#btn-create-output').click(function() { + launchModalForm('{% url "build-output-create" build.id %}', + { + reload: true, + } + ); +}); + +loadStockTable($("#build-stock-table"), { + params: { + location_detail: true, + part_detail: true, + build: {{ build.id }}, + }, + groupByField: 'location', + buttons: [ + '#stock-options', + ], + url: "{% url 'api-stock-list' %}", +}); + +var buildInfo = { + pk: {{ build.pk }}, + quantity: {{ build.quantity }}, + completed: {{ build.completed }}, + part: {{ build.part.pk }}, +}; + +{% for item in build.incomplete_outputs %} +// Get the build output as a javascript object +inventreeGet('{% url 'api-stock-detail' item.pk %}', {}, + { + success: function(response) { + loadBuildOutputAllocationTable(buildInfo, response); + } + } +); +{% endfor %} + +loadBuildTable($('#sub-build-table'), { + url: '{% url "api-build-list" %}', + filterTarget: "#filter-list-sub-build", + params: { + ancestor: {{ build.pk }}, + } +}); + +enableDragAndDrop( + '#attachment-dropzone', + '{% url "api-build-attachment-list" %}', + { + data: { + build: {{ build.id }}, + }, + label: 'attachment', + success: function(data, status, xhr) { + location.reload(); + } + } +); + +// Callback for creating a new attachment +$('#new-attachment').click(function() { + + constructForm('{% url "api-build-attachment-list" %}', { + fields: { + attachment: {}, + comment: {}, + build: { + value: {{ build.pk }}, + hidden: true, + } + }, + method: 'POST', + onSuccess: reloadAttachmentTable, + title: '{% trans "Add Attachment" %}', + }); +}); + +loadAttachmentTable( + '{% url "api-build-attachment-list" %}', + { + filters: { + build: {{ build.pk }}, + }, + onEdit: function(pk) { + var url = `/api/build/attachment/${pk}/`; + + constructForm(url, { + fields: { + comment: {}, + }, + onSuccess: reloadAttachmentTable, + title: '{% trans "Edit Attachment" %}', + }); + }, + onDelete: function(pk) { + + constructForm(`/api/build/attachment/${pk}/`, { + method: 'DELETE', + confirmMessage: '{% trans "Confirm Delete Operation" %}', + title: '{% trans "Delete Attachment" %}', + onSuccess: reloadAttachmentTable, + }); + } + } +); + +$('#edit-notes').click(function() { + constructForm('{% url "api-build-detail" build.pk %}', { + fields: { + notes: { + multiline: true, + } + }, + title: '{% trans "Edit Notes" %}', + reload: true, + }); +}); + +var buildInfo = { + pk: {{ build.pk }}, + quantity: {{ build.quantity }}, + completed: {{ build.completed }}, + part: {{ build.part.pk }}, +}; + +{% if build.has_untracked_bom_items %} +// Load allocation table for un-tracked parts +loadBuildOutputAllocationTable(buildInfo, null); +{% endif %} + +function reloadTable() { + $('#allocation-table-untracked').bootstrapTable('refresh'); +} + +{% if build.active %} +$("#btn-auto-allocate").on('click', function() { + launchModalForm( + "{% url 'build-auto-allocate' build.id %}", + { + success: reloadTable, + } + ); +}); + +$('#btn-unallocate').on('click', function() { + launchModalForm( + "{% url 'build-unallocate' build.id %}", + { + success: reloadTable, + } + ); +}); + +$("#btn-order-parts").click(function() { + launchModalForm("/order/purchase-order/order-parts/", { + data: { + build: {{ build.id }}, + }, + }); +}); + +{% endif %} + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/navbar.html b/InvenTree/build/templates/build/navbar.html index e6d2e644ce..e4c4fe4e50 100644 --- a/InvenTree/build/templates/build/navbar.html +++ b/InvenTree/build/templates/build/navbar.html @@ -9,46 +9,45 @@ -
  • - +
  • + {% trans "Details" %}
  • {% if build.active %} - -
  • - +
  • + {% trans "Allocate Stock" %}
  • {% endif %} -
  • - +
  • + {% trans "Build Outputs" %}
  • -
  • - +
  • + {% trans "Child Builds" %}
  • -
  • - +
  • + {% trans "Attachments" %}
  • -
  • - +
  • + {% trans "Notes" %} diff --git a/InvenTree/build/templates/build/notes.html b/InvenTree/build/templates/build/notes.html deleted file mode 100644 index 2bdbf07970..0000000000 --- a/InvenTree/build/templates/build/notes.html +++ /dev/null @@ -1,51 +0,0 @@ -{% extends "build/build_base.html" %} - -{% load static %} -{% load i18n %} -{% load markdownify %} - -{% block menubar %} -{% include "build/navbar.html" with tab='notes' %} -{% endblock %} - -{% block heading %} -{% trans "Build Notes" %} -{% if roles.build.change and not editing %} - -{% endif %} -{% endblock %} - -{% block details %} -{% if editing %} -
    -
    - {% csrf_token %} - - {{ form }} -
    - - -
    - -{{ form.media }} - -{% else %} - -{% if build.notes %} -{{ build.notes | markdownify }} -{% endif %} -{% endif %} - -{% endblock %} - -{% block js_ready %} -{{ block.super }} - -{% if editing %} -{% else %} -$("#edit-notes").click(function() { - location.href = "{% url 'build-notes' build.id %}?edit=1"; -}); -{% endif %} - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/urls.py b/InvenTree/build/urls.py index c354a17ac7..9814dc83f7 100644 --- a/InvenTree/build/urls.py +++ b/InvenTree/build/urls.py @@ -7,30 +7,23 @@ from django.conf.urls import url, include from . import views build_detail_urls = [ - url(r'^allocate/', views.BuildAllocate.as_view(), name='build-allocate'), url(r'^cancel/', views.BuildCancel.as_view(), name='build-cancel'), url(r'^delete/', views.BuildDelete.as_view(), name='build-delete'), url(r'^create-output/', views.BuildOutputCreate.as_view(), name='build-output-create'), url(r'^delete-output/', views.BuildOutputDelete.as_view(), name='build-output-delete'), - url(r'^complete-output/?', views.BuildOutputComplete.as_view(), name='build-output-complete'), - url(r'^auto-allocate/?', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'), + url(r'^complete-output/', views.BuildOutputComplete.as_view(), name='build-output-complete'), + url(r'^auto-allocate/', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'), url(r'^unallocate/', views.BuildUnallocate.as_view(), name='build-unallocate'), url(r'^complete/', views.BuildComplete.as_view(), name='build-complete'), - url(r'^notes/', views.BuildNotes.as_view(), name='build-notes'), - - url(r'^children/', views.BuildDetail.as_view(template_name='build/build_children.html'), name='build-children'), - url(r'^attachments/', views.BuildDetail.as_view(template_name='build/attachments.html'), name='build-attachments'), - url(r'^output/', views.BuildDetail.as_view(template_name='build/build_output.html'), name='build-output'), - url(r'^.*$', views.BuildDetail.as_view(), name='build-detail'), ] build_urls = [ url(r'item/', include([ url(r'^(?P\d+)/', include([ - url('^edit/?', views.BuildItemEdit.as_view(), name='build-item-edit'), - url('^delete/?', views.BuildItemDelete.as_view(), name='build-item-delete'), + url('^edit/', views.BuildItemEdit.as_view(), name='build-item-edit'), + url('^delete/', views.BuildItemDelete.as_view(), name='build-item-delete'), ])), url('^new/', views.BuildItemCreate.as_view(), name='build-item-create'), ])), diff --git a/InvenTree/build/views.py b/InvenTree/build/views.py index 2bae825b0f..8d2a8bff80 100644 --- a/InvenTree/build/views.py +++ b/InvenTree/build/views.py @@ -593,31 +593,6 @@ class BuildOutputComplete(AjaxUpdateView): } -class BuildNotes(InvenTreeRoleMixin, UpdateView): - """ View for editing the 'notes' field of a Build object. - """ - - context_object_name = 'build' - template_name = 'build/notes.html' - model = Build - - # Override the default permission role for this View - role_required = 'build.view' - - fields = ['notes'] - - def get_success_url(self): - return reverse('build-notes', kwargs={'pk': self.get_object().id}) - - def get_context_data(self, **kwargs): - - ctx = super().get_context_data(**kwargs) - - ctx['editing'] = str2bool(self.request.GET.get('edit', '')) - - return ctx - - class BuildDetail(InvenTreeRoleMixin, DetailView): """ Detail view of a single Build object. """ @@ -635,36 +610,15 @@ class BuildDetail(InvenTreeRoleMixin, DetailView): ctx['BuildStatus'] = BuildStatus ctx['sub_build_count'] = build.sub_build_count() - return ctx - - -class BuildAllocate(InvenTreeRoleMixin, DetailView): - """ View for allocating parts to a Build """ - model = Build - context_object_name = 'build' - template_name = 'build/allocate.html' - - def get_context_data(self, **kwargs): - """ Provide extra context information for the Build allocation page """ - - context = super(DetailView, self).get_context_data(**kwargs) - - build = self.get_object() part = build.part bom_items = build.bom_items - context['part'] = part - context['bom_items'] = bom_items - context['has_tracked_bom_items'] = build.has_tracked_bom_items() - context['has_untracked_bom_items'] = build.has_untracked_bom_items() - context['BuildStatus'] = BuildStatus + ctx['part'] = part + ctx['bom_items'] = bom_items + ctx['has_tracked_bom_items'] = build.has_tracked_bom_items() + ctx['has_untracked_bom_items'] = build.has_untracked_bom_items() - context['bom_price'] = build.part.get_price_info(build.quantity, buy=False) - - if str2bool(self.request.GET.get('edit', None)): - context['editing'] = True - - return context + return ctx class BuildDelete(AjaxDeleteView): diff --git a/InvenTree/templates/js/nav.js b/InvenTree/templates/js/nav.js index f33571d584..aff3435b21 100644 --- a/InvenTree/templates/js/nav.js +++ b/InvenTree/templates/js/nav.js @@ -20,7 +20,6 @@ function attachNavCallbacks(options={}) { activatePanel(panelName, options); }); - var panelClass = options.name || 'unknown'; /* Look for a default panel to initialize