From 0654fa7cc9d10456c6c39a21fab3bf8275b9748a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 23:35:06 +1000 Subject: [PATCH 1/5] Deleted unused forms in Build - These now use modal forms - Removed redundant templates --- InvenTree/build/templates/build/create.html | 5 ----- InvenTree/build/templates/build/update.html | 5 ----- InvenTree/build/views.py | 2 -- 3 files changed, 12 deletions(-) delete mode 100644 InvenTree/build/templates/build/create.html delete mode 100644 InvenTree/build/templates/build/update.html diff --git a/InvenTree/build/templates/build/create.html b/InvenTree/build/templates/build/create.html deleted file mode 100644 index b53fc58fec..0000000000 --- a/InvenTree/build/templates/build/create.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Create a new build -{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/templates/build/update.html b/InvenTree/build/templates/build/update.html deleted file mode 100644 index c5691d145f..0000000000 --- a/InvenTree/build/templates/build/update.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Edit build details -{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/views.py b/InvenTree/build/views.py index 0344de81ed..f3f7bd79f3 100644 --- a/InvenTree/build/views.py +++ b/InvenTree/build/views.py @@ -70,7 +70,6 @@ class BuildAllocate(DetailView): class BuildCreate(AjaxCreateView): model = Build - template_name = 'build/create.html' context_object_name = 'build' form_class = EditBuildForm ajax_form_title = 'Start new Build' @@ -96,7 +95,6 @@ class BuildUpdate(AjaxUpdateView): model = Build form_class = EditBuildForm context_object_name = 'build' - template_name = 'build/update.html' ajax_form_title = 'Edit Build Details' ajax_template_name = 'modal_form.html' From e57303ed373d1cd90f0018afd3bfda195d62ada2 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 23:35:20 +1000 Subject: [PATCH 2/5] Removed old forms from Company --- InvenTree/company/templates/company/create.html | 5 ----- InvenTree/company/templates/company/edit.html | 5 ----- InvenTree/company/views.py | 4 +--- 3 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 InvenTree/company/templates/company/create.html delete mode 100644 InvenTree/company/templates/company/edit.html diff --git a/InvenTree/company/templates/company/create.html b/InvenTree/company/templates/company/create.html deleted file mode 100644 index b01ab9e9f9..0000000000 --- a/InvenTree/company/templates/company/create.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Create a new supplier -{% endblock %} diff --git a/InvenTree/company/templates/company/edit.html b/InvenTree/company/templates/company/edit.html deleted file mode 100644 index e043fdb211..0000000000 --- a/InvenTree/company/templates/company/edit.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Edit details for company '{{ company.name }}' -{% endblock %} \ No newline at end of file diff --git a/InvenTree/company/views.py b/InvenTree/company/views.py index 9042578baf..5a80e5ea15 100644 --- a/InvenTree/company/views.py +++ b/InvenTree/company/views.py @@ -51,7 +51,6 @@ class CompanyImage(AjaxUpdateView): class CompanyEdit(AjaxUpdateView): model = Company form_class = EditCompanyForm - template_name = 'company/edit.html' context_object_name = 'company' ajax_template_name = 'modal_form.html' ajax_form_title = 'Edit Company' @@ -66,7 +65,6 @@ class CompanyCreate(AjaxCreateView): model = Company context_object_name = 'company' form_class = EditCompanyForm - template_name = "company/create.html" ajax_template_name = 'modal_form.html' ajax_form_title = "Create new Company" @@ -79,7 +77,7 @@ class CompanyCreate(AjaxCreateView): class CompanyDelete(AjaxDeleteView): model = Company success_url = '/company/' - template_name = 'company/delete.html' + ajax_template_name = 'company/delete.html' ajax_form_title = 'Delete Company' def get_data(self): From 4f51258cf8892662e7a925135327f799180659ac Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 23:39:05 +1000 Subject: [PATCH 3/5] Removed old forms in Part --- InvenTree/company/templates/company/partcreate.html | 5 ----- InvenTree/company/templates/company/partedit.html | 5 ----- InvenTree/part/templates/part/bom-create.html | 5 ----- InvenTree/part/templates/part/bom-edit.html | 5 ----- InvenTree/part/templates/part/category_edit.html | 5 ----- InvenTree/part/templates/part/category_new.html | 5 ----- InvenTree/part/templates/part/create.html | 5 ----- InvenTree/part/templates/part/delete.html | 12 ------------ InvenTree/part/templates/part/edit.html | 5 ----- InvenTree/part/views.py | 11 +---------- 10 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 InvenTree/company/templates/company/partcreate.html delete mode 100644 InvenTree/company/templates/company/partedit.html delete mode 100644 InvenTree/part/templates/part/bom-create.html delete mode 100644 InvenTree/part/templates/part/bom-edit.html delete mode 100644 InvenTree/part/templates/part/category_edit.html delete mode 100644 InvenTree/part/templates/part/category_new.html delete mode 100644 InvenTree/part/templates/part/create.html delete mode 100644 InvenTree/part/templates/part/delete.html delete mode 100644 InvenTree/part/templates/part/edit.html diff --git a/InvenTree/company/templates/company/partcreate.html b/InvenTree/company/templates/company/partcreate.html deleted file mode 100644 index bee5cbefc8..0000000000 --- a/InvenTree/company/templates/company/partcreate.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Create a new supplier part -{% endblock %} \ No newline at end of file diff --git a/InvenTree/company/templates/company/partedit.html b/InvenTree/company/templates/company/partedit.html deleted file mode 100644 index f4c78cd39d..0000000000 --- a/InvenTree/company/templates/company/partedit.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Edit supplier part '{{ part.SKU }}' -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/bom-create.html b/InvenTree/part/templates/part/bom-create.html deleted file mode 100644 index 7db3161c84..0000000000 --- a/InvenTree/part/templates/part/bom-create.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends 'create_edit_obj.html' %} - -{% block obj_title %} -Create a new BOM item -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/bom-edit.html b/InvenTree/part/templates/part/bom-edit.html deleted file mode 100644 index 91a503004c..0000000000 --- a/InvenTree/part/templates/part/bom-edit.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends 'create_edit_obj.html' %} - -{% block obj_title %} -Edit details for BOM item -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/category_edit.html b/InvenTree/part/templates/part/category_edit.html deleted file mode 100644 index fb71df0161..0000000000 --- a/InvenTree/part/templates/part/category_edit.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Edit category '{{ category.name }}' -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/category_new.html b/InvenTree/part/templates/part/category_new.html deleted file mode 100644 index 807352cd58..0000000000 --- a/InvenTree/part/templates/part/category_new.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Create a new part category{% if category %} in category '{{ category.name }}'{% endif %} -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/create.html b/InvenTree/part/templates/part/create.html deleted file mode 100644 index 1b6fc8ae89..0000000000 --- a/InvenTree/part/templates/part/create.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Create a new part{% if category %} in category '{{ category.name }}'{% endif %} -{% endblock %} diff --git a/InvenTree/part/templates/part/delete.html b/InvenTree/part/templates/part/delete.html deleted file mode 100644 index 9e38b07be4..0000000000 --- a/InvenTree/part/templates/part/delete.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "delete_obj.html" %} - - -{% block del_title %} - Are you sure you want to delete part '{{ part.name }}'? -{% endblock %} - -{% block del_body %} - - {$ include 'part/partial_delete' with part=part %} - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/templates/part/edit.html b/InvenTree/part/templates/part/edit.html deleted file mode 100644 index 63917e7846..0000000000 --- a/InvenTree/part/templates/part/edit.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Edit details for part '{{ part.name }}' -{% endblock %} \ No newline at end of file diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 31bedc5c56..5c5ad4f0a2 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -49,8 +49,6 @@ class PartCreate(AjaxCreateView): """ model = Part form_class = EditPartForm - template_name = 'part/create.html' - ajax_form_title = 'Create new part' ajax_template_name = 'modal_form.html' @@ -117,7 +115,6 @@ class PartImage(AjaxUpdateView): class PartEdit(AjaxUpdateView): model = Part - template_name = 'part/edit.html' form_class = EditPartForm ajax_template_name = 'modal_form.html' ajax_form_title = 'Edit Part Properties' @@ -203,7 +200,6 @@ class BomDownload(AjaxView): class PartDelete(AjaxDeleteView): model = Part - template_name = 'part/delete.html' ajax_template_name = 'part/partial_delete.html' ajax_form_title = 'Confirm Part Deletion' context_object_name = 'part' @@ -225,7 +221,6 @@ class CategoryDetail(DetailView): class CategoryEdit(AjaxUpdateView): model = PartCategory - template_name = 'part/category_edit.html' form_class = EditCategoryForm ajax_template_name = 'modal_form.html' ajax_form_title = 'Edit Part Category' @@ -240,7 +235,7 @@ class CategoryEdit(AjaxUpdateView): class CategoryDelete(AjaxDeleteView): model = PartCategory - template_name = 'part/category_delete.html' + ajax_template_name = 'part/category_delete.html' context_object_name = 'category' success_url = '/part/' @@ -255,7 +250,6 @@ class CategoryCreate(AjaxCreateView): ajax_form_action = reverse_lazy('category-create') ajax_form_title = 'Create new part category' ajax_template_name = 'modal_form.html' - template_name = 'part/category_new.html' form_class = EditCategoryForm def get_context_data(self, **kwargs): @@ -288,7 +282,6 @@ class BomItemDetail(DetailView): class BomItemCreate(AjaxCreateView): model = BomItem form_class = EditBomItemForm - template_name = 'part/bom-create.html' ajax_template_name = 'modal_form.html' ajax_form_title = 'Create BOM item' @@ -308,7 +301,6 @@ class BomItemCreate(AjaxCreateView): class BomItemEdit(AjaxUpdateView): model = BomItem form_class = EditBomItemForm - template_name = 'part/bom-edit.html' ajax_template_name = 'modal_form.html' ajax_form_title = 'Edit BOM item' @@ -329,7 +321,6 @@ class SupplierPartDetail(DetailView): class SupplierPartEdit(AjaxUpdateView): model = SupplierPart - template_name = 'company/partedit.html' context_object_name = 'part' form_class = EditSupplierPartForm ajax_template_name = 'modal_form.html' From 9e9aa02b909ef22557e2ed77699a106d14efef1c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 23:41:17 +1000 Subject: [PATCH 4/5] Remove old templates from Stock --- InvenTree/stock/templates/stock/item_create.html | 5 ----- InvenTree/stock/templates/stock/item_edit.html | 5 ----- InvenTree/stock/templates/stock/location_create.html | 5 ----- InvenTree/stock/templates/stock/location_edit.html | 5 ----- InvenTree/stock/views.py | 4 ---- 5 files changed, 24 deletions(-) delete mode 100644 InvenTree/stock/templates/stock/item_create.html delete mode 100644 InvenTree/stock/templates/stock/item_edit.html delete mode 100644 InvenTree/stock/templates/stock/location_create.html delete mode 100644 InvenTree/stock/templates/stock/location_edit.html diff --git a/InvenTree/stock/templates/stock/item_create.html b/InvenTree/stock/templates/stock/item_create.html deleted file mode 100644 index 862acc859b..0000000000 --- a/InvenTree/stock/templates/stock/item_create.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Create a new stock item -{% endblock %} \ No newline at end of file diff --git a/InvenTree/stock/templates/stock/item_edit.html b/InvenTree/stock/templates/stock/item_edit.html deleted file mode 100644 index 5f0de213b9..0000000000 --- a/InvenTree/stock/templates/stock/item_edit.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Edit stock item for part '{{ item.part.name }}' -{% endblock %} \ No newline at end of file diff --git a/InvenTree/stock/templates/stock/location_create.html b/InvenTree/stock/templates/stock/location_create.html deleted file mode 100644 index c79e09ae70..0000000000 --- a/InvenTree/stock/templates/stock/location_create.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Create a new stock location -{% endblock %} \ No newline at end of file diff --git a/InvenTree/stock/templates/stock/location_edit.html b/InvenTree/stock/templates/stock/location_edit.html deleted file mode 100644 index d2fbdbb84e..0000000000 --- a/InvenTree/stock/templates/stock/location_edit.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Edit stock location '{{ location.name }}' -{% endblock %} \ No newline at end of file diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index c4bf870e1c..9035e3e845 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -67,7 +67,6 @@ class StockLocationEdit(AjaxUpdateView): model = StockLocation form_class = EditStockLocationForm - template_name = 'stock/location_edit.html' context_object_name = 'location' ajax_template_name = 'modal_form.html' ajax_form_title = 'Edit Stock Location' @@ -80,7 +79,6 @@ class StockItemEdit(AjaxUpdateView): model = StockItem form_class = EditStockItemForm - # template_name = 'stock/item_edit.html' context_object_name = 'item' ajax_template_name = 'modal_form.html' ajax_form_title = 'Edit Stock Item' @@ -94,7 +92,6 @@ class StockLocationCreate(AjaxCreateView): model = StockLocation form_class = EditStockLocationForm - template_name = 'stock/location_create.html' context_object_name = 'location' ajax_template_name = 'modal_form.html' ajax_form_title = 'Create new Stock Location' @@ -120,7 +117,6 @@ class StockItemCreate(AjaxCreateView): model = StockItem form_class = CreateStockItemForm - template_name = 'stock/item_create.html' context_object_name = 'item' ajax_template_name = 'modal_form.html' ajax_form_title = 'Create new Stock Item' From 41ee6320a8121a9e56d1ab8deb482449ed909020 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 23:44:15 +1000 Subject: [PATCH 5/5] Delete some other old templates --- .../templates/company/order_create.html | 5 ---- InvenTree/templates/create_edit_obj.html | 19 -------------- InvenTree/templates/delete_obj.html | 25 ------------------- 3 files changed, 49 deletions(-) delete mode 100644 InvenTree/company/templates/company/order_create.html delete mode 100644 InvenTree/templates/create_edit_obj.html delete mode 100644 InvenTree/templates/delete_obj.html diff --git a/InvenTree/company/templates/company/order_create.html b/InvenTree/company/templates/company/order_create.html deleted file mode 100644 index d401662ea3..0000000000 --- a/InvenTree/company/templates/company/order_create.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "create_edit_obj.html" %} - -{% block obj_title %} -Create a new supplier purchase order -{% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/create_edit_obj.html b/InvenTree/templates/create_edit_obj.html deleted file mode 100644 index cc18a791b3..0000000000 --- a/InvenTree/templates/create_edit_obj.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "base.html" %} - -{% load static %} - -{% block content %} - -
-
-{% block obj_title %} - Object title goes here -{% endblock %} -
-
-{% load crispy_forms_tags %} -{% crispy form %} -
-
- -{% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/delete_obj.html b/InvenTree/templates/delete_obj.html deleted file mode 100644 index 3cf123330d..0000000000 --- a/InvenTree/templates/delete_obj.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "base.html" %} - -{% block content %} - -
-
-{% block del_title %} -Deletion title goes here -{% endblock %} -
-
-

This is a permanent action and cannot be undone.

- -{% block del_body %} -{% endblock %} - -
{% csrf_token %} - - -
- -
-
- -{% endblock %} \ No newline at end of file