mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Add modal image overlay for company
This commit is contained in:
parent
e3a5a56371
commit
4e7243b999
@ -8,13 +8,18 @@ InvenTree | {% trans "Company" %} - {{ company.name }}
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block thumbnail %}
|
{% block thumbnail %}
|
||||||
<div class='dropzone' id='company-thumb'>
|
<div class='dropzone part-thumb-container' id='company-thumb'>
|
||||||
<img class="part-thumb"
|
<img class="part-thumb"
|
||||||
{% if company.image %}
|
{% if company.image %}
|
||||||
src="{{ company.image.url }}"
|
src="{{ company.image.url }}"
|
||||||
{% else %}
|
{% else %}
|
||||||
src="{% static 'img/blank_image.png' %}"
|
src="{% static 'img/blank_image.png' %}"
|
||||||
{% endif %}/>
|
{% endif %}/>
|
||||||
|
<div class='btn-row part-thumb-overlay'>
|
||||||
|
<div class='btn-group'>
|
||||||
|
<button type='button' class='btn btn-default btn-glyph' title='{% trans "Upload new image" %}' id='company-image-upload'><span class='fas fa-file-upload'></span></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@ -135,7 +140,13 @@ InvenTree | {% trans "Company" %} - {{ company.name }}
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$("#company-thumb").click(function() {
|
{% if company.image %}
|
||||||
|
$('#company-thumb').click(function() {
|
||||||
|
showModalImage('{{ company.image.url }}');
|
||||||
|
});
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
$("#company-image-upload").click(function() {
|
||||||
launchModalForm(
|
launchModalForm(
|
||||||
"{% url 'company-image' company.id %}",
|
"{% url 'company-image' company.id %}",
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user