Refactor table_filters javascript file to prevent loading on every single page

This commit is contained in:
Oliver Walters 2020-05-16 21:02:25 +10:00
parent f3c71bd96f
commit fe99e92bfc
3 changed files with 2 additions and 5 deletions

View File

@ -81,6 +81,7 @@ dynamic_javascript_urls = [
url(r'^order.js', DynamicJsView.as_view(template_name='js/order.html'), name='order.js'),
url(r'^company.js', DynamicJsView.as_view(template_name='js/company.html'), name='company.js'),
url(r'^bom.js', DynamicJsView.as_view(template_name='js/bom.html'), name='bom.js'),
url(r'^table_filters.js', DynamicJsView.as_view(template_name='js/table_filters.html'), name='table_filters.js'),
]
urlpatterns = [

View File

@ -114,6 +114,7 @@ InvenTree
<script type='text/javascript' src="{% url 'stock.js' %}"></script>
<script type='text/javascript' src="{% url 'build.js' %}"></script>
<script type='text/javascript' src="{% url 'order.js' %}"></script>
<script type='text/javascript' src="{% url 'table_filters.js' %}"></script>
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
@ -122,8 +123,6 @@ InvenTree
{% block js_load %}
{% endblock %}
{% include "table_filters.html" %}
<script type='text/javascript'>
$(document).ready(function () {

View File

@ -1,8 +1,6 @@
{% load i18n %}
{% load status_codes %}
<script type='text/javascript'>
{% include "status_codes.html" with label='stock' options=StockStatus.list %}
{% include "status_codes.html" with label='build' options=BuildStatus.list %}
{% include "status_codes.html" with label='purchaseOrder' options=PurchaseOrderStatus.list %}
@ -124,4 +122,3 @@ function getAvailableTableFilters(tableKey) {
// Finally, no matching key
return {};
}
</script>