mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add option to hide plugin setting from auto-generated plugin setting page (#4767)
* Add option to hide plugin setting from auto-generated plugin setting page * Change hide to hidden * Added small note to docs about hidden settings Co-authored-by: Oliver <oliver.henry.walters@gmail.com> --------- Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
35d04c0357
commit
d416e57ee3
@ -9,8 +9,10 @@
|
||||
|
||||
<table class='table table-striped table-condensed'>
|
||||
<tbody>
|
||||
{% for setting in plugin_settings %}
|
||||
{% include "InvenTree/settings/setting.html" with key=setting plugin=plugin %}
|
||||
{% for setting, value in plugin_settings.items %}
|
||||
{% if not value.hidden %}
|
||||
{% include "InvenTree/settings/setting.html" with key=setting plugin=plugin %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -52,9 +52,17 @@ class PluginWithSettings(SettingsMixin, InvenTreePlugin):
|
||||
MaxValueValidator(25)
|
||||
]
|
||||
},
|
||||
'HIDDEN_SETTING': {
|
||||
'name': _('Hidden Setting'),
|
||||
'description': _('This setting is hidden from the automatically generated plugin settings page'),
|
||||
'hidden': True,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
!!! tip "Hidden Settings"
|
||||
Plugin settings can be hidden from the settings page by marking them as 'hidden'
|
||||
|
||||
This mixin defines the helper functions `plugin.get_setting` and `plugin.set_setting` to access all plugin specific settings:
|
||||
|
||||
```python
|
||||
|
Loading…
Reference in New Issue
Block a user