diff --git a/InvenTree/InvenTree/static/script/inventree/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js index f0d65b9131..0f06ea98ac 100644 --- a/InvenTree/InvenTree/static/script/inventree/inventree.js +++ b/InvenTree/InvenTree/static/script/inventree/inventree.js @@ -127,13 +127,6 @@ function inventreeDocReady() { loadBrandIcon($(this), $(this).attr('brand_name')); }); - // Callback for "admin view" button - $('#admin-button, .admin-button').click(function() { - var url = $(this).attr('url'); - - location.href = url; - }); - // Display any cached alert messages showCachedAlerts(); diff --git a/InvenTree/templates/admin_button.html b/InvenTree/templates/admin_button.html index 221d7f6c8e..abc3d2d91c 100644 --- a/InvenTree/templates/admin_button.html +++ b/InvenTree/templates/admin_button.html @@ -1,4 +1,12 @@ +{% load inventree_extras %} {% load i18n %} - + +{% inventree_customize 'hide_admin_link' as hidden %} + +{% if not hidden and user.is_staff %} + + + +{% endif %}