mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add url setting
This commit is contained in:
parent
41ce66df6e
commit
952e7e4554
@ -43,6 +43,7 @@ from .views import AppearanceSelectView, SettingCategorySelectView
|
|||||||
from .views import DynamicJsView
|
from .views import DynamicJsView
|
||||||
|
|
||||||
from common.views import SettingEdit, UserSettingEdit
|
from common.views import SettingEdit, UserSettingEdit
|
||||||
|
from common.models import InvenTreeSetting
|
||||||
|
|
||||||
from .api import InfoView, NotFoundView
|
from .api import InfoView, NotFoundView
|
||||||
from .api import ActionPluginView
|
from .api import ActionPluginView
|
||||||
@ -125,11 +126,12 @@ translated_javascript_urls = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
# Integration plugin urls
|
# Integration plugin urls
|
||||||
integration_plugins = settings.INTEGRATION_PLUGINS
|
|
||||||
interation_urls = []
|
interation_urls = []
|
||||||
for plugin in integration_plugins:
|
if InvenTreeSetting.get_setting('ENABLE_PLUGINS_URL'):
|
||||||
if plugin.mixin_enabled('urls'):
|
integration_plugins = settings.INTEGRATION_PLUGINS
|
||||||
interation_urls.append(plugin.urlpatterns)
|
for plugin in integration_plugins:
|
||||||
|
if plugin.mixin_enabled('urls'):
|
||||||
|
interation_urls.append(plugin.urlpatterns)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^part/', include(part_urls)),
|
url(r'^part/', include(part_urls)),
|
||||||
|
@ -854,7 +854,12 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
|||||||
'default': '',
|
'default': '',
|
||||||
'choices': settings_group_options
|
'choices': settings_group_options
|
||||||
},
|
},
|
||||||
|
'ENABLE_PLUGINS_URL': {
|
||||||
|
'name': _('Enable URL integration'),
|
||||||
|
'description': _('Enable plugins to add URL routes'),
|
||||||
|
'default': False,
|
||||||
|
'validator': bool,
|
||||||
|
},
|
||||||
'ENABLE_PLUGINS_NAVIGATION': {
|
'ENABLE_PLUGINS_NAVIGATION': {
|
||||||
'name': _('Enable navigation integration'),
|
'name': _('Enable navigation integration'),
|
||||||
'description': _('Enable plugins to integrate into navigation'),
|
'description': _('Enable plugins to integrate into navigation'),
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
<table class='table table-striped table-condensed'>
|
<table class='table table-striped table-condensed'>
|
||||||
{% include "InvenTree/settings/header.html" %}
|
{% include "InvenTree/settings/header.html" %}
|
||||||
<tbody>
|
<tbody>
|
||||||
|
{% include "InvenTree/settings/setting.html" with key="ENABLE_PLUGINS_URL" %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="ENABLE_PLUGINS_NAVIGATION" %}
|
{% include "InvenTree/settings/setting.html" with key="ENABLE_PLUGINS_NAVIGATION" %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user