diff --git a/InvenTree/build/templates/build/index.html b/InvenTree/build/templates/build/index.html
index b96be4313e..329c2591af 100644
--- a/InvenTree/build/templates/build/index.html
+++ b/InvenTree/build/templates/build/index.html
@@ -1,34 +1,36 @@
{% extends "base.html" %}
-
+{% load static %}
{% block content %}
Part Builds
-
+
+
- |
+ Build |
Part |
Quantity |
Status |
+
+
-{% if active|length > 0 %}
-Active Builds |
-{% include "build/build_list.html" with builds=active %}
-{% endif %}
-
-{% if complete|length > 0 %}
-
-Completed Builds |
-{% include "build/build_list.html" with builds=complete %}
-{% endif %}
-
-{% if cancelled|length > 0 %}
-
-Cancelled Builds |
-{% include "build/build_list.html" with builds=cancelled.all %}
-{% endif %}
+{% include "build/build_list.html" with builds=builds %}
+
{% endblock %}
+
+{% block javascript %}
+
+
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/InvenTree/build/views.py b/InvenTree/build/views.py
index e02a4a5e42..5f61770617 100644
--- a/InvenTree/build/views.py
+++ b/InvenTree/build/views.py
@@ -25,10 +25,12 @@ class BuildIndex(ListView):
context = super(BuildIndex, self).get_context_data(**kwargs).copy()
+ """
context['active'] = self.get_queryset().filter(status__in=[Build.PENDING, Build.HOLDING])
context['complete'] = self.get_queryset().filter(status=Build.COMPLETE)
context['cancelled'] = self.get_queryset().filter(status=Build.CANCELLED)
+ """
return context
diff --git a/InvenTree/part/templates/part/category_detail.html b/InvenTree/part/templates/part/category_detail.html
index 9b12cab55f..1eff2e013a 100644
--- a/InvenTree/part/templates/part/category_detail.html
+++ b/InvenTree/part/templates/part/category_detail.html
@@ -50,24 +50,40 @@ $(document).ready(function (){
);
});
+ {% if category.parent %}
+ var categoryRedirect = "{% url 'category-detail' category.parent.id %}";
+ {% else %}
+ var categoryRedirect = "{% url 'part-index' %}";
+ {% endif %}
+
$("#delete-category").click(function() {
launchDeleteForm("#modal-delete",
"{% url 'category-delete' category.id %}",
- {redirect: "{% url 'part-index' %}"});
+ {
+ redirect: categoryRedirect
+ });
});
$("#create-cat").click(function() {
launchModalForm("#modal-form",
"{% url 'category-create' %}",
- {data: {category: {{ category.id }}
- }});
+ {
+ follow: true,
+ data: {
+ category: {{ category.id }}
+ }
+ });
});
$("#create-part").click( function() {
launchModalForm("#modal-form",
"{% url 'part-create' %}",
- {data: {category: {{ category.id }}
- }});
+ {
+ data: {
+ category: {{ category.id }}
+ },
+ reload: true
+ });
});
});
diff --git a/InvenTree/static/script/modal_form.js b/InvenTree/static/script/modal_form.js
index efe4801f07..96e1fba6b0 100644
--- a/InvenTree/static/script/modal_form.js
+++ b/InvenTree/static/script/modal_form.js
@@ -54,6 +54,10 @@ function launchDeleteForm(modal, url, options = {}) {
if (options.success) {
options.success();
}
+ // Follow the URL returned by the JSON response
+ else if (options.follow && response.url) {
+ window.location.href = response.url;
+ }
else if (options.redirect) {
window.location.href = options.redirect;
}
diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html
new file mode 100644
index 0000000000..79f5e50a5d
--- /dev/null
+++ b/InvenTree/templates/InvenTree/index.html
@@ -0,0 +1,10 @@
+{% extends "base.html" %}
+
+{% block content %}
+
+{% endblock %}
+
+
+{% block javascript %}
+
+{% endblock %}
\ No newline at end of file