From bd483ec8b0474ba7c5262d6577b111266e829971 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 9 Mar 2019 13:11:50 +0100 Subject: [PATCH] Added a context menu to all stock overview page items --- public/viewjs/batteriesoverview.js | 6 +++++ public/viewjs/choresoverview.js | 6 +++++ views/batteriesoverview.blade.php | 34 +++++++++++++++++++++++--- views/choresoverview.blade.php | 34 +++++++++++++++++++++++--- views/components/productcard.blade.php | 2 +- views/stockoverview.blade.php | 21 +++++++++++++--- 6 files changed, 90 insertions(+), 13 deletions(-) diff --git a/public/viewjs/batteriesoverview.js b/public/viewjs/batteriesoverview.js index 6ca403b0..5e6e4b58 100644 --- a/public/viewjs/batteriesoverview.js +++ b/public/viewjs/batteriesoverview.js @@ -126,6 +126,12 @@ $(document).on('click', '.track-charge-cycle-button', function(e) ); }); +$(document).on("click", ".battery-name-cell", function(e) +{ + Grocy.Components.BatteryCard.Refresh($(e.currentTarget).attr("data-battery-id")); + $("#batteriesoverview-batterycard-modal").modal("show"); +}); + function RefreshStatistics() { var nextXDays = $("#info-due-batteries").data("next-x-days"); diff --git a/public/viewjs/choresoverview.js b/public/viewjs/choresoverview.js index a71bc599..114ed3fa 100644 --- a/public/viewjs/choresoverview.js +++ b/public/viewjs/choresoverview.js @@ -126,6 +126,12 @@ $(document).on('click', '.track-chore-button', function(e) ); }); +$(document).on("click", ".chore-name-cell", function(e) +{ + Grocy.Components.ChoreCard.Refresh($(e.currentTarget).attr("data-chore-id")); + $("#choresoverview-chorecard-modal").modal("show"); +}); + function RefreshStatistics() { var nextXDays = $("#info-due-chores").data("next-x-days"); diff --git a/views/batteriesoverview.blade.php b/views/batteriesoverview.blade.php index 74ea61c1..17fdb62a 100644 --- a/views/batteriesoverview.blade.php +++ b/views/batteriesoverview.blade.php @@ -57,11 +57,24 @@ data-battery-name="{{ FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name }}"> - - - + - + {{ FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name }} @@ -85,4 +98,17 @@ + + @stop diff --git a/views/choresoverview.blade.php b/views/choresoverview.blade.php index 5ac31cc9..05695523 100644 --- a/views/choresoverview.blade.php +++ b/views/choresoverview.blade.php @@ -57,11 +57,24 @@ data-chore-name="{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}"> - - - + - + {{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }} @@ -85,4 +98,17 @@ + + @stop diff --git a/views/components/productcard.blade.php b/views/components/productcard.blade.php index 3fa5d8d2..7e2f1256 100644 --- a/views/components/productcard.blade.php +++ b/views/components/productcard.blade.php @@ -19,7 +19,7 @@ {{ $L('Last price') }}:
{{ $L('Product picture') }}
- +

{{ $L('No picture available') }}
{{ $L('Price history') }}
diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php index 11ec12b6..bfb892f6 100644 --- a/views/stockoverview.blade.php +++ b/views/stockoverview.blade.php @@ -103,12 +103,25 @@ data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name }}"> 1 - - - + - {{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }} + {{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }} {{ $currentStockEntry->amount }} {{ Pluralize($currentStockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural) }}