Fix action buttons in "part" table on category page

This commit is contained in:
Oliver Walters 2022-04-07 19:09:43 +10:00
parent e1fbd961e5
commit e225d3b765
3 changed files with 10 additions and 18 deletions

View File

@ -169,13 +169,18 @@
</button>
<ul class='dropdown-menu'>
{% if roles.part.change %}
<li><a class='dropdown-item' href='#' id='multi-part-category' title='{% trans "Set category" %}'>{% trans "Set Category" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-part-category' title='{% trans "Set category" %}'>
<span class='fas fa-sitemap'></span> {% trans "Set Category" %}
</a></li>
{% endif %}
<li><a class='dropdown-item' href='#' id='multi-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-part-order' title='{% trans "Order parts" %}'>
<span class='fas fa-shopping-cart'></span> {% trans "Order Parts" %}
</a></li>
{% if report_enabled %}
<li><a class='dropdown-item' href='#' id='multi-part-print-label' title='{% trans "Print Labels" %}'>{% trans "Print Labels" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-part-print-label' title='{% trans "Print Labels" %}'>
<span class='fas fa-tag'></span> {% trans "Print Labels" %}
</a></li>
{% endif %}
<li><a class='dropdown-item' href='#' id='multi-part-export' title='{% trans "Export" %}'>{% trans "Export Data" %}</a></li>
</ul>
</div>
{% include "filter_list.html" with id="parts" %}

View File

@ -481,7 +481,7 @@ function orderParts(parts_list, options={}) {
var thumb = thumbnailImage(part.thumbnail || part.image);
// The "quantity" field should have been provided for each part
var quantity = part.quantity || 0;
var quantity = part.quantity || 1;
if (quantity < 0) {
quantity = 0;

View File

@ -1581,19 +1581,6 @@ function loadPartTable(table, url, options={}) {
printPartLabels(items);
});
$('#multi-part-export').click(function() {
var selections = $(table).bootstrapTable('getSelections');
var parts = '';
selections.forEach(function(item) {
parts += item.pk;
parts += ',';
});
location.href = '/part/export/?parts=' + parts;
});
}