mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
publishing date for integration plugins
This commit is contained in:
parent
575be5b36a
commit
ef858f7701
@ -257,6 +257,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
||||
PLUGIN_SLUG = None
|
||||
|
||||
AUTHOR = None
|
||||
PUBLISH_DATE = None
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
@ -293,6 +294,16 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
||||
name = _('No author found')
|
||||
return name
|
||||
|
||||
@property
|
||||
def pub_date(self):
|
||||
"""returns publishing date of plugin - either from plugin settings or git"""
|
||||
name = getattr(self, 'PUBLISH_DATE', None)
|
||||
if not name:
|
||||
name = self.commit.get('date')
|
||||
if not name:
|
||||
name = _('No date found')
|
||||
return name
|
||||
|
||||
# mixins
|
||||
def mixin(self, key):
|
||||
"""check if mixin is registered"""
|
||||
|
@ -47,7 +47,7 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ plugin.author }}</td>
|
||||
<td>{{plugin.commit.date}}</td>
|
||||
<td>{{ plugin.pub_date }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
Loading…
Reference in New Issue
Block a user