mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-08 08:27:44 +08:00
Merge pull request #4042 from aignatov-bio/ai-sci-6741-stock-consumption-modal-highlight-negative-with-red
Highlight negative value in consumption modal [SCI-6741]
This commit is contained in:
commit
bc80122df0
2 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ var MyModuleStockConsumption = (function() {
|
|||
let finalValue = initialValue - ($(this).val() || 0) + initialStock;
|
||||
$('.stock-final-container .value')
|
||||
.text(formatDecimalValue(String(finalValue), $('#stock_consumption').data('decimals')));
|
||||
$('.stock-final-container').toggleClass('error', finalValue <= 0);
|
||||
$('.stock-final-container').toggleClass('negative', finalValue <= 0);
|
||||
$(this).closest('.sci-input-container').toggleClass('error', this.value === '');
|
||||
$('.update-consumption-button').attr('disabled', $(this).val() === '');
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<div class="row mt-3">
|
||||
<div class="col-sm-12">
|
||||
<div class="stock-update-view">
|
||||
<div class="stock-initial-container">
|
||||
<div class="stock-initial-container <%= 'negative' if @stock_value.amount < 0 %>">
|
||||
<span class="subtitle"><%= t('repository_stock_values.manage_modal.current_stock') %></span>
|
||||
<span class="value"><%= @stock_value.formatted_value %></span>
|
||||
<span class="units"><%= @stock_value.repository_stock_unit_item&.data %></span>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<div class="stock-arrow">
|
||||
<i class="fas fa-arrow-right"></i>
|
||||
</div>
|
||||
<div class="stock-final-container">
|
||||
<div class="stock-final-container ">
|
||||
<span class="subtitle"><%= t('repository_stock_values.manage_modal.new_stock') %></span>
|
||||
<span class="value">-</span>
|
||||
<span class="units"><%= @stock_value.repository_stock_unit_item&.data %></span>
|
||||
|
|
Loading…
Reference in a new issue