mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
website info for plugins
This commit is contained in:
parent
f1fd1d4da8
commit
eeeb69ce12
@ -261,6 +261,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
AUTHOR = None
|
AUTHOR = None
|
||||||
PUBLISH_DATE = None
|
PUBLISH_DATE = None
|
||||||
VERSION = None
|
VERSION = None
|
||||||
|
WEBSITE = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -315,6 +316,12 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
name = getattr(self, 'VERSION', None)
|
name = getattr(self, 'VERSION', None)
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def website(self):
|
||||||
|
"""returns website of plugin"""
|
||||||
|
name = getattr(self, 'WEBSITE', None)
|
||||||
|
return name
|
||||||
|
|
||||||
# mixins
|
# mixins
|
||||||
def mixin(self, key):
|
def mixin(self, key):
|
||||||
"""check if mixin is registered"""
|
"""check if mixin is registered"""
|
||||||
|
@ -136,6 +136,7 @@ class IntegrationPluginBaseTests(TestCase):
|
|||||||
PLUGIN_TITLE = 'a titel'
|
PLUGIN_TITLE = 'a titel'
|
||||||
PUBLISH_DATE = "1111-11-11"
|
PUBLISH_DATE = "1111-11-11"
|
||||||
VERSION = '1.2.3a'
|
VERSION = '1.2.3a'
|
||||||
|
WEBSITE = 'http://aa.bb/cc'
|
||||||
|
|
||||||
self.plugin_name = NameIntegrationPluginBase()
|
self.plugin_name = NameIntegrationPluginBase()
|
||||||
|
|
||||||
@ -163,3 +164,8 @@ class IntegrationPluginBaseTests(TestCase):
|
|||||||
self.assertEqual(self.plugin.version, None)
|
self.assertEqual(self.plugin.version, None)
|
||||||
self.assertEqual(self.plugin_simple.version, None)
|
self.assertEqual(self.plugin_simple.version, None)
|
||||||
self.assertEqual(self.plugin_name.version, '1.2.3a')
|
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')
|
||||||
|
@ -40,6 +40,10 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if plugin.website %}
|
||||||
|
<a href="{{ plugin.website }}"><i class="fas fa-globe"></i></a>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ plugin.author }}</td>
|
<td>{{ plugin.author }}</td>
|
||||||
<td>{{ plugin.pub_date }}</td>
|
<td>{{ plugin.pub_date }}</td>
|
||||||
|
@ -37,6 +37,13 @@
|
|||||||
<td>{% trans "Version" %}</td>
|
<td>{% trans "Version" %}</td>
|
||||||
<td>{{ plugin.version }}{% include "clip.html" %}</td>
|
<td>{{ plugin.version }}{% include "clip.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% if plugin.website %}
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-globe'></span></td>
|
||||||
|
<td>{% trans "Website" %}</td>
|
||||||
|
<td>{{ plugin.website }}{% include "clip.html" %}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p>{% 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.' %}</p>
|
<p>{% 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.' %}</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user