diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index d70d9a44be..229ad9cfd1 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -4,7 +4,7 @@ {% load i18n %} {% block menubar %} -{% include "stock/location_navbar.html" with tab="stock" %} +{% include "stock/location_navbar.html" %} {% endblock %} {% block content %} @@ -143,13 +143,39 @@ {% block location_content %} -
+

{% trans "Stock Items" %}

{% include "stock_table.html" %}
+
+
+

{% trans "Sublocations" %}

+
+
+
+
+ + +
+ +
+
+
+ +
+
+
+ {% endblock %}
@@ -164,6 +190,36 @@ toggleId: '#location-menu-toggle' }); + loadStockLocationTable($('#sublocation-table'), { + params: { + {% if location %} + parent: {{ location.pk }}, + {% else %} + parent: 'null', + {% endif %} + } + }); + + linkButtonsToSelection( + $('#sublocation-table'), + [ + '#location-print-options', + ] + ); + + $('#multi-location-print-label').click(function() { + + var selections = $('#sublocation-table').bootstrapTable('getSelections'); + + var locations = []; + + selections.forEach(function(loc) { + locations.push(loc.pk); + }); + + printStockLocationLabels(locations); + }); + {% if location %} $("#barcode-check-in").click(function() { barcodeCheckIn({{ location.id }}); @@ -301,4 +357,10 @@ }, url: "{% url 'api-stock-list' %}", }); + + attachNavCallbacks({ + name: 'stocklocation', + default: 'stock' + }); + {% endblock %} diff --git a/InvenTree/stock/templates/stock/location_navbar.html b/InvenTree/stock/templates/stock/location_navbar.html index a4974d0d37..d03761e460 100644 --- a/InvenTree/stock/templates/stock/location_navbar.html +++ b/InvenTree/stock/templates/stock/location_navbar.html @@ -8,23 +8,15 @@ -
  • - {% if location %} - - {% else %} - - {% endif %} +
  • + {% trans "Sublocations" %}
  • - {% if location %} - - {% else %} - - {% endif %} + {% trans "Stock Items" %} diff --git a/InvenTree/stock/templates/stock/sublocation.html b/InvenTree/stock/templates/stock/sublocation.html deleted file mode 100644 index be9390df3b..0000000000 --- a/InvenTree/stock/templates/stock/sublocation.html +++ /dev/null @@ -1,74 +0,0 @@ -{% extends "stock/location.html" %} - -{% load static %} -{% load i18n %} -{% load inventree_extras %} - -{% block menubar %} -{% include "stock/location_navbar.html" with tab="sublocations" %} -{% endblock %} - - -{% block location_content %} - -
    -
    -

    {% trans "Sublocations" %}

    -
    - -
    -
    - - -
    - -
    -
    -
    - -
    -
    - -{% endblock %} - -{% block js_ready %} -{{ block.super }} - -loadStockLocationTable($('#sublocation-table'), { - params: { - {% if location %} - parent: {{ location.pk }}, - {% else %} - parent: 'null', - {% endif %} - } -}); - -linkButtonsToSelection( - $('#sublocation-table'), - [ - '#location-print-options', - ] -); - -$('#multi-location-print-label').click(function() { - - var selections = $('#sublocation-table').bootstrapTable('getSelections'); - - var locations = []; - - selections.forEach(function(loc) { - locations.push(loc.pk); - }); - - printStockLocationLabels(locations); -}) - -{% endblock %} \ No newline at end of file diff --git a/InvenTree/stock/urls.py b/InvenTree/stock/urls.py index 67101c1f3b..adae836d92 100644 --- a/InvenTree/stock/urls.py +++ b/InvenTree/stock/urls.py @@ -14,9 +14,7 @@ location_urls = [ url(r'^edit/?', views.StockLocationEdit.as_view(), name='stock-location-edit'), url(r'^delete/?', views.StockLocationDelete.as_view(), name='stock-location-delete'), url(r'^qr_code/?', views.StockLocationQRCode.as_view(), name='stock-location-qr'), - - url(r'sublocation/', views.StockLocationDetail.as_view(template_name='stock/sublocation.html'), name='stock-location-sublocation'), - + # Anything else url('^.*$', views.StockLocationDetail.as_view(), name='stock-location-detail'), ])),