mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Merge pull request #2843 from matmair/plugin-mark-sample
Mark sample plugins
This commit is contained in:
commit
8d51c592e7
@ -94,6 +94,14 @@ class IntegrationPluginBase(MixinBase, plugin_base.InvenTreePluginBase):
|
|||||||
"""
|
"""
|
||||||
return getattr(self, 'is_package', False)
|
return getattr(self, 'is_package', False)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_sample(self):
|
||||||
|
"""
|
||||||
|
Is this plugin part of the samples?
|
||||||
|
"""
|
||||||
|
path = str(self.package_path)
|
||||||
|
return path.startswith('plugin/samples/')
|
||||||
|
|
||||||
# region properties
|
# region properties
|
||||||
@property
|
@property
|
||||||
def slug(self):
|
def slug(self):
|
||||||
|
@ -77,6 +77,12 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if plugin.is_sample %}
|
||||||
|
<a class='sidebar-selector' id='select-plugin-{{plugin_key}}' data-bs-parent="#sidebar">
|
||||||
|
<span class='badge bg-info rounded-pill'>{% trans "code sample" %}</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if plugin.website %}
|
{% if plugin.website %}
|
||||||
<a href="{{ plugin.website }}"><span class="fas fa-globe"></span></a>
|
<a href="{{ plugin.website }}"><span class="fas fa-globe"></span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user