mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add buttons to select or upload part images
This commit is contained in:
parent
d4fe83170f
commit
e0e996a6c3
@ -25,18 +25,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="media">
|
{% include "part/part_thumb.html" %}
|
||||||
<div class="media-left">
|
|
||||||
<div class='dropzone' id='part-thumb'>
|
|
||||||
<img class="part-thumb"
|
|
||||||
{% if part.image %}
|
|
||||||
src="{{ part.image.url }}"
|
|
||||||
{% else %}
|
|
||||||
src="{% static 'img/blank_image.png' %}"
|
|
||||||
{% endif %}/>
|
|
||||||
</div>
|
|
||||||
<a href='#' id='part-image-select'>Select Part Image</a>
|
|
||||||
</div>
|
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<h4>
|
<h4>
|
||||||
{{ part.full_name }}
|
{{ part.full_name }}
|
||||||
@ -209,13 +198,12 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#part-thumb").click(function() {
|
$("#part-image-upload").click(function() {
|
||||||
launchModalForm(
|
launchModalForm("{% url 'part-image-upload' part.id %}",
|
||||||
"{% url 'part-image-upload' part.id %}",
|
{
|
||||||
{
|
reload: true
|
||||||
reload: true
|
}
|
||||||
}
|
);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
20
InvenTree/part/templates/part/part_thumb.html
Normal file
20
InvenTree/part/templates/part/part_thumb.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{% load static %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<div class="media">
|
||||||
|
<div class="media-left">
|
||||||
|
<div class='dropzone' id='part-thumb'>
|
||||||
|
<img class="part-thumb"
|
||||||
|
{% if part.image %}
|
||||||
|
src="{{ part.image.url }}"
|
||||||
|
{% else %}
|
||||||
|
src="{% static 'img/blank_image.png' %}"
|
||||||
|
{% endif %}/>
|
||||||
|
</div>
|
||||||
|
<div class='btn-row'>
|
||||||
|
<div class='btn-group'>
|
||||||
|
<button type='button' class='btn btn-default btn-glyph' title="{% trans 'Select from existing images' %}" id='part-image-select'><span class='glyphicon glyphicon-edit'></span></button>
|
||||||
|
<button type='button' class='btn btn-default btn-glyph' title="{% trans 'Upload new image' %}" id='part-image-upload'><span class='glyphicon glyphicon-upload'></span></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user