mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 07:31:10 +00:00
Added image field to part
- Images are automatically renamed upon upload - Part page displays img
This commit is contained in:
@@ -4,13 +4,26 @@
|
||||
|
||||
{% include "part/cat_link.html" with category=part.category %}
|
||||
|
||||
<a href="{% url 'part-detail' part.id %}">{{ part.name }}</a>
|
||||
|
||||
<br>
|
||||
{{ part.description }}
|
||||
<br>
|
||||
IPN: {% if part.IPN %}{{ part.IPN }}{% else %}N/A{% endif %}
|
||||
<br>
|
||||
<div class="media">
|
||||
<img class="mr-3"
|
||||
{% if part.image %}
|
||||
src="{{ part.image.url }}"
|
||||
{% else %}
|
||||
src="/media/part_images/missing.png"
|
||||
{% endif %}/>
|
||||
<div class="media-body">
|
||||
<h5>{{ part.name }}</h5>
|
||||
{% if part.description %}
|
||||
<p><i>{{ part.description }}</i></p>
|
||||
{% endif %}
|
||||
{% if part.IPN %}
|
||||
<p><b>IPN:</b> {{ part.IPN }}</p>
|
||||
{% endif %}
|
||||
{% if part.URL %}
|
||||
<p>{% include 'url.html' with url=part.URL %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% block details %}
|
||||
|
||||
|
7
InvenTree/part/templates/url.html
Normal file
7
InvenTree/part/templates/url.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% if url %}
|
||||
<a href="{{ url }}">
|
||||
{% if text %}{{ text }}
|
||||
{% else %}{{ url }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
Reference in New Issue
Block a user