mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 19:37:12 +00:00
display productCard when clicking item on shopping list (#1078)
This commit is contained in:
@@ -141,6 +141,15 @@ $(document).on('click', '.shoppinglist-delete-button', function(e)
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on("click", ".product-name-cell", function(e)
|
||||||
|
{
|
||||||
|
if ($(e.currentTarget).attr("data-product-id") != "")
|
||||||
|
{
|
||||||
|
Grocy.Components.ProductCard.Refresh($(e.currentTarget).attr("data-product-id"));
|
||||||
|
$("#shoppinglist-productcard-modal").modal("show");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('click', '#add-products-below-min-stock-amount', function(e)
|
$(document).on('click', '#add-products-below-min-stock-amount', function(e)
|
||||||
{
|
{
|
||||||
Grocy.Api.Post('stock/shoppinglist/add-missing-products', { "list_id": $("#selected-shopping-list").val() },
|
Grocy.Api.Post('stock/shoppinglist/add-missing-products', { "list_id": $("#selected-shopping-list").val() },
|
||||||
|
@@ -195,7 +195,8 @@
|
|||||||
<i class="fas fa-box"></i>
|
<i class="fas fa-box"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td class="product-name-cell cursor-link"
|
||||||
|
data-product-id="{{ $listItem->product_id }}">
|
||||||
@if(!empty($listItem->product_id)) {{ FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name }}<br>@endif<em>{!! nl2br($listItem->note) !!}</em>
|
@if(!empty($listItem->product_id)) {{ FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name }}<br>@endif<em>{!! nl2br($listItem->note) !!}</em>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -326,4 +327,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="modal fade"
|
||||||
|
id="shoppinglist-productcard-modal"
|
||||||
|
tabindex="-1">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content text-center">
|
||||||
|
<div class="modal-body">
|
||||||
|
@include('components.productcard')
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-secondary"
|
||||||
|
data-dismiss="modal">{{ $__t('Close') }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@stop
|
@stop
|
||||||
|
Reference in New Issue
Block a user