From 81f6b58fe42aca3ac5dce22b32c79346b4917e4b Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Fri, 27 Sep 2019 14:19:06 +0200 Subject: [PATCH] Added a button to jump to the journal on the product/chore/battery card --- changelog/53_UNRELEASED_2019-xx-xx.md | 1 + public/viewjs/components/batterycard.js | 2 ++ public/viewjs/components/chorecard.js | 2 ++ public/viewjs/components/productcard.js | 2 ++ views/components/batterycard.blade.php | 3 +++ views/components/chorecard.blade.php | 3 +++ views/components/productcard.blade.php | 3 +++ 7 files changed, 16 insertions(+) diff --git a/changelog/53_UNRELEASED_2019-xx-xx.md b/changelog/53_UNRELEASED_2019-xx-xx.md index a660fdea..a42a03e2 100644 --- a/changelog/53_UNRELEASED_2019-xx-xx.md +++ b/changelog/53_UNRELEASED_2019-xx-xx.md @@ -27,6 +27,7 @@ - Fixed that the browser barcode scanner button was not clickable on iOS Safari & other small styles fixes/improvements for iOS Safari (thanks @DeeeeLAN) - It's now also possible to set the meal plan page as the default/entry page (`config.php` setting `ENTRY_PAGE`) (thanks @lwis) - Some UI detail-refinements +- In the header of the product-/chore-/battery-card there is now also a button to directly jump to the journal of the current product/chore/battery ### API improvements/fixes - The API Endpoint `GET /files/{group}/{fileName}` now also returns a `Cache-Control` header (defaults fixed to 30 days) to further increase page load times diff --git a/public/viewjs/components/batterycard.js b/public/viewjs/components/batterycard.js index 1349be8d..3829bcba 100644 --- a/public/viewjs/components/batterycard.js +++ b/public/viewjs/components/batterycard.js @@ -12,7 +12,9 @@ Grocy.Components.BatteryCard.Refresh = function(batteryId) $('#batterycard-battery-charge-cycles-count').text((batteryDetails.charge_cycles_count || '0')); $('#batterycard-battery-edit-button').attr("href", U("/battery/" + batteryDetails.battery.id.toString())); + $('#batterycard-battery-journal-button').attr("href", U("/batteriesjournal?battery=" + batteryDetails.battery.id.toString())); $('#batterycard-battery-edit-button').removeClass("disabled"); + $('#batterycard-battery-journal-button').removeClass("disabled"); EmptyElementWhenMatches('#batterycard-battery-last-charged-timeago', __t('timeago_nan')); RefreshContextualTimeago(); diff --git a/public/viewjs/components/chorecard.js b/public/viewjs/components/chorecard.js index f182d3c3..1e22c816 100644 --- a/public/viewjs/components/chorecard.js +++ b/public/viewjs/components/chorecard.js @@ -12,7 +12,9 @@ Grocy.Components.ChoreCard.Refresh = function(choreId) $('#chorecard-chore-last-done-by').text((choreDetails.last_done_by.display_name || __t('Unknown'))); $('#chorecard-chore-edit-button').attr("href", U("/chore/" + choreDetails.chore.id.toString())); + $('#chorecard-chore-journal-button').attr("href", U("/choresjournal?chore=" + choreDetails.chore.id.toString())); $('#chorecard-chore-edit-button').removeClass("disabled"); + $('#chorecard-chore-journal-button').removeClass("disabled"); if (choreDetails.chore.track_date_only == 1) { diff --git a/public/viewjs/components/productcard.js b/public/viewjs/components/productcard.js index 48a2dcad..9033cd96 100644 --- a/public/viewjs/components/productcard.js +++ b/public/viewjs/components/productcard.js @@ -71,7 +71,9 @@ Grocy.Components.ProductCard.Refresh = function(productId) } $('#productcard-product-edit-button').attr("href", U("/product/" + productDetails.product.id.toString() + '?' + 'returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative))); + $('#productcard-product-journal-button').attr("href", U("/stockjournal?product=" + productDetails.product.id.toString())); $('#productcard-product-edit-button').removeClass("disabled"); + $('#productcard-product-journal-button').removeClass("disabled"); if (productDetails.last_price !== null) { diff --git a/views/components/batterycard.blade.php b/views/components/batterycard.blade.php index 91f2a1c0..8786fd25 100644 --- a/views/components/batterycard.blade.php +++ b/views/components/batterycard.blade.php @@ -8,6 +8,9 @@ + + +

diff --git a/views/components/chorecard.blade.php b/views/components/chorecard.blade.php index 6a04def9..e450b8d4 100644 --- a/views/components/chorecard.blade.php +++ b/views/components/chorecard.blade.php @@ -8,6 +8,9 @@ + + +

diff --git a/views/components/productcard.blade.php b/views/components/productcard.blade.php index aba5b267..a37855ba 100644 --- a/views/components/productcard.blade.php +++ b/views/components/productcard.blade.php @@ -9,6 +9,9 @@ + + +