Improve journal UI when undoing a transaction

This commit is contained in:
Bernd Bestel 2018-11-18 12:58:15 +01:00
parent c71e46191f
commit 5966a3d678
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
6 changed files with 11 additions and 5 deletions

View File

@ -59,7 +59,9 @@ $(document).on('click', '.undo-battery-execution-button', function(e)
function(result)
{
element.closest("tr").addClass("text-muted");
element.closest(".undo-battery-execution-button").addClass("disabled");
element.parent().siblings().find("span.name-anchor").addClass("text-strike-through").after("<br>" + L("Undone on") + " " + moment().format("YYYY-MM-DD HH:mm:ss") + " <time class='timeago timeago-contextual' datetime='" + moment().format("YYYY-MM-DD HH:mm:ss") + "'></time>");
element.closest(".undo-stock-booking-button").addClass("disabled");
RefreshContextualTimeago();
toastr.success(L("Charge cycle successfully undone"));
},
function(xhr)

View File

@ -59,7 +59,9 @@ $(document).on('click', '.undo-chore-execution-button', function(e)
function(result)
{
element.closest("tr").addClass("text-muted");
element.closest(".undo-chore-execution-button").addClass("disabled");
element.parent().siblings().find("span.name-anchor").addClass("text-strike-through").after("<br>" + L("Undone on") + " " + moment().format("YYYY-MM-DD HH:mm:ss") + " <time class='timeago timeago-contextual' datetime='" + moment().format("YYYY-MM-DD HH:mm:ss") + "'></time>");
element.closest(".undo-stock-booking-button").addClass("disabled");
RefreshContextualTimeago();
toastr.success(L("Chore execution successfully undone"));
},
function(xhr)

View File

@ -59,7 +59,9 @@ $(document).on('click', '.undo-stock-booking-button', function(e)
function(result)
{
element.closest("tr").addClass("text-muted");
element.parent().siblings().find("span.name-anchor").addClass("text-strike-through").after("<br>" + L("Undone on") + " " + moment().format("YYYY-MM-DD HH:mm:ss") + " <time class='timeago timeago-contextual' datetime='" + moment().format("YYYY-MM-DD HH:mm:ss") + "'></time>");
element.closest(".undo-stock-booking-button").addClass("disabled");
RefreshContextualTimeago();
toastr.success(L("Booking successfully undone"));
},
function(xhr)

View File

@ -46,7 +46,7 @@
</a>
</td>
<td>
<span class="@if($chargeCycleEntry->undone == 1) text-strike-through @endif">{{ FindObjectInArrayByPropertyValue($batteries, 'id', $chargeCycleEntry->battery_id)->name }}</span>
<span class="name-anchor @if($chargeCycleEntry->undone == 1) text-strike-through @endif">{{ FindObjectInArrayByPropertyValue($batteries, 'id', $chargeCycleEntry->battery_id)->name }}</span>
@if($chargeCycleEntry->undone == 1)
<br>
{{ $L('Undone on') . ' ' . $chargeCycleEntry->undone_timestamp }}

View File

@ -47,7 +47,7 @@
</a>
</td>
<td>
<span class="@if($choreLogEntry->undone == 1) text-strike-through @endif">{{ FindObjectInArrayByPropertyValue($chores, 'id', $choreLogEntry->chore_id)->name }}</span>
<span class="name-anchor @if($choreLogEntry->undone == 1) text-strike-through @endif">{{ FindObjectInArrayByPropertyValue($chores, 'id', $choreLogEntry->chore_id)->name }}</span>
@if($choreLogEntry->undone == 1)
<br>
{{ $L('Undone on') . ' ' . $choreLogEntry->undone_timestamp }}

View File

@ -48,7 +48,7 @@
</a>
</td>
<td>
<span class="@if($stockLogEntry->undone == 1) text-strike-through @endif">{{ FindObjectInArrayByPropertyValue($products, 'id', $stockLogEntry->product_id)->name }}</span>
<span class="name-anchor @if($stockLogEntry->undone == 1) text-strike-through @endif">{{ FindObjectInArrayByPropertyValue($products, 'id', $stockLogEntry->product_id)->name }}</span>
@if($stockLogEntry->undone == 1)
<br>
{{ $L('Undone on') . ' ' . $stockLogEntry->undone_timestamp }}