add navigation setting

This commit is contained in:
Matthias 2021-10-16 00:32:48 +02:00
parent 32122102e6
commit 41ce66df6e
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
3 changed files with 17 additions and 0 deletions

View File

@ -855,6 +855,12 @@ class InvenTreeSetting(BaseInvenTreeSetting):
'choices': settings_group_options
},
'ENABLE_PLUGINS_NAVIGATION': {
'name': _('Enable navigation integration'),
'description': _('Enable plugins to integrate into navigation'),
'default': False,
'validator': bool,
},
**settings.INTEGRATION_PLUGIN_SETTINGS,
}

View File

@ -12,6 +12,14 @@
{% block content %}
<table class='table table-striped table-condensed'>
{% include "InvenTree/settings/header.html" %}
<tbody>
{% include "InvenTree/settings/setting.html" with key="ENABLE_PLUGINS_NAVIGATION" %}
</tbody>
</table>
<h4>{% trans "Plugin list" %}</h4>
<table class='table table-striped table-condensed'>

View File

@ -4,6 +4,7 @@
{% load i18n %}
{% settings_value 'BARCODE_ENABLE' as barcodes %}
{% settings_value 'ENABLE_PLUGINS_NAVIGATION' as plugin_nav %}
<nav class="navbar navbar-xs navbar-default navbar-fixed-top ">
<div class="container-fluid">
@ -49,6 +50,7 @@
</li>
{% endif %}
{% if plugin_nav %}
{% plugin_list as pl_list %}
{% for plugin_key, plugin in pl_list.items %}
{% mixin_enabled plugin 'navigation' as navigation %}
@ -64,6 +66,7 @@
</li>
{% endif %}
{% endfor %}
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">