From fd4f33d45b877ed46ea07d769672639acfb13919 Mon Sep 17 00:00:00 2001 From: eeintech Date: Wed, 24 Mar 2021 12:39:26 -0400 Subject: [PATCH] More templates updates --- .../company/manufacturer_part_base.html | 2 ++ .../company/manufacturer_part_delete.html | 31 +++++++++++++++++++ .../company/manufacturer_part_detail.html | 2 +- .../company/manufacturer_part_navbar.html | 27 ++++++++++++++++ ...tdelete.html => supplier_part_delete.html} | 7 +++-- .../company/supplier_part_detail.html | 2 +- ..._navbar.html => supplier_part_navbar.html} | 0 .../company/supplier_part_orders.html | 2 +- .../company/supplier_part_pricing.html | 2 +- .../company/supplier_part_stock.html | 2 +- InvenTree/company/views.py | 6 ++-- 11 files changed, 73 insertions(+), 10 deletions(-) create mode 100644 InvenTree/company/templates/company/manufacturer_part_delete.html create mode 100644 InvenTree/company/templates/company/manufacturer_part_navbar.html rename InvenTree/company/templates/company/{partdelete.html => supplier_part_delete.html} (92%) rename InvenTree/company/templates/company/{part_navbar.html => supplier_part_navbar.html} (100%) diff --git a/InvenTree/company/templates/company/manufacturer_part_base.html b/InvenTree/company/templates/company/manufacturer_part_base.html index 7b0b579d1d..5c6e6c6b1d 100644 --- a/InvenTree/company/templates/company/manufacturer_part_base.html +++ b/InvenTree/company/templates/company/manufacturer_part_base.html @@ -31,11 +31,13 @@ src="{% static 'img/blank_image.png' %}" {% if roles.purchase_order.change %}
+ {% comment "for later" %} {% if roles.purchase_order.add %} {% endif %} + {% endcomment %} diff --git a/InvenTree/company/templates/company/manufacturer_part_delete.html b/InvenTree/company/templates/company/manufacturer_part_delete.html new file mode 100644 index 0000000000..30eab3b591 --- /dev/null +++ b/InvenTree/company/templates/company/manufacturer_part_delete.html @@ -0,0 +1,31 @@ +{% extends "modal_delete_form.html" %} +{% load i18n %} + +{% block pre_form_content %} +{% trans "Are you sure you want to delete the following Manufacturer Parts?" %} + +
+{% endblock %} + +{% block form_data %} + +{% for part in parts %} + + + + + + + +{% endfor %} +
+ {% include "hover_image.html" with image=part.part.image %} + {{ part.part.full_name }} + + {% include "hover_image.html" with image=part.manufacturer.image %} + {{ part.manufacturer.name }} + + {{ part.MPN }} +
+ +{% endblock %} \ No newline at end of file diff --git a/InvenTree/company/templates/company/manufacturer_part_detail.html b/InvenTree/company/templates/company/manufacturer_part_detail.html index f2bcfea963..f351f955dc 100644 --- a/InvenTree/company/templates/company/manufacturer_part_detail.html +++ b/InvenTree/company/templates/company/manufacturer_part_detail.html @@ -3,7 +3,7 @@ {% load i18n %} {% block menubar %} -{% include "company/part_navbar.html" with tab='details' %} +{% include "company/manufacturer_part_navbar.html" with tab='details' %} {% endblock %} {% block heading %} diff --git a/InvenTree/company/templates/company/manufacturer_part_navbar.html b/InvenTree/company/templates/company/manufacturer_part_navbar.html new file mode 100644 index 0000000000..31430e7e6e --- /dev/null +++ b/InvenTree/company/templates/company/manufacturer_part_navbar.html @@ -0,0 +1,27 @@ +{% load i18n %} + + \ No newline at end of file diff --git a/InvenTree/company/templates/company/partdelete.html b/InvenTree/company/templates/company/supplier_part_delete.html similarity index 92% rename from InvenTree/company/templates/company/partdelete.html rename to InvenTree/company/templates/company/supplier_part_delete.html index 8eed487697..b44e7c0610 100644 --- a/InvenTree/company/templates/company/partdelete.html +++ b/InvenTree/company/templates/company/supplier_part_delete.html @@ -13,13 +13,16 @@ + + {% include "hover_image.html" with image=part.part.image %} + {{ part.part.full_name }} + {% include "hover_image.html" with image=part.supplier.image %} {{ part.supplier.name }} - {% include "hover_image.html" with image=part.part.image %} - {{ part.part.full_name }} + {{ part.SKU }} {% endfor %} diff --git a/InvenTree/company/templates/company/supplier_part_detail.html b/InvenTree/company/templates/company/supplier_part_detail.html index d3b94f0ad5..7a8ac0dcd3 100644 --- a/InvenTree/company/templates/company/supplier_part_detail.html +++ b/InvenTree/company/templates/company/supplier_part_detail.html @@ -3,7 +3,7 @@ {% load i18n %} {% block menubar %} -{% include "company/part_navbar.html" with tab='details' %} +{% include "company/supplier_part_navbar.html" with tab='details' %} {% endblock %} {% block heading %} diff --git a/InvenTree/company/templates/company/part_navbar.html b/InvenTree/company/templates/company/supplier_part_navbar.html similarity index 100% rename from InvenTree/company/templates/company/part_navbar.html rename to InvenTree/company/templates/company/supplier_part_navbar.html diff --git a/InvenTree/company/templates/company/supplier_part_orders.html b/InvenTree/company/templates/company/supplier_part_orders.html index ae4b025b11..932f61f30f 100644 --- a/InvenTree/company/templates/company/supplier_part_orders.html +++ b/InvenTree/company/templates/company/supplier_part_orders.html @@ -3,7 +3,7 @@ {% load i18n %} {% block menubar %} -{% include "company/part_navbar.html" with tab='orders' %} +{% include "company/supplier_part_navbar.html" with tab='orders' %} {% endblock %} {% block heading %} diff --git a/InvenTree/company/templates/company/supplier_part_pricing.html b/InvenTree/company/templates/company/supplier_part_pricing.html index 2314b5cfcf..a674837650 100644 --- a/InvenTree/company/templates/company/supplier_part_pricing.html +++ b/InvenTree/company/templates/company/supplier_part_pricing.html @@ -4,7 +4,7 @@ {% load inventree_extras %} {% block menubar %} -{% include "company/part_navbar.html" with tab='pricing' %} +{% include "company/supplier_part_navbar.html" with tab='pricing' %} {% endblock %} {% block heading %} diff --git a/InvenTree/company/templates/company/supplier_part_stock.html b/InvenTree/company/templates/company/supplier_part_stock.html index 49a5a809c2..170b9f8e82 100644 --- a/InvenTree/company/templates/company/supplier_part_stock.html +++ b/InvenTree/company/templates/company/supplier_part_stock.html @@ -3,7 +3,7 @@ {% load i18n %} {% block menubar %} -{% include "company/part_navbar.html" with tab='stock' %} +{% include "company/supplier_part_navbar.html" with tab='stock' %} {% endblock %} {% block heading %} diff --git a/InvenTree/company/views.py b/InvenTree/company/views.py index 015e5e248c..dbcc5948da 100644 --- a/InvenTree/company/views.py +++ b/InvenTree/company/views.py @@ -436,7 +436,7 @@ class ManufacturerPartDelete(AjaxDeleteView): """ success_url = '/manufacturer/' - ajax_template_name = 'company/partdelete.html' + ajax_template_name = 'company/manufacturer_part_delete.html' ajax_form_title = _('Delete Manufacturer Part') role_required = 'purchase_order.delete' @@ -460,7 +460,7 @@ class ManufacturerPartDelete(AjaxDeleteView): if 'part' in self.request.GET: try: self.parts.append(ManufacturerPart.objects.get(pk=self.request.GET.get('part'))) - except (ValueError, SupplierPart.DoesNotExist): + except (ValueError, ManufacturerPart.DoesNotExist): pass elif 'parts[]' in self.request.GET: @@ -666,7 +666,7 @@ class SupplierPartDelete(AjaxDeleteView): """ success_url = '/supplier/' - ajax_template_name = 'company/partdelete.html' + ajax_template_name = 'company/supplier_part_delete.html' ajax_form_title = _('Delete Supplier Part') role_required = 'purchase_order.delete'