mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
adding in license meta
This commit is contained in:
parent
b2478b418a
commit
61f6061edf
@ -275,6 +275,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
PUBLISH_DATE = None
|
PUBLISH_DATE = None
|
||||||
VERSION = None
|
VERSION = None
|
||||||
WEBSITE = None
|
WEBSITE = None
|
||||||
|
LICENSE = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -347,6 +348,12 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
name = getattr(self, 'WEBSITE', None)
|
name = getattr(self, 'WEBSITE', None)
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def license(self):
|
||||||
|
"""returns license of plugin"""
|
||||||
|
license = getattr(self, 'LICENSE', None)
|
||||||
|
return license
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def package_path(self):
|
def package_path(self):
|
||||||
"""returns the path to the plugin"""
|
"""returns the path to the plugin"""
|
||||||
|
@ -166,6 +166,7 @@ class IntegrationPluginBaseTests(TestCase):
|
|||||||
DESCRIPTION = 'A description'
|
DESCRIPTION = 'A description'
|
||||||
VERSION = '1.2.3a'
|
VERSION = '1.2.3a'
|
||||||
WEBSITE = 'http://aa.bb/cc'
|
WEBSITE = 'http://aa.bb/cc'
|
||||||
|
LICENSE = 'MIT'
|
||||||
|
|
||||||
self.plugin_name = NameIntegrationPluginBase()
|
self.plugin_name = NameIntegrationPluginBase()
|
||||||
|
|
||||||
@ -206,3 +207,8 @@ class IntegrationPluginBaseTests(TestCase):
|
|||||||
self.assertEqual(self.plugin.website, None)
|
self.assertEqual(self.plugin.website, None)
|
||||||
self.assertEqual(self.plugin_simple.website, None)
|
self.assertEqual(self.plugin_simple.website, None)
|
||||||
self.assertEqual(self.plugin_name.website, 'http://aa.bb/cc')
|
self.assertEqual(self.plugin_name.website, 'http://aa.bb/cc')
|
||||||
|
|
||||||
|
# license
|
||||||
|
self.assertEqual(self.plugin.license, None)
|
||||||
|
self.assertEqual(self.plugin_simple.license, None)
|
||||||
|
self.assertEqual(self.plugin_name.license, 'MIT')
|
||||||
|
@ -55,6 +55,13 @@
|
|||||||
<td>{{ plugin.website }}{% include "clip.html" %}</td>
|
<td>{{ plugin.website }}{% include "clip.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if plugin.license %}
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-balance-scale'></span></td>
|
||||||
|
<td>{% trans "License" %}</td>
|
||||||
|
<td>{{ plugin.license }}{% include "clip.html" %}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% if plugin.is_package == False %}
|
{% if plugin.is_package == False %}
|
||||||
|
Loading…
Reference in New Issue
Block a user