mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds 'locate item' and 'locate location' buttons
This commit is contained in:
parent
256af802e2
commit
4704db5183
@ -44,6 +44,12 @@ def mixin_enabled(plugin, key, *args, **kwargs):
|
||||
"""
|
||||
return plugin.mixin_enabled(key)
|
||||
|
||||
@register.simple_tag()
|
||||
def mixin_available(mixin, *args, **kwargs):
|
||||
"""
|
||||
Returns True if there is at least one active plugin which supports the provided mixin
|
||||
"""
|
||||
return len(registry.with_mixin(mixin)) > 0
|
||||
|
||||
@register.simple_tag()
|
||||
def navigation_enabled(*args, **kwargs):
|
||||
|
@ -1,5 +1,6 @@
|
||||
{% extends "page_base.html" %}
|
||||
{% load static %}
|
||||
{% load plugin_extras %}
|
||||
{% load inventree_extras %}
|
||||
{% load status_codes %}
|
||||
{% load i18n %}
|
||||
@ -18,7 +19,6 @@
|
||||
<div id="breadcrumb-tree"></div>
|
||||
{% endblock breadcrumb_tree %}
|
||||
|
||||
|
||||
{% block heading %}
|
||||
{% trans "Stock Item" %}: {{ item.part.full_name}}
|
||||
{% endblock heading %}
|
||||
@ -29,6 +29,12 @@
|
||||
{% url 'admin:stock_stockitem_change' item.pk as url %}
|
||||
{% include "admin_button.html" with url=url %}
|
||||
{% endif %}
|
||||
{% mixin_available "locate" as locate_available %}
|
||||
{% if plugins_enabled and locate_available %}
|
||||
<button id='locate-item-button' title='{% trans "Identify stock item" %}' class='btn btn-outline-secondary' typy='button'>
|
||||
<span class='fas fa-search-location'></span>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if barcodes %}
|
||||
<!-- Barcode actions menu -->
|
||||
<div class='btn-group' role='group'>
|
||||
|
@ -1,6 +1,7 @@
|
||||
{% extends "stock/stock_app_base.html" %}
|
||||
{% load static %}
|
||||
{% load inventree_extras %}
|
||||
{% load plugin_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block sidebar %}
|
||||
@ -27,6 +28,14 @@
|
||||
{% include "admin_button.html" with url=url %}
|
||||
{% endif %}
|
||||
|
||||
{% mixin_available "locate" as locate_available %}
|
||||
{% if plugins_enabled and locate_available %}
|
||||
<button id='locate-location-button' title='{% trans "Identify stock location" %}' class='btn btn-outline-secondary' typy='button'>
|
||||
<span class='fas fa-search-location'></span>
|
||||
</button>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if barcodes %}
|
||||
<!-- Barcode actions menu -->
|
||||
{% if location %}
|
||||
|
@ -2,6 +2,7 @@
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
{% plugins_enabled as plugins_enabled %}
|
||||
{% settings_value 'BARCODE_ENABLE' as barcodes %}
|
||||
{% settings_value 'REPORT_ENABLE_TEST_REPORT' as test_report_enabled %}
|
||||
{% settings_value "REPORT_ENABLE" as report_enabled %}
|
||||
|
Loading…
Reference in New Issue
Block a user