diff --git a/_includes/img.html b/_includes/img.html index f680758..8547740 100644 --- a/_includes/img.html +++ b/_includes/img.html @@ -4,27 +4,33 @@ {% set assets = '/assets' %} {% endif %} +{% if 'http' in url %} +{% set doc_url = url %} +{% else %} +{% set doc_url = '{{ assets }}/images/{{ url }}' %} +{% endif %} +
{% if id %} - {% elif url %} - + {% elif doc_url %} + {% endif %} - {{ description }} - {% if id or url %} + {% if id or doc_url %} {% endif %} {% if id %} - {{ description }} + {{ description }} {% endif %}
diff --git a/docs/new.md b/docs/new.md index bfde54b..3450322 100644 --- a/docs/new.md +++ b/docs/new.md @@ -16,6 +16,24 @@ Improved build management system: !!! TODO More information to come soon +#### Related Parts +##### Definition + +Related Part denotes a relationship between two parts, when users want to show their usage is "related" to another part or simply emphasize a link between two parts. + +##### Implementation + +- New PartRelated model/table to store relationships between parts (requires migration) +- New Related tab shown in Part detail page +- Ability to add relationships between parts through both main and admin interfaces +- Can only manage relationship if user has "change" permission on Part ruleset + +##### Example View + +{% with id="related_parts_example", url="https://user-images.githubusercontent.com/4020546/96306587-8f2d0b80-0fc5-11eb-8fdb-20cb2dabfcc6.png", description="Related Parts Example View" %} +{% include 'img.html' %} +{% endwith %} + #### InvenTree Settings ##### Dedicated sections