mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Cleanup rendering of "plugins" display
This commit is contained in:
parent
00e570ca2a
commit
53007dc416
@ -47,52 +47,19 @@
|
|||||||
<table class='table table-striped table-condensed'>
|
<table class='table table-striped table-condensed'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Admin" %}</th>
|
|
||||||
<th>{% trans "Name" %}</th>
|
<th>{% trans "Name" %}</th>
|
||||||
|
<th>{% trans "Key" %}</th>
|
||||||
<th>{% trans "Author" %}</th>
|
<th>{% trans "Author" %}</th>
|
||||||
<th>{% trans "Date" %}</th>
|
<th>{% trans "Date" %}</th>
|
||||||
<th>{% trans "Version" %}</th>
|
<th>{% trans "Version" %}</th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{% plugin_list as pl_list %}
|
{% plugin_list as pl_list %}
|
||||||
{% for plugin_key, plugin in pl_list.items %}
|
{% for plugin_key, plugin in pl_list.items %}
|
||||||
{% mixin_enabled plugin 'urls' as urls %}
|
{% include "InvenTree/settings/plugin_details.html" with plugin=plugin plugin_key=plugin_key %}
|
||||||
{% mixin_enabled plugin 'settings' as settings %}
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{% if user.is_staff and perms.plugin.change_pluginconfig %}
|
|
||||||
{% url 'admin:plugin_pluginconfig_change' plugin.pk as url %}
|
|
||||||
{% include "admin_button.html" with url=url %}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>{{ plugin.human_name }}<span class="text-muted"> - {{plugin_key}}</span>
|
|
||||||
{% define plugin.registered_mixins as mixin_list %}
|
|
||||||
|
|
||||||
{% if plugin.is_sample %}
|
|
||||||
<a class='sidebar-selector' id='select-plugin-{{plugin_key}}' data-bs-parent="#sidebar">
|
|
||||||
<span class='badge bg-info rounded-pill badge-right'>{% trans "Sample" %}</span>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if mixin_list %}
|
|
||||||
{% for mixin in mixin_list %}
|
|
||||||
<a class='sidebar-selector' id='select-plugin-{{plugin_key}}' data-bs-parent="#sidebar">
|
|
||||||
<span class='badge bg-dark badge-right rounded-pill'>{{ mixin.human_name }}</span>
|
|
||||||
</a>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if plugin.website %}
|
|
||||||
<a href="{{ plugin.website }}"><span class="fas fa-globe"></span></a>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>{{ plugin.author }}</td>
|
|
||||||
<td>{% render_date plugin.pub_date %}</td>
|
|
||||||
<td>{% if plugin.version %}{{ plugin.version }}{% endif %}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% inactive_plugin_list as in_pl_list %}
|
{% inactive_plugin_list as in_pl_list %}
|
||||||
@ -100,16 +67,7 @@
|
|||||||
<tr><td colspan="5"></td></tr>
|
<tr><td colspan="5"></td></tr>
|
||||||
<tr><td colspan="5"><h6>{% trans 'Inactive plugins' %}</h6></td></tr>
|
<tr><td colspan="5"><h6>{% trans 'Inactive plugins' %}</h6></td></tr>
|
||||||
{% for plugin_key, plugin in in_pl_list.items %}
|
{% for plugin_key, plugin in in_pl_list.items %}
|
||||||
<tr>
|
{% include "InvenTree/settings/plugin_details.html" with plugin=plugin plugin_key=plugin_key %}
|
||||||
<td>
|
|
||||||
{% if user.is_staff and perms.plugin.change_pluginconfig %}
|
|
||||||
{% url 'admin:plugin_pluginconfig_change' plugin.pk as url %}
|
|
||||||
{% include "admin_button.html" with url=url %}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>{{plugin.name}}<span class="text-muted"> - {{plugin.key}}</span></td>
|
|
||||||
<td colspan="3"></td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
67
InvenTree/templates/InvenTree/settings/plugin_details.html
Normal file
67
InvenTree/templates/InvenTree/settings/plugin_details.html
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
{% load inventree_extras %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{% if plugin.human_name %}
|
||||||
|
{{ plugin.human_name }}
|
||||||
|
{% elif plugin.name %}
|
||||||
|
{{ plugin.name }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% define plugin.registered_mixins as mixin_list %}
|
||||||
|
|
||||||
|
{% if mixin_list %}
|
||||||
|
{% for mixin in mixin_list %}
|
||||||
|
<a class='sidebar-selector' id='select-plugin-{{plugin_key}}' data-bs-parent="#sidebar">
|
||||||
|
<span class='badge bg-dark badge-right rounded-pill'>{{ mixin.human_name }}</span>
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if plugin.is_builtin %}
|
||||||
|
<a class='sidebar-selector' id='select-plugin-{{ plugin_key }}' data-bs-parent='#sidebar'>
|
||||||
|
<span class='badge bg-success rounded-pill badge-right'>{% trans "Builtin" %}</span>
|
||||||
|
</a>
|
||||||
|
{% 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 badge-right'>{% trans "Sample" %}</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if plugin.website %}
|
||||||
|
<a href="{{ plugin.website }}"><span class="fas fa-globe"></span></a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>{{ plugin_key }}</td>
|
||||||
|
{% trans "Unvailable" as no_info %}
|
||||||
|
<td>
|
||||||
|
{% if plugin.author %}
|
||||||
|
{{ plugin.author }}
|
||||||
|
{% else %}
|
||||||
|
<em>{{ no_info }}</em>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if plugin.pub_date %}
|
||||||
|
{% render_date plugin.pub_date %}
|
||||||
|
{% else %}
|
||||||
|
<em>{{ no_info }}</em>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if plugin.version %}
|
||||||
|
{{ plugin.version }}
|
||||||
|
{% else %}
|
||||||
|
<em>{{ no_info }}</em>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if user.is_staff and perms.plugin.change_pluginconfig %}
|
||||||
|
{% url 'admin:plugin_pluginconfig_change' plugin.pk as url %}
|
||||||
|
{% include "admin_button.html" with url=url %}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
Loading…
Reference in New Issue
Block a user