Always navigate back to the previous page after saving a product (closes #364)

This commit is contained in:
Bernd Bestel 2019-09-22 09:03:59 +02:00
parent e5530e2058
commit 4c57bf8b9d
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 3 additions and 2 deletions

View File

@ -37,6 +37,7 @@
- `FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING` to disable product opened tracking
- Fixed/refined some things regarding purchase/consume/inventory of products with enabled tare weight handling (nothing was broken, but the success popups may not displayed the correct amount that was posted)
- Fixed that "Spoil rate" and "Average shelf life" on the product card was wrong in most cases
- When going to the product edit page, after saving the product, it will now return to the page you were coming from
### Shopping list improvements
- Shopping lists now have a notes field (HTML/WYSIWYG editor, just to save some notes per shopping list)

View File

@ -66,7 +66,7 @@ Grocy.Components.ProductCard.Refresh = function(productId)
$('#productcard-product-stock-opened-amount').text("");
}
$('#productcard-product-edit-button').attr("href", U("/product/" + productDetails.product.id.toString()));
$('#productcard-product-edit-button').attr("href", U("/product/" + productDetails.product.id.toString() + '?' + 'returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative)));
$('#productcard-product-edit-button').removeClass("disabled");
if (productDetails.last_price !== null)

View File

@ -151,7 +151,7 @@
<a class="dropdown-item" type="button" href="{{ $U('/stockjournal?product=') }}{{ $currentStockEntry->product_id }}">
<i class="fas fa-file-alt"></i> {{ $__t('Stock journal for this product') }}
</a>
<a class="dropdown-item" type="button" href="{{ $U('/product/') }}{{ $currentStockEntry->product_id }}">
<a class="dropdown-item" type="button" href="{{ $U('/product/') }}{{ $currentStockEntry->product_id . '?returnto=%2Fstockoverview' }}">
<i class="fas fa-edit"></i> {{ $__t('Edit product') }}
</a>
<div class="dropdown-divider"></div>