mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Added a context menu to all stock overview page items
This commit is contained in:
parent
4d215edbd0
commit
bd483ec8b0
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -57,11 +57,24 @@
|
||||
data-battery-name="{{ FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name }}">
|
||||
<i class="fas fa-fire"></i>
|
||||
</a>
|
||||
<a class="btn btn-info btn-sm" href="{{ $U('/batteriesjournal?battery=') }}{{ $curentBatteryEntry->battery_id }}">
|
||||
<i class="fas fa-file-alt"></i>
|
||||
</a>
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-sm btn-light text-secondary" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item battery-name-cell" data-chore-id="{{ $curentBatteryEntry->battery_id }}" type="button" href="#">
|
||||
<i class="fas fa-info"></i> {{ $L('Show battery details') }}
|
||||
</a>
|
||||
<a class="dropdown-item" type="button" href="{{ $U('/batteriesjournal?battery=') }}{{ $curentBatteryEntry->battery_id }}">
|
||||
<i class="fas fa-file-alt"></i> {{ $L('Journal for this battery') }}
|
||||
</a>
|
||||
<a class="dropdown-item" type="button" href="{{ $U('/battery/') }}{{ $curentBatteryEntry->battery_id }}">
|
||||
<i class="fas fa-edit"></i> {{ $L('Edit battery') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<td class="battery-name-cell cursor-link" data-battery-id="{{ $curentBatteryEntry->battery_id }}">
|
||||
{{ FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name }}
|
||||
</td>
|
||||
<td>
|
||||
@ -85,4 +98,17 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="batteriesoverview-batterycard-modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content text-center">
|
||||
<div class="modal-body">
|
||||
@include('components.batterycard')
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $L('Close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
@ -57,11 +57,24 @@
|
||||
data-chore-name="{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}">
|
||||
<i class="fas fa-play"></i>
|
||||
</a>
|
||||
<a class="btn btn-info btn-sm" href="{{ $U('/choresjournal?chore=') }}{{ $curentChoreEntry->chore_id }}">
|
||||
<i class="fas fa-file-alt"></i>
|
||||
</a>
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-sm btn-light text-secondary" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item chore-name-cell" data-chore-id="{{ $curentChoreEntry->chore_id }}" type="button" href="#">
|
||||
<i class="fas fa-info"></i> {{ $L('Show chore details') }}
|
||||
</a>
|
||||
<a class="dropdown-item" type="button" href="{{ $U('/choresjournal?chore=') }}{{ $curentChoreEntry->chore_id }}">
|
||||
<i class="fas fa-file-alt"></i> {{ $L('Journal for this chore') }}
|
||||
</a>
|
||||
<a class="dropdown-item" type="button" href="{{ $U('/chore/') }}{{ $curentChoreEntry->chore_id }}">
|
||||
<i class="fas fa-edit"></i> {{ $L('Edit chore') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<td class="chore-name-cell cursor-link" data-chore-id="{{ $curentChoreEntry->chore_id }}">
|
||||
{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}
|
||||
</td>
|
||||
<td>
|
||||
@ -85,4 +98,17 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="choresoverview-chorecard-modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content text-center">
|
||||
<div class="modal-body">
|
||||
@include('components.chorecard')
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $L('Close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
@ -19,7 +19,7 @@
|
||||
<strong>{{ $L('Last price') }}:</strong> <span id="productcard-product-last-price"></span>
|
||||
|
||||
<h5 class="mt-3">{{ $L('Product picture') }}</h5>
|
||||
<img id="productcard-product-picture" src="" class="img-fluid img-thumbnail d-none">
|
||||
<p class="w-75 mx-auto"><img id="productcard-product-picture" src="" class="img-fluid img-thumbnail d-none"></p>
|
||||
<span id="productcard-no-product-picture" class="font-italic d-none">{{ $L('No picture available') }}</span>
|
||||
|
||||
<h5 class="mt-3">{{ $L('Price history') }}</h5>
|
||||
|
@ -103,12 +103,25 @@
|
||||
data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name }}">
|
||||
<i class="fas fa-box-open"></i> 1
|
||||
</a>
|
||||
<a class="btn btn-info btn-sm" href="{{ $U('/stockjournal?product=') }}{{ $currentStockEntry->product_id }}">
|
||||
<i class="fas fa-file-alt"></i>
|
||||
</a>
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-sm btn-light text-secondary" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item product-name-cell" data-product-id="{{ $currentStockEntry->product_id }}" type="button" href="#">
|
||||
<i class="fas fa-info"></i> {{ $L('Show product details') }}
|
||||
</a>
|
||||
<a class="dropdown-item" type="button" href="{{ $U('/stockjournal?product=') }}{{ $currentStockEntry->product_id }}">
|
||||
<i class="fas fa-file-alt"></i> {{ $L('Stock journal for this product') }}
|
||||
</a>
|
||||
<a class="dropdown-item" type="button" href="{{ $U('/product/') }}{{ $currentStockEntry->product_id }}">
|
||||
<i class="fas fa-edit"></i> {{ $L('Edit product') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="product-name-cell cursor-link" data-product-id="{{ $currentStockEntry->product_id }}">
|
||||
{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }} <i class="fas fa-info text-muted"></i>
|
||||
{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<span id="product-{{ $currentStockEntry->product_id }}-amount">{{ $currentStockEntry->amount }}</span> {{ 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) }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user