Refactor part display

This commit is contained in:
Oliver 2021-10-27 23:29:10 +11:00
parent e235e5adec
commit 9d2b4af83f
6 changed files with 326 additions and 330 deletions

View File

@ -229,16 +229,26 @@
/* Extra label styles */ /* Extra label styles */
.label {
display: inline;
font-size: 75%;
line-height: 1;
padding-left: 4px;
padding-right: 4px;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 5px;
}
.label-large { .label-large {
margin: 3px; margin: 3px;
font-size: 100%; font-size: 90%;
border: 3px solid; border: 3px solid;
border-radius: 15px; border-radius: 15px;
background: none; background: none;
padding-right: 10px; padding: 3px;
padding-left: 10px; border-radius: 10px;
padding-top: 5px;
padding-bottom: 5px;
} }
.label-large-red { .label-large-red {
@ -254,18 +264,7 @@
border-radius: 5px; border-radius: 5px;
} }
.label {
display: inline;
font-size: 75%;
line-height: 1;
padding-left: 4px;
padding-right: 4px;
color: white;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
.label-red { .label-red {
background: var(--label-red); background: var(--label-red);

View File

@ -11,6 +11,88 @@
{% block page_content %} {% block page_content %}
<div class='panel panel-inventree panel-hidden' id='panel-part-details'>
<div class='panel-heading'>
<h4>{% trans "Part Details" %}</h4>
</div>
<div class='panel-content'>
<!-- Details Table -->
<table class="table table-striped">
<col width='25'>
{% if part.IPN %}
<tr>
<td><span class='fas fa-tag'></span></td>
<td>{% trans "IPN" %}</td>
<td>{{ part.IPN }}{% include "clip.html"%}</td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-shapes'></span></td>
<td>{% trans "Name" %}</td>
<td>{{ part.name }}{% include "clip.html"%}</td>
</tr>
<tr>
<td><span class='fas fa-info-circle'></span></td>
<td>{% trans "Description" %}</td>
<td>{{ part.description }}{% include "clip.html"%}</td>
</tr>
{% if part.revision %}
<tr>
<td><span class='fas fa-code-branch'></span></td>
<td>{% trans "Revision" %}</td>
<td>{{ part.revision }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.keywords %}
<tr>
<td><span class='fas fa-key'></span></td>
<td>{% trans "Keywords" %}</td>
<td>{{ part.keywords }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.link %}
<tr>
<td><span class='fas fa-link'></span></td>
<td>{% trans "External Link" %}</td>
<td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Creation Date" %}</td>
<td>
{{ part.creation_date }}
{% if part.creation_user %}
<span class='badge'>{{ part.creation_user }}</span>
{% endif %}
</td>
</tr>
{% if part.trackable and part.getLatestSerialNumber %}
<tr>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "Latest Serial Number" %}</td>
<td>{{ part.getLatestSerialNumber }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.default_location %}
<tr>
<td><span class='fas fa-search-location'></span></td>
<td>{% trans "Default Location" %}</td>
<td>{{ part.default_location }}</td>
</tr>
{% endif %}
{% if part.default_supplier %}
<tr>
<td><span class='fas fa-building'></span></td>
<td>{% trans "Default Supplier" %}</td>
<td>{{ part.default_supplier }}</td>
</tr>
{% endif %}
</table>
</div>
</div>
<div class='panel panel-inventree panel-hidden' id='panel-part-stock'> <div class='panel panel-inventree panel-hidden' id='panel-part-stock'>
<div class='panel-heading'> <div class='panel-heading'>
<h4>{% trans "Part Stock" %}</h4> <h4>{% trans "Part Stock" %}</h4>

View File

@ -11,6 +11,12 @@
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span> <span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
</a> </a>
</li> </li>
<li class='list-group-item' title='{% trans "Details" %}'>
<a href='#' id='select-part-details' class='nav-toggle'>
<span class='menu-tab-icon fas fa-info-circle sidebar-icon'></span>
{% trans "Details" %}
</a>
</li>
<li class='list-group-item' title='{% trans "Parameters" %}'> <li class='list-group-item' title='{% trans "Parameters" %}'>
<a href='#' id='select-part-parameters' class='nav-toggle'> <a href='#' id='select-part-parameters' class='nav-toggle'>
<span class='menu-tab-icon fas fa-th-list sidebar-icon'></span> <span class='menu-tab-icon fas fa-th-list sidebar-icon'></span>

View File

@ -1,4 +1,4 @@
{% extends "base.html" %} {% extends "page_base.html" %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% load inventree_extras %} {% load inventree_extras %}

View File

@ -8,298 +8,210 @@
{% include "part/navbar.html" %} {% include "part/navbar.html" %}
{% endblock %} {% endblock %}
{% block content %} {% block thumbnail %}
{% include "part/part_thumb.html" %}
<div class="panel panel-inventree">
<div class='panel-content'></div>
<!-- Default panel contents -->
<div class="panel-heading"><h3>{{ part.full_name }}</h3></div>
<div class="panel-content">
<div class="row">
<div class="col-sm-6">
{% include "part/part_thumb.html" %}
<div class="media-body">
<p>
<h3>
<!-- Admin View -->
{% if user.is_staff and roles.part.change %}
<a href="{% url 'admin:part_part_change' part.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>&ensp;
{% endif %}
<!-- Properties -->
<div id='part-properties' class='btn-group' role='group'>
{% if part.is_template %}
<span class='fas fa-clone' title='{% trans "Part is a template part (variants can be made from this part)" %}'></span>
{% endif %}
{% if part.assembly %}
<span class='fas fa-tools' title='{% trans "Part can be assembled from other parts" %}'></span>
{% endif %}
{% if part.component %}
<span class='fas fa-th' title='{% trans "Part can be used in assemblies" %}'></span>
{% endif %}
{% if part.trackable %}
<span class='fas fa-directions' title='{% trans "Part stock is tracked by serial number" %}'></span>
{% endif %}
{% if part.purchaseable %}
<span class='fas fa-shopping-cart' title='{% trans "Part can be purchased from external suppliers" %}'></span>
{% endif %}
{% if part.salable %}
<span class='fas fa-dollar-sign' title='{% trans "Part can be sold to customers" %}'></span>
{% endif %}
</div>
<!-- Part active -->
{% if not part.active %}
&ensp;
<div class='label label-large label-large-red'>
<span class='fas fa-skull-crossbones' title='{% trans "Part is virtual (not a physical part)" %}'></span>
{% trans 'Inactive' %}
</div>
{% endif %}
<!-- Part virtual -->
{% if part.virtual and part.active %}
&ensp;
<div class='label label-large label-large-yellow'>
<span class='fas fa-ghost' title='{% trans "Part is virtual (not a physical part)" %}'></span>
{% trans 'Virtual' %}
</div>
{% endif %}
</h3>
</p>
<div class='btn-group' role='group'>
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Star this part" %}'>
<span id='part-star-icon' class='fas fa-star {% if starred %}icon-yellow{% endif %}'/>
</button>
{% if barcodes %}
<!-- Barcode actions menu -->
<div class='btn-group'>
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'><span class='fas fa-qrcode'></span> <span class='caret'></span></button>
<ul class='dropdown-menu'>
<li><a class='dropdown-item' href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
<li><a class='dropdown-item' href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
</ul>
</div>
{% endif %}
{% if part.active %}
<button type='button' class='btn btn-outline-secondary' id='price-button' title='{% trans "Show pricing information" %}'>
<span id='part-price-icon' class='fas fa-dollar-sign'/>
</button>
{% if roles.stock.change %}
<div class='btn-group'>
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
<span class='fas fa-boxes'></span> <span class='caret'></span>
</button>
<ul class='dropdown-menu'>
<li>
<a class='dropdown-item' href='#' id='part-count'>
<span class='fas fa-clipboard-list'></span>
{% trans "Count part stock" %}
</a>
</li>
<li>
<a class='dropdown-item' href='#' id='part-move'>
<span class='fas fa-exchange-alt'></span>
{% trans "Transfer part stock" %}
</a>
</li>
</ul>
</div>
{% endif %}
{% if part.purchaseable and roles.purchase_order.add %}
<button type='button' class='btn btn-outline-secondary' id='part-order' title='{% trans "Order part" %}'>
<span id='part-order-icon' class='fas fa-shopping-cart'/>
</button>
{% endif %}
{% endif %}
<!-- Part actions -->
{% if roles.part.add or roles.part.change or roles.part.delete %}
<div class='btn-group'>
<button id='part-actions' title='{% trans "Part actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'> <span class='fas fa-shapes'></span> <span class='caret'></span></button>
<ul class='dropdown-menu'>
{% if roles.part.add %}
<li><a class='dropdown-item' href='#' id='part-duplicate'><span class='fas fa-copy'></span> {% trans "Duplicate part" %}</a></li>
{% endif %}
{% if roles.part.change %}
<li><a class='dropdown-item' href='#' id='part-edit'><span class='fas fa-edit icon-blue'></span> {% trans "Edit part" %}</a></li>
{% endif %}
{% if roles.part.delete %}
<li><a class='dropdown-item' href='#' id='part-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete part" %}</a></li>
{% endif %}
</ul>
</div>
{% endif %}
</div>
<p>
<!-- Details show/hide button -->
<button id="toggle-part-details" class="btn btn-primary" data-bs-toggle="collapse" data-target="#collapsible-part-details" value="show">
<span class="fas fa-chevron-down"></span> {% trans "Show Part Details" %}
</button>
</p>
</div>
</div>
<div class='info-messages'>
{% if part.variant_of %}
<div class='alert alert-info alert-block' style='padding: 10px;'>
{% object_link 'part-detail' part.variant_of.id part.variant_of.full_name as link %}
{% blocktrans %}This part is a variant of {{link}}{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
<div class="col-sm-6">
<table class='table table-condensed table-striped'>
<col width='25'>
<tr>
<td><h4><span class='fas fa-boxes'></span></h4></td>
<td><h4>{% trans "Available Stock" %}</h4></td>
<td><h4>{% decimal available %}{% if part.units %} {{ part.units }}{% endif %}</h4></td>
</tr>
<tr>
<td><span class='fas fa-map-marker-alt'></span></td>
<td>{% trans "In Stock" %}</td>
<td>{% include "part/stock_count.html" %}</td>
</tr>
{% if on_order > 0 %}
<tr>
<td><span class='fas fa-shopping-cart'></span></td>
<td>{% trans "On Order" %}</td>
<td>{% decimal on_order %}</td>
</tr>
{% endif %}
{% if required_build_order_quantity > 0 %}
<tr>
<td><span class='fas fa-clipboard-list'></span></td>
<td>{% trans "Required for Build Orders" %}</td>
<td>{% decimal required_build_order_quantity %}
</tr>
{% endif %}
{% if required_sales_order_quantity > 0 %}
<tr>
<td><span class='fas fa-clipboard-list'></span></td>
<td>{% trans "Required for Sales Orders" %}</td>
<td>{% decimal required_sales_order_quantity %}
</tr>
{% endif %}
{% if allocated > 0 %}
<tr>
<td><span class='fas fa-dolly'></span></td>
<td>{% trans "Allocated to Orders" %}</td>
<td>{% decimal allocated %}</td>
</tr>
{% endif %}
{% if not part.is_template %}
{% if part.assembly %}
<tr>
<td><h4><span class='fas fa-tools'></span></h4></td>
<td colspan='2'>
<h4>{% trans "Build Status" %}</h4>
</td>
</tr>
<tr>
<td></td>
<td>{% trans "Can Build" %}</td>
<td>{% decimal part.can_build %}</td>
</tr>
{% if quantity_being_built > 0 %}
<tr>
<td></td>
<td>{% trans "Building" %}</td>
<td>{% decimal quantity_being_built %}</td>
</tr>
{% endif %}
{% endif %}
{% endif %}
</table>
</div>
</div>
</div>
<div class="collapse" id="collapsible-part-details">
<div class="card card-body">
<!-- Details Table -->
<table class="table table-striped">
<col width='25'>
{% if part.IPN %}
<tr>
<td><span class='fas fa-tag'></span></td>
<td>{% trans "IPN" %}</td>
<td>{{ part.IPN }}{% include "clip.html"%}</td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-shapes'></span></td>
<td>{% trans "Name" %}</td>
<td>{{ part.name }}{% include "clip.html"%}</td>
</tr>
<tr>
<td><span class='fas fa-info-circle'></span></td>
<td>{% trans "Description" %}</td>
<td>{{ part.description }}{% include "clip.html"%}</td>
</tr>
{% if part.revision %}
<tr>
<td><span class='fas fa-code-branch'></span></td>
<td>{% trans "Revision" %}</td>
<td>{{ part.revision }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.keywords %}
<tr>
<td><span class='fas fa-key'></span></td>
<td>{% trans "Keywords" %}</td>
<td>{{ part.keywords }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.link %}
<tr>
<td><span class='fas fa-link'></span></td>
<td>{% trans "External Link" %}</td>
<td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Creation Date" %}</td>
<td>
{{ part.creation_date }}
{% if part.creation_user %}
<span class='badge'>{{ part.creation_user }}</span>
{% endif %}
</td>
</tr>
{% if part.trackable and part.getLatestSerialNumber %}
<tr>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "Latest Serial Number" %}</td>
<td>{{ part.getLatestSerialNumber }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.default_location %}
<tr>
<td><span class='fas fa-search-location'></span></td>
<td>{% trans "Default Location" %}</td>
<td>{{ part.default_location }}</td>
</tr>
{% endif %}
{% if part.default_supplier %}
<tr>
<td><span class='fas fa-building'></span></td>
<td>{% trans "Default Supplier" %}</td>
<td>{{ part.default_supplier }}</td>
</tr>
{% endif %}
</table>
</div>
</div>
</div>
{% block page_content %}
{% endblock %} {% endblock %}
{% block details %}
<h4>
{{ part.full_name }}
<!-- Admin View -->
{% if user.is_staff and roles.part.change %}
<a href="{% url 'admin:part_part_change' part.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>&ensp;
{% endif %}
</h4>
<!-- Properties -->
<h4>
<div id='part-properties' class='btn-group'>
{% if part.is_template %}
&ensp;
<span class='fas fa-clone' title='{% trans "Part is a template part (variants can be made from this part)" %}'></span>
{% endif %}
{% if part.assembly %}
&ensp;
<span class='fas fa-tools' title='{% trans "Part can be assembled from other parts" %}'></span>
{% endif %}
{% if part.component %}
&ensp;
<span class='fas fa-th' title='{% trans "Part can be used in assemblies" %}'></span>
{% endif %}
{% if part.trackable %}
&ensp;
<span class='fas fa-directions' title='{% trans "Part stock is tracked by serial number" %}'></span>
{% endif %}
{% if part.purchaseable %}
&ensp;
<span class='fas fa-shopping-cart' title='{% trans "Part can be purchased from external suppliers" %}'></span>
{% endif %}
{% if part.salable %}
&ensp;
<span class='fas fa-dollar-sign' title='{% trans "Part can be sold to customers" %}'></span>
{% endif %}
<!-- Part active -->
{% if not part.active %}
&ensp;
<div class='label label-large label-large-red'>
<span class='fas fa-skull-crossbones' title='{% trans "Part is virtual (not a physical part)" %}'></span>
{% trans 'Inactive' %}
</div>
{% endif %}
<!-- Part virtual -->
{% if part.virtual and part.active %}
&ensp;
<div class='label label-large label-large-yellow'>
<span class='fas fa-ghost' title='{% trans "Part is virtual (not a physical part)" %}'></span>
{% trans 'Virtual' %}
</div>
{% endif %}
</div>
</h4>
<!-- Part Actions -->
<div class='btn-group' role='group'>
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Star this part" %}'>
<span id='part-star-icon' class='fas fa-star {% if starred %}icon-yellow{% endif %}'/>
</button>
{% if barcodes %}
<!-- Barcode actions menu -->
<div class='btn-group'>
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'><span class='fas fa-qrcode'></span> <span class='caret'></span></button>
<ul class='dropdown-menu'>
<li><a class='dropdown-item' href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
<li><a class='dropdown-item' href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
</ul>
</div>
{% endif %}
{% if part.active %}
<button type='button' class='btn btn-outline-secondary' id='price-button' title='{% trans "Show pricing information" %}'>
<span id='part-price-icon' class='fas fa-dollar-sign'/>
</button>
{% if roles.stock.change %}
<div class='btn-group'>
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'>
<span class='fas fa-boxes'></span> <span class='caret'></span>
</button>
<ul class='dropdown-menu'>
<li>
<a class='dropdown-item' href='#' id='part-count'>
<span class='fas fa-clipboard-list'></span>
{% trans "Count part stock" %}
</a>
</li>
<li>
<a class='dropdown-item' href='#' id='part-move'>
<span class='fas fa-exchange-alt'></span>
{% trans "Transfer part stock" %}
</a>
</li>
</ul>
</div>
{% endif %}
{% if part.purchaseable and roles.purchase_order.add %}
<button type='button' class='btn btn-outline-secondary' id='part-order' title='{% trans "Order part" %}'>
<span id='part-order-icon' class='fas fa-shopping-cart'/>
</button>
{% endif %}
{% endif %}
<!-- Part actions -->
{% if roles.part.add or roles.part.change or roles.part.delete %}
<div class='btn-group'>
<button id='part-actions' title='{% trans "Part actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'> <span class='fas fa-shapes'></span> <span class='caret'></span></button>
<ul class='dropdown-menu'>
{% if roles.part.add %}
<li><a class='dropdown-item' href='#' id='part-duplicate'><span class='fas fa-copy'></span> {% trans "Duplicate part" %}</a></li>
{% endif %}
{% if roles.part.change %}
<li><a class='dropdown-item' href='#' id='part-edit'><span class='fas fa-edit icon-blue'></span> {% trans "Edit part" %}</a></li>
{% endif %}
{% if roles.part.delete %}
<li><a class='dropdown-item' href='#' id='part-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete part" %}</a></li>
{% endif %}
</ul>
</div>
{% endif %}
</div>
<!-- Part info messages -->
<div class='info-messages'>
{% if part.variant_of %}
<div class='alert alert-info alert-block' style='padding: 10px;'>
{% object_link 'part-detail' part.variant_of.id part.variant_of.full_name as link %}
{% blocktrans %}This part is a variant of {{link}}{% endblocktrans %}
</div>
{% endif %}
</div>
{% endblock %}
{% block details_right %}
<table class='table table-condensed table-striped'>
<col width='25'>
<tr>
<td><h4><span class='fas fa-boxes'></span></h4></td>
<td><h4>{% trans "Available Stock" %}</h4></td>
<td><h4>{% decimal available %}{% if part.units %} {{ part.units }}{% endif %}</h4></td>
</tr>
<tr>
<td><span class='fas fa-map-marker-alt'></span></td>
<td>{% trans "In Stock" %}</td>
<td>{% include "part/stock_count.html" %}</td>
</tr>
{% if on_order > 0 %}
<tr>
<td><span class='fas fa-shopping-cart'></span></td>
<td>{% trans "On Order" %}</td>
<td>{% decimal on_order %}</td>
</tr>
{% endif %}
{% if required_build_order_quantity > 0 %}
<tr>
<td><span class='fas fa-clipboard-list'></span></td>
<td>{% trans "Required for Build Orders" %}</td>
<td>{% decimal required_build_order_quantity %}
</tr>
{% endif %}
{% if required_sales_order_quantity > 0 %}
<tr>
<td><span class='fas fa-clipboard-list'></span></td>
<td>{% trans "Required for Sales Orders" %}</td>
<td>{% decimal required_sales_order_quantity %}
</tr>
{% endif %}
{% if allocated > 0 %}
<tr>
<td><span class='fas fa-dolly'></span></td>
<td>{% trans "Allocated to Orders" %}</td>
<td>{% decimal allocated %}</td>
</tr>
{% endif %}
{% if not part.is_template %}
{% if part.assembly %}
<tr>
<td><h4><span class='fas fa-tools'></span></h4></td>
<td colspan='2'>
<h4>{% trans "Build Status" %}</h4>
</td>
</tr>
<tr>
<td></td>
<td>{% trans "Can Build" %}</td>
<td>{% decimal part.can_build %}</td>
</tr>
{% if quantity_being_built > 0 %}
<tr>
<td></td>
<td>{% trans "Building" %}</td>
<td>{% decimal quantity_being_built %}</td>
</tr>
{% endif %}
{% endif %}
{% endif %}
</table>
{% endblock %} {% endblock %}
{% block js_ready %} {% block js_ready %}

View File

@ -4,25 +4,22 @@
{% settings_value "INVENTREE_DOWNLOAD_FROM_URL" as allow_download %} {% settings_value "INVENTREE_DOWNLOAD_FROM_URL" as allow_download %}
<div class="media"> <div class='dropzone' id='part-thumb'>
<div class="media-left part-thumb-container"> <img class="part-thumb" id='part-image'
<div class='dropzone' id='part-thumb'> {% if part.image %}
<img class="part-thumb" id='part-image' src="{{ part.image.url }}"
{% if part.image %} {% else %}
src="{{ part.image.url }}" src="{% static 'img/blank_image.png' %}"
{% else %} {% endif %}/>
src="{% static 'img/blank_image.png' %}" </div>
{% endif %}/> {% if roles.part.change %}
</div> <div class='btn-row part-thumb-overlay'>
{% if roles.part.change %} <div class='btn-group'>
<div class='btn-row part-thumb-overlay'> <button type='button' class='btn btn-default' title="{% trans 'Select from existing images' %}" id='part-image-select'><span class='fas fa-th'></span></button>
<div class='btn-group'> <button type='button' class='btn btn-default' title="{% trans 'Upload new image' %}" id='part-image-upload'><span class='fas fa-file-upload'></span></button>
<button type='button' class='btn btn-default' title="{% trans 'Select from existing images' %}" id='part-image-select'><span class='fas fa-th'></span></button> {% if allow_download %}
<button type='button' class='btn btn-default' title="{% trans 'Upload new image' %}" id='part-image-upload'><span class='fas fa-file-upload'></span></button> <button type='button' class='btn btn-default' title="{% trans 'Download image from URL' %}" id='part-image-url'><span class='fas fa-cloud-download-alt'></span></button>
{% if allow_download %} {% endif %}
<button type='button' class='btn btn-default' title="{% trans 'Download image from URL' %}" id='part-image-url'><span class='fas fa-cloud-download-alt'></span></button> </div>
{% endif %} </div>
</div> {% endif %}
</div>
{% endif %}
</div>