diff --git a/kfet/static/kfet/css/kpsul.css b/kfet/static/kfet/css/kpsul.css
index 9e2679f9..09c54845 100644
--- a/kfet/static/kfet/css/kpsul.css
+++ b/kfet/static/kfet/css/kpsul.css
@@ -392,8 +392,10 @@ input[type=number]::-webkit-outer-spin-button {
text-align:right;
}
-#basket tr.low-stock {
- background-color:rgba(236,100,0,0.3);
+#basket tr .lowstock {
+ visibility:hidden;
+ width:20px;
+ padding-right:15px;
}
#basket tr.ui-selected, #basket tr.ui-selecting {
diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html
index f18994b4..ca2b2436 100644
--- a/kfet/templates/kfet/kpsul.html
+++ b/kfet/templates/kfet/kpsul.html
@@ -767,7 +767,7 @@ $(document).ready(function() {
// Basket
// -----
- var item_basket_default_html = '
| | |
';
+ var item_basket_default_html = ' | | | |
';
var basket_container = $('#basket table');
var arrowKeys = /^(37|38|39|40)$/;
@@ -800,11 +800,12 @@ $(document).ready(function() {
article_basket_html = $(item_basket_default_html);
article_basket_html
.attr('data-opeindex', index)
- .find('.number').text(nb).end()
+ .find('.number').text('('+nb+'/'+article_data[4]+')').end()
.find('.name').text(article_data[0]).end()
.find('.amount').text(amountToUKF(amount_euro, account_data['is_cof']));
if (is_low_stock(id, nb))
- article_basket_html.addClass('low-stock');
+ article_basket_html.find('.lowstock')
+ .css('visibility', 'visible');
basket_container.prepend(article_basket_html);
updateBasketRel();
}
@@ -946,10 +947,15 @@ $(document).ready(function() {
amountUKF_after = amountToUKF(amountEuro_after, account_data['is_cof']);
var article_html = basket_container.find('[data-opeindex='+opeindex+']');
article_html.find('.amount').text(amountUKF_after).end()
- .find('.number').text(nb_after).end() ;
+ .find('.number').text(nb_after+'/'+article_data[4]).end() ;
if (is_low_stock(id, nb_after))
- article_html.addClass('low-stock');
+ article_html.find('.lowstock')
+ .css('visibility', 'visible');
+ else
+ article_html.find('.lowstock')
+ .css('visibility', 'hidden');
+
updateExistingFormset(opeindex, nb_after, amountEuro_after);
updateBasketRel();
}