diff --git a/InvenTree/company/templates/company/manufacturer_part_base.html b/InvenTree/company/templates/company/manufacturer_part_base.html index addd9265b8..8fdcd79f71 100644 --- a/InvenTree/company/templates/company/manufacturer_part_base.html +++ b/InvenTree/company/templates/company/manufacturer_part_base.html @@ -62,7 +62,7 @@ src="{% static 'img/blank_image.png' %}" {% trans "Internal Part" %} {% if part.part %} - {{ part.part.full_name }}{% include "clip.html"%} + {{ part.part.full_name }}{% include "clip.html"%} {% endif %} diff --git a/InvenTree/company/templates/company/manufacturer_part_detail.html b/InvenTree/company/templates/company/manufacturer_part_detail.html index 430072a834..3bc789e6b9 100644 --- a/InvenTree/company/templates/company/manufacturer_part_detail.html +++ b/InvenTree/company/templates/company/manufacturer_part_detail.html @@ -18,7 +18,7 @@ {% trans "Internal Part" %} {% if part.part %} - {{ part.part.full_name }} + {{ part.part.full_name }} {% endif %} diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index e077e5af01..5132721fec 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -238,6 +238,30 @@ {% endblock %} +{% block post_content_panel %} + +
+
+

+ {% trans "Part Parameters" %} +

+
+
+
+
+ {% if roles.part.add %} + + {% endif %} +
+
+
+
+
+ +{% endblock %} + {% block js_load %} {{ block.super }} {% endblock %} @@ -263,4 +287,54 @@ ); }); + loadPartParameterTable( + '#parameter-table', + '{% url "api-part-parameter-list" %}', + { + params: { + part: {{ part.pk }}, + } + } + ); + + $('#param-table').inventreeTable({ + }); + + {% if roles.part.add %} + $('#param-create').click(function() { + + constructForm('{% url "api-part-parameter-list" %}', { + method: 'POST', + fields: { + part: { + value: {{ part.pk }}, + hidden: true, + }, + template: {}, + data: {}, + }, + title: '{% trans "Add Parameter" %}', + onSuccess: function() { + $('#parameter-table').bootstrapTable('refresh'); + } + }); + }); + {% endif %} + + $('.param-edit').click(function() { + var button = $(this); + + launchModalForm(button.attr('url'), { + reload: true, + }); + }); + + $('.param-delete').click(function() { + var button = $(this); + + launchModalForm(button.attr('url'), { + reload: true, + }); + }); + {% endblock %} diff --git a/InvenTree/part/templates/part/manufacturer.html b/InvenTree/part/templates/part/manufacturer.html deleted file mode 100644 index ba708d70e8..0000000000 --- a/InvenTree/part/templates/part/manufacturer.html +++ /dev/null @@ -1,84 +0,0 @@ -{% extends "part/part_base.html" %} -{% load static %} -{% load i18n %} -{% load inventree_extras %} - -{% block menubar %} -{% include 'part/navbar.html' with tab='manufacturers' %} -{% endblock %} - -{% block heading %} -{% trans "Part Manufacturers" %} -{% endblock %} - -{% block details %} - -
-
- -
- - -
-
-
- - -
- -{% endblock %} - -{% block js_load %} -{{ block.super }} -{% endblock %} -{% block js_ready %} - {{ block.super }} - - $('#manufacturer-create').click(function () { - launchModalForm( - "{% url 'manufacturer-part-create' %}", - { - reload: true, - data: { - part: {{ part.id }} - }, - secondary: [ - { - field: 'manufacturer', - label: '{% trans "New Manufacturer" %}', - title: '{% trans "Create new manufacturer" %}', - } - ] - }); - }); - - $("#manufacturer-part-delete").click(function() { - - var selections = $("#manufacturer-table").bootstrapTable("getSelections"); - - deleteManufacturerParts(selections, { - onSuccess: function() { - $("#manufacturer-table").bootstrapTable("refresh"); - } - }); - }); - - loadManufacturerPartTable( - "#manufacturer-table", - "{% url 'api-manufacturer-part-list' %}", - { - params: { - part: {{ part.id }}, - part_detail: true, - manufacturer_detail: true, - }, - } - ); - - linkButtonsToSelection($("#manufacturer-table"), ['#manufacturer-part-options']) - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/navbar.html b/InvenTree/part/templates/part/navbar.html index b4c943dcfa..afe4fee374 100644 --- a/InvenTree/part/templates/part/navbar.html +++ b/InvenTree/part/templates/part/navbar.html @@ -19,12 +19,6 @@ -
  • - - - {% trans "Parameters" %} - -
  • {% if part.is_template %}
  • @@ -78,12 +72,6 @@
  • {% if part.purchaseable and roles.purchase_order.view %} -
  • - - - {% trans "Manufacturers" %} - -
  • @@ -109,7 +97,7 @@
  • - {% trans "Tests" %} + {% trans "Test Templates" %}
  • {% endif %} diff --git a/InvenTree/part/templates/part/params.html b/InvenTree/part/templates/part/params.html deleted file mode 100644 index 365003b052..0000000000 --- a/InvenTree/part/templates/part/params.html +++ /dev/null @@ -1,81 +0,0 @@ -{% extends "part/part_base.html" %} -{% load static %} -{% load i18n %} - -{% block menubar %} -{% include "part/navbar.html" with tab='params' %} -{% endblock %} - -{% block heading %} -{% trans "Part Parameters" %} -{% endblock %} - -{% block details %} -
    -
    - {% if roles.part.add %} - - {% endif %} -
    -
    - -
    - -{% endblock %} - -{% block js_ready %} -{{ block.super }} - - loadPartParameterTable( - '#parameter-table', - '{% url "api-part-parameter-list" %}', - { - params: { - part: {{ part.pk }}, - } - } - ); - - $('#param-table').inventreeTable({ - }); - - {% if roles.part.add %} - $('#param-create').click(function() { - - constructForm('{% url "api-part-parameter-list" %}', { - method: 'POST', - fields: { - part: { - value: {{ part.pk }}, - hidden: true, - }, - template: {}, - data: {}, - }, - title: '{% trans "Add Parameter" %}', - onSuccess: function() { - $('#parameter-table').bootstrapTable('refresh'); - } - }); - }); - {% endif %} - - $('.param-edit').click(function() { - var button = $(this); - - launchModalForm(button.attr('url'), { - reload: true, - }); - }); - - $('.param-delete').click(function() { - var button = $(this); - - launchModalForm(button.attr('url'), { - reload: true, - }); - }); - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/supplier.html b/InvenTree/part/templates/part/supplier.html index c0486cc42a..8c01243541 100644 --- a/InvenTree/part/templates/part/supplier.html +++ b/InvenTree/part/templates/part/supplier.html @@ -6,12 +6,13 @@ {% include 'part/navbar.html' with tab='suppliers' %} {% endblock %} + {% block heading %} {% trans "Part Suppliers" %} {% endblock %} {% block details %} -
    +
    - +
    {% endblock %} +{% block post_content_panel %} + +
    +
    +

    + {% trans "Part Manufacturers" %} +

    +
    + +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    + +{% endblock %} + {% block js_load %} {{ block.super }} {% endblock %} @@ -90,6 +120,49 @@ } ); - linkButtonsToSelection($("#supplier-table"), ['#supplier-part-options']) + linkButtonsToSelection($("#supplier-table"), ['#supplier-part-options']); + + loadManufacturerPartTable( + '#manufacturer-table', + "{% url 'api-manufacturer-part-list' %}", + { + params: { + part: {{ part.id }}, + part_detail: true, + manufacturer_detail: true, + }, + } + ); + + linkButtonsToSelection($("#manufacturer-table"), ['#manufacturer-part-options']); + + $("#manufacturer-part-delete").click(function() { + + var selections = $("#manufacturer-table").bootstrapTable("getSelections"); + + deleteManufacturerParts(selections, { + onSuccess: function() { + $("#manufacturer-table").bootstrapTable("refresh"); + } + }); + }); + + $('#manufacturer-create').click(function () { + launchModalForm( + "{% url 'manufacturer-part-create' %}", + { + reload: true, + data: { + part: {{ part.id }} + }, + secondary: [ + { + field: 'manufacturer', + label: '{% trans "New Manufacturer" %}', + title: '{% trans "Create new manufacturer" %}', + } + ] + }); + }); {% endblock %} \ No newline at end of file diff --git a/InvenTree/part/urls.py b/InvenTree/part/urls.py index 6bd8d02601..8843a839a1 100644 --- a/InvenTree/part/urls.py +++ b/InvenTree/part/urls.py @@ -48,7 +48,6 @@ part_detail_urls = [ url(r'^bom-upload/?', views.BomUpload.as_view(), name='upload-bom'), url(r'^bom-duplicate/?', views.BomDuplicate.as_view(), name='duplicate-bom'), - url(r'^params/', views.PartDetail.as_view(template_name='part/params.html'), name='part-params'), url(r'^variants/?', views.PartDetail.as_view(template_name='part/variants.html'), name='part-variants'), url(r'^stock/?', views.PartDetail.as_view(template_name='part/stock.html'), name='part-stock'), url(r'^allocation/?', views.PartDetail.as_view(template_name='part/allocation.html'), name='part-allocation'), @@ -56,7 +55,6 @@ part_detail_urls = [ url(r'^build/?', views.PartDetail.as_view(template_name='part/build.html'), name='part-build'), 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'^manufacturers/?', views.PartDetail.as_view(template_name='part/manufacturer.html'), name='part-manufacturers'), url(r'^suppliers/?', views.PartDetail.as_view(template_name='part/supplier.html'), name='part-suppliers'), url(r'^orders/?', views.PartDetail.as_view(template_name='part/orders.html'), name='part-orders'), url(r'^sales-orders/', views.PartDetail.as_view(template_name='part/sales_orders.html'), name='part-sales-orders'),