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'>
|
<table class='table table-striped table-condensed'>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for setting in plugin_settings %}
|
{% for setting, value in plugin_settings.items %}
|
||||||
{% include "InvenTree/settings/setting.html" with key=setting plugin=plugin %}
|
{% if not value.hidden %}
|
||||||
|
{% include "InvenTree/settings/setting.html" with key=setting plugin=plugin %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -52,9 +52,17 @@ class PluginWithSettings(SettingsMixin, InvenTreePlugin):
|
|||||||
MaxValueValidator(25)
|
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:
|
This mixin defines the helper functions `plugin.get_setting` and `plugin.set_setting` to access all plugin specific settings:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
Loading…
Reference in New Issue
Block a user