mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Show the journal of the product/chore/battery cards in a dialog
This commit is contained in:
parent
81f6b58fe4
commit
2636456461
@ -601,3 +601,27 @@ $(window).on("message", function(e)
|
||||
bootbox.hideAll();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", ".show-as-dialog-link", function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
var link = $(e.currentTarget).attr("href");
|
||||
|
||||
bootbox.dialog({
|
||||
message: '<iframe height="650px" class="embed-responsive" src="' + link + '"></iframe>',
|
||||
size: 'large',
|
||||
backdrop: true,
|
||||
closeButton: false,
|
||||
buttons: {
|
||||
ok: {
|
||||
label: __t('OK'),
|
||||
className: 'btn-success responsive-button',
|
||||
callback: function()
|
||||
{
|
||||
bootbox.hideAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -12,7 +12,7 @@ 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-journal-button').attr("href", U("/batteriesjournal?embedded&battery=" + batteryDetails.battery.id.toString()));
|
||||
$('#batterycard-battery-edit-button').removeClass("disabled");
|
||||
$('#batterycard-battery-journal-button').removeClass("disabled");
|
||||
|
||||
|
@ -12,7 +12,7 @@ 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-journal-button').attr("href", U("/choresjournal?embedded&chore=" + choreDetails.chore.id.toString()));
|
||||
$('#chorecard-chore-edit-button').removeClass("disabled");
|
||||
$('#chorecard-chore-journal-button').removeClass("disabled");
|
||||
|
||||
|
@ -71,7 +71,7 @@ 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-journal-button').attr("href", U("/stockjournal?embedded&product=" + productDetails.product.id.toString()));
|
||||
$('#productcard-product-edit-button').removeClass("disabled");
|
||||
$('#productcard-product-journal-button').removeClass("disabled");
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
<a id="batterycard-battery-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit battery') }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a id="batterycard-battery-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Journal for this battery') }}">
|
||||
<a id="batterycard-battery-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link" href="#" data-toggle="tooltip" title="{{ $__t('Journal for this battery') }}">
|
||||
<i class="fas fa-file-alt"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<a id="chorecard-chore-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit chore') }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a id="chorecard-chore-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Journal for this chore') }}">
|
||||
<a id="chorecard-chore-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link" href="#" data-toggle="tooltip" title="{{ $__t('Journal for this chore') }}">
|
||||
<i class="fas fa-file-alt"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<a id="productcard-product-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit product') }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a id="productcard-product-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Stock journal for this product') }}">
|
||||
<a id="productcard-product-journal-button" class="btn btn-sm btn-outline-secondary py-0 mr-2 float-right disabled show-as-dialog-link" href="#" data-toggle="tooltip" title="{{ $__t('Stock journal for this product') }}">
|
||||
<i class="fas fa-file-alt"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user