diff --git a/InvenTree/plugin/integration.py b/InvenTree/plugin/integration.py index de95adb8f8..7797134b14 100644 --- a/InvenTree/plugin/integration.py +++ b/InvenTree/plugin/integration.py @@ -94,6 +94,14 @@ class IntegrationPluginBase(MixinBase, plugin_base.InvenTreePluginBase): """ return getattr(self, 'is_package', False) + @property + def is_sample(self): + """ + Is this plugin part of the samples? + """ + path = str(self.package_path) + return path.startswith('plugin/samples/') + # region properties @property def slug(self): diff --git a/InvenTree/templates/InvenTree/settings/plugin.html b/InvenTree/templates/InvenTree/settings/plugin.html index 139ce0d41a..3ea8d9734c 100644 --- a/InvenTree/templates/InvenTree/settings/plugin.html +++ b/InvenTree/templates/InvenTree/settings/plugin.html @@ -76,6 +76,12 @@ {% endfor %} {% endif %} + {% if plugin.is_sample %} + + {% trans "code sample" %} + + {% endif %} + {% if plugin.website %} {% endif %}