2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Merge pull request #2534 from SchrodingersGat/plugin-enable

Plugin enable
This commit is contained in:
Oliver
2022-01-12 09:49:52 +11:00
committed by GitHub
13 changed files with 105 additions and 22 deletions

View File

@ -39,14 +39,17 @@
{% include "InvenTree/settings/build.html" %}
{% include "InvenTree/settings/po.html" %}
{% include "InvenTree/settings/so.html" %}
{% include "InvenTree/settings/plugin.html" %}
{% plugins_enabled as plug %}
{% if plug %}
{% include "InvenTree/settings/plugin.html" %}
{% plugin_list as pl_list %}
{% for plugin_key, plugin in pl_list.items %}
{% if plugin.registered_mixins %}
{% include "InvenTree/settings/plugin_settings.html" %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
@ -333,9 +336,12 @@ $("#import-part").click(function() {
launchModalForm("{% url 'api-part-import' %}?reset", {});
});
{% plugins_enabled as plug %}
{% if plug %}
$("#install-plugin").click(function() {
installPlugin();
});
{% endif %}
enableSidebar('settings');

View File

@ -47,15 +47,17 @@
{% trans "Sales Orders" as text %}
{% include "sidebar_item.html" with label='sales-order' text=text icon="fa-truck" %}
{% plugins_enabled as plug %}
{% if plug %}
{% include "sidebar_header.html" with text="Plugin Settings" %}
{% include "sidebar_item.html" with label='plugin' text="Plugins" icon="fa-plug" %}
{% plugin_list as pl_list %}
{% for plugin_key, plugin in pl_list.items %}
{% if plugin.registered_mixins %}
{% include "sidebar_item.html" with label='plugin-'|add:plugin_key text=plugin.human_name %}
{% endif %}
{% if plugin.registered_mixins %}
{% include "sidebar_item.html" with label='plugin-'|add:plugin_key text=plugin.human_name %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}

View File

@ -34,6 +34,18 @@
<td>{% trans "Server is deployed using docker" %}</td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-plug'></span></td>
<td>{% trans "Plugin Support" %}</td>
<td>
{% plugins_enabled as p_en %}
{% if p_en %}
<span class='badge rounded-pill bg-success'>{% trans "Plugin support enabled" %}</span>
{% else %}
<span class='badge rounded-pill bg-warning'>{% trans "Plugin support disabled" %}</span>
{% endif %}
</td>
</tr>
{% if user.is_staff %}
<tr>
<td><span class='fas fa-server'></span></td>