diff --git a/InvenTree/plugins/integration.py b/InvenTree/plugins/integration.py index 432fe1c3ac..b55efb732a 100644 --- a/InvenTree/plugins/integration.py +++ b/InvenTree/plugins/integration.py @@ -261,6 +261,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin): AUTHOR = None PUBLISH_DATE = None VERSION = None + WEBSITE = None def __init__(self): super().__init__() @@ -315,6 +316,12 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin): name = getattr(self, 'VERSION', None) return name + @property + def website(self): + """returns website of plugin""" + name = getattr(self, 'WEBSITE', None) + return name + # mixins def mixin(self, key): """check if mixin is registered""" diff --git a/InvenTree/plugins/test_integration.py b/InvenTree/plugins/test_integration.py index de75a48b45..b391c81afd 100644 --- a/InvenTree/plugins/test_integration.py +++ b/InvenTree/plugins/test_integration.py @@ -136,6 +136,7 @@ class IntegrationPluginBaseTests(TestCase): PLUGIN_TITLE = 'a titel' PUBLISH_DATE = "1111-11-11" VERSION = '1.2.3a' + WEBSITE = 'http://aa.bb/cc' self.plugin_name = NameIntegrationPluginBase() @@ -163,3 +164,8 @@ class IntegrationPluginBaseTests(TestCase): self.assertEqual(self.plugin.version, None) self.assertEqual(self.plugin_simple.version, None) self.assertEqual(self.plugin_name.version, '1.2.3a') + + # website + self.assertEqual(self.plugin.website, None) + self.assertEqual(self.plugin_simple.website, None) + self.assertEqual(self.plugin_name.website, 'http://aa.bb/cc') diff --git a/InvenTree/templates/InvenTree/settings/plugin.html b/InvenTree/templates/InvenTree/settings/plugin.html index c2f01789df..69988f902b 100644 --- a/InvenTree/templates/InvenTree/settings/plugin.html +++ b/InvenTree/templates/InvenTree/settings/plugin.html @@ -40,6 +40,10 @@ {% endfor %} {% endif %} + + {% if plugin.website %} + + {% endif %} {{ plugin.author }} {{ plugin.pub_date }} diff --git a/InvenTree/templates/InvenTree/settings/plugin_settings.html b/InvenTree/templates/InvenTree/settings/plugin_settings.html index 5f7e36e9af..a8e7411ad9 100644 --- a/InvenTree/templates/InvenTree/settings/plugin_settings.html +++ b/InvenTree/templates/InvenTree/settings/plugin_settings.html @@ -37,6 +37,13 @@ {% trans "Version" %} {{ plugin.version }}{% include "clip.html" %} + {% if plugin.website %} + + + {% trans "Website" %} + {{ plugin.website }}{% include "clip.html" %} + + {% endif %}

{% trans 'The code information is pulled from the latest git commit for this plugin. It might not reflect official version numbers or information but the actual code running.' %}