diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html new file mode 100644 index 0000000000..f790275d2e --- /dev/null +++ b/InvenTree/build/templates/build/build_base.html @@ -0,0 +1,79 @@ +{% extends "base.html" %} + +{% load static %} + +{% block page_title %} +InvenTree | Build - {{ build }} +{% endblock %} + +{% block content %} + +
+
+

Build Details

+

{{ build.title }}{% include "build_status.html" with build=build %}

+

Building {{ build.quantity }} × {{ build.part.full_name }}

+
+
+

+
+ +
+

+
+
+ +
+ +
+{% block details %} + +{% endblock %} + +
+ +{% include "modals.html" %} + +{% endblock %} + +{% block js_ready %} + + $("#build-edit").click(function () { + launchModalForm("{% url 'build-edit' build.id %}", + { + reload: true + }); + }); + + $("#build-cancel").click(function() { + launchModalForm("{% url 'build-cancel' build.id %}", + { + reload: true, + submit_text: "Cancel Build", + }); + }); + + $("#build-complete").on('click', function() { + launchModalForm( + "{% url 'build-complete' build.id %}", + { + reload: true, + submit_text: "Complete Build", + } + ); + }); + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index a46a146d77..99e4671d56 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -1,39 +1,11 @@ -{% extends "base.html" %} +{% extends "build/build_base.html" %} {% load static %} -{% block page_title %} -InvenTree | Build - {{ build }} -{% endblock %} +{% block details %} -{% block content %} +{% include "build/tabs.html" with tab='details' %} -
-
-

Build Details

-

{{ build.title }}{% include "build_status.html" with build=build %}

-

Building {{ build.quantity }} × {{ build.part.full_name }}

-
-
-

-
- -
-

-
-
+

Build Details

@@ -95,60 +67,4 @@ InvenTree | Build - {{ build }} {% endif %}
-{% if build.is_active %} -

Required Parts

- - - - - - - - - - - {% for item in build.required_parts %} - - - - - - - {% endfor %} - -
PartRequiredAvailableAllocated
{{ item.part.full_name }}{{ item.quantity }}{{ item.part.total_stock }}{{ item.allocated }}
- -{% endif %} - -{% include 'modals.html' %} - -{% endblock %} - -{% block js_ready %} -{{ block.super }} - $("#build-edit").click(function () { - launchModalForm("{% url 'build-edit' build.id %}", - { - reload: true - }); - }); - - $("#build-cancel").click(function() { - launchModalForm("{% url 'build-cancel' build.id %}", - { - reload: true, - submit_text: "Cancel Build", - }); - }); - - $("#build-complete").on('click', function() { - launchModalForm( - "{% url 'build-complete' build.id %}", - { - reload: true, - submit_text: "Complete Build", - } - ); - }); - {% endblock %} diff --git a/InvenTree/build/templates/build/required.html b/InvenTree/build/templates/build/required.html new file mode 100644 index 0000000000..f1dccde02e --- /dev/null +++ b/InvenTree/build/templates/build/required.html @@ -0,0 +1,36 @@ +{% extends "build/build_base.html" %} +{% load static %} + +{% block details %} + +{% include "build/tabs.html" with tab='required' %} + +

Required Parts

+ + + + + + + + + + + {% for item in build.required_parts %} + + + + + + + {% endfor %} + +
PartAvailableRequiredAllocated
+ + + + + {{ item.part.full_name }} + {{ item.part.total_stock }}{{ item.quantity }}{{ item.allocated }}
+ +{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/tabs.html b/InvenTree/build/templates/build/tabs.html new file mode 100644 index 0000000000..b30ba7762f --- /dev/null +++ b/InvenTree/build/templates/build/tabs.html @@ -0,0 +1,10 @@ + + +
\ No newline at end of file diff --git a/InvenTree/build/urls.py b/InvenTree/build/urls.py index 3118bd6042..383e478494 100644 --- a/InvenTree/build/urls.py +++ b/InvenTree/build/urls.py @@ -24,6 +24,8 @@ build_detail_urls = [ url(r'^auto-allocate/?', views.BuildAutoAllocate.as_view(), name='build-auto-allocate'), url(r'^unallocate/', views.BuildUnallocate.as_view(), name='build-unallocate'), + url(r'^required/', views.BuildDetail.as_view(template_name='build/required.html'), name='build-required'), + url(r'^.*$', views.BuildDetail.as_view(), name='build-detail'), ]