mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
parent
65046df417
commit
b2478b418a
@ -271,6 +271,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
||||
PLUGIN_TITLE = None
|
||||
|
||||
AUTHOR = None
|
||||
DESCRIPTION = None
|
||||
PUBLISH_DATE = None
|
||||
VERSION = None
|
||||
WEBSITE = None
|
||||
@ -304,6 +305,14 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
||||
name = self.plugin_name()
|
||||
return name
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
"""description of plugin"""
|
||||
description = getattr(self, 'DESCRIPTION', None)
|
||||
if not description:
|
||||
description = self.plugin_name()
|
||||
return description
|
||||
|
||||
@property
|
||||
def author(self):
|
||||
"""returns author of plugin - either from plugin settings or git"""
|
||||
|
@ -163,6 +163,7 @@ class IntegrationPluginBaseTests(TestCase):
|
||||
PLUGIN_TITLE = 'a titel'
|
||||
PUBLISH_DATE = "1111-11-11"
|
||||
AUTHOR = 'AA BB'
|
||||
DESCRIPTION = 'A description'
|
||||
VERSION = '1.2.3a'
|
||||
WEBSITE = 'http://aa.bb/cc'
|
||||
|
||||
@ -185,6 +186,11 @@ class IntegrationPluginBaseTests(TestCase):
|
||||
self.assertEqual(self.plugin_simple.human_name, 'SimplePlugin')
|
||||
self.assertEqual(self.plugin_name.human_name, 'a titel')
|
||||
|
||||
# description
|
||||
self.assertEqual(self.plugin.description, '')
|
||||
self.assertEqual(self.plugin_simple.description, 'SimplePlugin')
|
||||
self.assertEqual(self.plugin_name.description, 'A description')
|
||||
|
||||
# author
|
||||
self.assertEqual(self.plugin_name.author, 'AA BB')
|
||||
|
||||
|
@ -27,6 +27,11 @@
|
||||
<td>{% trans "Author" %}</td>
|
||||
<td>{{ plugin.author }}{% include "clip.html" %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{% trans "Description" %}</td>
|
||||
<td>{{ plugin.description }}{% include "clip.html" %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class='fas fa-calendar-alt'></span></td>
|
||||
<td>{% trans "Date" %}</td>
|
||||
|
Loading…
Reference in New Issue
Block a user