From 63b70614b68a3db117b006ec7ad2e1d2d416e33d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 12 Feb 2020 10:42:45 +1100 Subject: [PATCH] Create 'tabs' for SupplierPart view --- .../company/templates/company/partdetail.html | 48 ++----------- .../templates/company/supplier_part_base.html | 68 +++++++++++++++++++ .../templates/company/supplier_part_tabs.html | 19 ++++++ 3 files changed, 91 insertions(+), 44 deletions(-) create mode 100644 InvenTree/company/templates/company/supplier_part_base.html create mode 100644 InvenTree/company/templates/company/supplier_part_tabs.html diff --git a/InvenTree/company/templates/company/partdetail.html b/InvenTree/company/templates/company/partdetail.html index 1b101ec48e..2237f0848d 100644 --- a/InvenTree/company/templates/company/partdetail.html +++ b/InvenTree/company/templates/company/partdetail.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "company/supplier_part_base.html" %} {% load static %} {% load i18n %} @@ -6,33 +6,9 @@ InvenTree | {{ company.name }} - {% trans "Parts" %} {% endblock %} -{% block content %} +{% block details %} -
-
-

{% trans "Supplier Part" %}

-
-
- - -
-
-
-
-
- -
-
-
+{% include "company/supplier_part_tabs.html" with tab='details' %}
@@ -120,23 +96,7 @@ InvenTree | {{ company.name }} - {% trans "Parts" %} {% block js_ready %} {{ block.super }} - $('#edit-part').click(function () { - launchModalForm( - "{% url 'supplier-part-edit' part.id %}", - { - reload: true - } - ); - }); - - $('#delete-part').click(function() { - launchModalForm( - "{% url 'supplier-part-delete' %}?part={{ part.id }}", - { - redirect: "{% url 'company-detail-parts' part.supplier.id %}" - } - ); - }); + $('#new-price-break').click(function() { launchModalForm("{% url 'price-break-create' %}", diff --git a/InvenTree/company/templates/company/supplier_part_base.html b/InvenTree/company/templates/company/supplier_part_base.html new file mode 100644 index 0000000000..f7e6ce88cc --- /dev/null +++ b/InvenTree/company/templates/company/supplier_part_base.html @@ -0,0 +1,68 @@ +{% extends "base.html" %} +{% load static %} +{% load i18n %} + +{% block page_title %} +InvenTree | {% trans "Supplier Part" %} +{% endblock %} + +{% block content %} + +
+
+

{% trans "Supplier Part" %}

+
+
+ + +
+
+
+
+
+ +
+
+
+ +
+ +
+ {% block details %} + + {% endblock %} +
+ +{% endblock %} + +{% block js_ready %} +{{ block.super }} + +$('#edit-part').click(function () { + launchModalForm( + "{% url 'supplier-part-edit' part.id %}", + { + reload: true + } + ); +}); + +$('#delete-part').click(function() { + launchModalForm( + "{% url 'supplier-part-delete' %}?part={{ part.id }}", + { + redirect: "{% url 'company-detail-parts' part.supplier.id %}" + } + ); +}); + +{% endblock %} \ No newline at end of file diff --git a/InvenTree/company/templates/company/supplier_part_tabs.html b/InvenTree/company/templates/company/supplier_part_tabs.html new file mode 100644 index 0000000000..a7c33d22a5 --- /dev/null +++ b/InvenTree/company/templates/company/supplier_part_tabs.html @@ -0,0 +1,19 @@ +{% load i18n %} + + \ No newline at end of file