2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Adds a new InvenTreePluginMixin mixin class for enabling custom plugin rendering on a page

- Any view which needs custom plugin code must implement this mixin
- Initially implement for the PartDetail page
This commit is contained in:
Oliver Walters
2022-05-06 22:52:52 +10:00
parent 7b8a10173d
commit c80b36fc2f
8 changed files with 74 additions and 10 deletions

View File

@ -397,9 +397,11 @@
</div>
<table class='table table-condensed table-striped' id='manufacturer-part-table' data-toolbar='#manufacturer-button-toolbar'></table>
</div>
</div>
</div>
</div>
{% include "panel/plugin_panels.html" %}
{% endblock %}
{% block js_load %}
@ -1083,4 +1085,6 @@
}
});
{% include "panel/plugin_javascript.html" %}
{% endblock %}

View File

@ -58,3 +58,5 @@
{% include "sidebar_item.html" with label="part-attachments" text=text icon="fa-paperclip" %}
{% trans "Notes" as text %}
{% include "sidebar_item.html" with label="part-notes" text=text icon="fa-clipboard" %}
{% include "panel/plugin_menu_items.html" %}

View File

@ -49,7 +49,7 @@ from order.models import PurchaseOrderLineItem
from InvenTree.views import AjaxView, AjaxCreateView, AjaxUpdateView, AjaxDeleteView
from InvenTree.views import QRCodeView
from InvenTree.views import InvenTreeRoleMixin
from InvenTree.views import InvenTreeRoleMixin, InvenTreePluginMixin
from InvenTree.helpers import str2bool
@ -365,7 +365,7 @@ class PartImportAjax(FileManagementAjaxView, PartImport):
return PartImport.validate(self, self.steps.current, form, **kwargs)
class PartDetail(InvenTreeRoleMixin, DetailView):
class PartDetail(InvenTreeRoleMixin, InvenTreePluginMixin, DetailView):
""" Detail view for Part object
"""