From 62501ecb93bda2f8425b892762da58a7cbffc2f4 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 29 Jan 2021 09:48:16 +1100 Subject: [PATCH] Hide main QR button if setting is disabled --- InvenTree/templates/base.html | 4 ++++ InvenTree/templates/navbar.html | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html index f7ee1b2f19..995cd6929d 100644 --- a/InvenTree/templates/base.html +++ b/InvenTree/templates/base.html @@ -2,6 +2,8 @@ {% load i18n %} {% load inventree_extras %} +{% settings_value 'BARCODE_ENABLE' as barcodes %} + @@ -145,9 +147,11 @@ $(document).ready(function () { showCachedAlerts(); + {% if barcodes %} $('#barcode-scan').click(function() { barcodeScanDialog(); }); + {% endif %} }); diff --git a/InvenTree/templates/navbar.html b/InvenTree/templates/navbar.html index 9dafd5769e..6e3fe024ca 100644 --- a/InvenTree/templates/navbar.html +++ b/InvenTree/templates/navbar.html @@ -1,5 +1,9 @@ {% load static %} +{% load inventree_extras %} {% load i18n %} + +{% settings_value 'BARCODE_ENABLE' as barcodes %} + \ No newline at end of file +