diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 7d9633ced6..cf53667fb9 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -73,11 +73,17 @@ settings_urls = [ url(r'^.*$', SettingsView.as_view(template_name='InvenTree/settings/user.html'), name='settings'), ] +dynamic_javascript_urls = [ +] + urlpatterns = [ url(r'^part/', include(part_urls)), url(r'^supplier-part/', include(supplier_part_urls)), url(r'^price-break/', include(price_break_urls)), + # "Dynamic" javascript files which are rendered using InvenTree templating. + url(r'^dynamic/', include(dynamic_javascript_urls)), + url(r'^common/', include(common_urls)), url(r'^stock/', include(stock_urls)), diff --git a/InvenTree/build/urls.py b/InvenTree/build/urls.py index 5d23c55a2d..d8cb3c03ea 100644 --- a/InvenTree/build/urls.py +++ b/InvenTree/build/urls.py @@ -6,16 +6,6 @@ from django.conf.urls import url, include from . import views -build_item_detail_urls = [ - url('^edit/?', views.BuildItemEdit.as_view(), name='build-item-edit'), - url('^delete/?', views.BuildItemDelete.as_view(), name='build-item-delete'), -] - -build_item_urls = [ - url(r'^(?P\d+)/', include(build_item_detail_urls)), - url('^new/', views.BuildItemCreate.as_view(), name='build-item-create'), -] - build_detail_urls = [ url(r'^edit/', views.BuildUpdate.as_view(), name='build-edit'), url(r'^allocate/', views.BuildAllocate.as_view(), name='build-allocate'), @@ -33,7 +23,13 @@ build_detail_urls = [ ] build_urls = [ - url(r'item/', include(build_item_urls)), + url(r'item/', include([ + url(r'^(?P\d+)/', include([ + url('^edit/?', views.BuildItemEdit.as_view(), name='build-item-edit'), + url('^delete/?', views.BuildItemDelete.as_view(), name='build-item-delete'), + ])), + url('^new/', views.BuildItemCreate.as_view(), name='build-item-create'), + ])), url(r'new/', views.BuildCreate.as_view(), name='build-create'), diff --git a/InvenTree/order/urls.py b/InvenTree/order/urls.py index f390c23f54..87b8e9e0e4 100644 --- a/InvenTree/order/urls.py +++ b/InvenTree/order/urls.py @@ -9,12 +9,6 @@ from django.conf.urls import url, include from . import views -purchase_order_attachment_urls = [ - url(r'^new/', views.PurchaseOrderAttachmentCreate.as_view(), name='po-attachment-create'), - url(r'^(?P\d+)/edit/', views.PurchaseOrderAttachmentEdit.as_view(), name='po-attachment-edit'), - url(r'^(?P\d+)/delete/', views.PurchaseOrderAttachmentDelete.as_view(), name='po-attachment-delete'), -] - purchase_order_detail_urls = [ url(r'^cancel/', views.PurchaseOrderCancel.as_view(), name='po-cancel'), @@ -31,19 +25,6 @@ purchase_order_detail_urls = [ url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='po-detail'), ] -po_line_item_detail_urls = [ - - url(r'^edit/', views.POLineItemEdit.as_view(), name='po-line-item-edit'), - url(r'^delete/', views.POLineItemDelete.as_view(), name='po-line-item-delete'), -] - -po_line_urls = [ - - url(r'^new/', views.POLineItemCreate.as_view(), name='po-line-item-create'), - - url(r'^(?P\d+)/', include(po_line_item_detail_urls)), -] - purchase_order_urls = [ url(r'^new/', views.PurchaseOrderCreate.as_view(), name='po-create'), @@ -53,30 +34,24 @@ purchase_order_urls = [ # Display detail view for a single purchase order url(r'^(?P\d+)/', include(purchase_order_detail_urls)), - url(r'^line/', include(po_line_urls)), + url(r'^line/', include([ + url(r'^new/', views.POLineItemCreate.as_view(), name='po-line-item-create'), + url(r'^(?P\d+)/', include([ + url(r'^edit/', views.POLineItemEdit.as_view(), name='po-line-item-edit'), + url(r'^delete/', views.POLineItemDelete.as_view(), name='po-line-item-delete'), + ])), + ])), - url(r'^attachments/', include(purchase_order_attachment_urls)), + url(r'^attachments/', include([ + url(r'^new/', views.PurchaseOrderAttachmentCreate.as_view(), name='po-attachment-create'), + url(r'^(?P\d+)/edit/', views.PurchaseOrderAttachmentEdit.as_view(), name='po-attachment-edit'), + url(r'^(?P\d+)/delete/', views.PurchaseOrderAttachmentDelete.as_view(), name='po-attachment-delete'), + ])), # Display complete list of purchase orders url(r'^.*$', views.PurchaseOrderIndex.as_view(), name='po-index'), ] - -so_line_urls = [ - url(r'^new/', views.SOLineItemCreate.as_view(), name='so-line-item-create'), - url(r'^(?P\d+)/', include([ - url(r'^edit/', views.SOLineItemEdit.as_view(), name='so-line-item-edit'), - url(r'^delete/', views.SOLineItemDelete.as_view(), name='so-line-item-delete'), - ])), -] - -sales_order_attachment_urls = [ - url(r'^new/', views.SalesOrderAttachmentCreate.as_view(), name='so-attachment-create'), - url(r'^(?P\d+)/edit/', views.SalesOrderAttachmentEdit.as_view(), name='so-attachment-edit'), - url(r'^(?P\d+)/delete/', views.SalesOrderAttachmentDelete.as_view(), name='so-attachment-delete'), - -] - sales_order_detail_urls = [ url(r'^edit/', views.SalesOrderEdit.as_view(), name='so-edit'), @@ -91,7 +66,13 @@ sales_order_urls = [ url(r'^new/', views.SalesOrderCreate.as_view(), name='so-create'), - url(r'^line/', include(so_line_urls)), + url(r'^line/', include([ + url(r'^new/', views.SOLineItemCreate.as_view(), name='so-line-item-create'), + url(r'^(?P\d+)/', include([ + url(r'^edit/', views.SOLineItemEdit.as_view(), name='so-line-item-edit'), + url(r'^delete/', views.SOLineItemDelete.as_view(), name='so-line-item-delete'), + ])), + ])), # URLs for sales order allocations url(r'^allocation/', include([ @@ -102,7 +83,11 @@ sales_order_urls = [ ])), ])), - url(r'^attachments/', include(sales_order_attachment_urls)), + url(r'^attachments/', include([ + url(r'^new/', views.SalesOrderAttachmentCreate.as_view(), name='so-attachment-create'), + url(r'^(?P\d+)/edit/', views.SalesOrderAttachmentEdit.as_view(), name='so-attachment-edit'), + url(r'^(?P\d+)/delete/', views.SalesOrderAttachmentDelete.as_view(), name='so-attachment-delete'), + ])), # Display detail view for a single SalesOrder url(r'^(?P\d+)/', include(sales_order_detail_urls)),