-{% include 'modals.html' %}
-
{% endblock %}
{% block js_load %}
-
+{{ block.super }}
``
-
{% endblock %}
{% block js_ready %}
+ {{ block.super }}
$('#supplier-table').footable();
$('#supplier-create').click(function () {
diff --git a/InvenTree/part/urls.py b/InvenTree/part/urls.py
index 31129ad529..ab680e4b52 100644
--- a/InvenTree/part/urls.py
+++ b/InvenTree/part/urls.py
@@ -26,6 +26,8 @@ part_detail_urls = [
url(r'^allocation/?', views.PartDetail.as_view(template_name='part/allocation.html'), name='part-allocation'),
url(r'^suppliers/?', views.PartDetail.as_view(template_name='part/supplier.html'), name='part-suppliers'),
+ url(r'^thumbnail/?', views.PartImage.as_view(), name='part-image'),
+
# Any other URLs go to the part detail page
url(r'^.*$', views.PartDetail.as_view(), name='part-detail'),
]
diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py
index ee28b15c1b..5a432df4f3 100644
--- a/InvenTree/part/views.py
+++ b/InvenTree/part/views.py
@@ -11,6 +11,7 @@ from company.models import Company
from .models import PartCategory, Part, BomItem
from .models import SupplierPart
+from .forms import PartImageForm
from .forms import EditPartForm
from .forms import EditCategoryForm
from .forms import EditBomItemForm
@@ -83,6 +84,14 @@ class PartDetail(DetailView):
template_name = 'part/detail.html'
+class PartImage(AjaxUpdateView):
+
+ model = Part
+ ajax_template_name = 'modal_form.html'
+ ajax_form_title = 'Upload Part Image'
+ form_class = PartImageForm
+
+
class PartEdit(AjaxUpdateView):
model = Part
form_class = EditPartForm