mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Added link to item edit page for all item cards (product/chore/battery) (references #93)
This commit is contained in:
parent
3de3e03ab3
commit
b3da837ede
@ -11,6 +11,9 @@ Grocy.Components.BatteryCard.Refresh = function(batteryId)
|
||||
$('#batterycard-battery-last-charged-timeago').text($.timeago(batteryDetails.last_charged || ''));
|
||||
$('#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-edit-button').removeClass("disabled");
|
||||
|
||||
EmptyElementWhenMatches('#batterycard-battery-last-charged-timeago', L('timeago_nan'));
|
||||
},
|
||||
function(xhr)
|
||||
|
@ -11,6 +11,9 @@ Grocy.Components.ChoreCard.Refresh = function(choreId)
|
||||
$('#chorecard-chore-tracked-count').text((choreDetails.tracked_count || '0'));
|
||||
$('#chorecard-chore-last-done-by').text((choreDetails.last_done_by.display_name || L('Unknown')));
|
||||
|
||||
$('#chorecard-chore-edit-button').attr("href", U("/chore/" + choreDetails.chore.id.toString()));
|
||||
$('#chorecard-chore-edit-button').removeClass("disabled");
|
||||
|
||||
EmptyElementWhenMatches('#chorecard-chore-last-tracked-timeago', L('timeago_nan'));
|
||||
},
|
||||
function(xhr)
|
||||
|
@ -15,6 +15,9 @@ Grocy.Components.ProductCard.Refresh = function(productId)
|
||||
$('#productcard-product-last-used').text((productDetails.last_used || L('never')).substring(0, 10));
|
||||
$('#productcard-product-last-used-timeago').text($.timeago(productDetails.last_used || ''));
|
||||
|
||||
$('#productcard-product-edit-button').attr("href", U("/product/" + productDetails.product.id.toString()));
|
||||
$('#productcard-product-edit-button').removeClass("disabled");
|
||||
|
||||
if (productDetails.last_price !== null)
|
||||
{
|
||||
$('#productcard-product-last-price').text(Number.parseFloat(productDetails.last_price).toLocaleString() + ' ' + Grocy.Currency);
|
||||
|
@ -5,6 +5,9 @@
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-battery-three-quarters"></i> {{ $L('Battery overview') }}
|
||||
<a id="batterycard-battery-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $L('Edit battery') }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h3><span id="batterycard-battery-name"></span></h3>
|
||||
|
@ -4,7 +4,10 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-refresh"></i> {{ $L('Chore overview') }}
|
||||
<i class="fas fa-home"></i> {{ $L('Chore overview') }}
|
||||
<a id="chorecard-chore-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $L('Edit chore') }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h3><span id="chorecard-chore-name"></span></h3>
|
||||
|
@ -6,6 +6,9 @@
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fab fa-product-hunt"></i> {{ $L('Product overview') }}
|
||||
<a id="productcard-product-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $L('Edit product') }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h3><span id="productcard-product-name"></span></h3>
|
||||
|
Loading…
x
Reference in New Issue
Block a user