Skip to content

Commit

Permalink
aggiornamento riga stato quota quando aggiornata/aggiunta. closes #233
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed Nov 26, 2023
1 parent 0dcf1be commit 4fa0a48
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions code/app/Http/Controllers/MovementsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public function show(Request $request, $id)
return view('movement.modal', [
'dom_id' => $dom_id,
'obj' => null,
'extra' => $request->input('extra', []),
'default' => Movement::generate($type, $sender, $target, $amount),
]);
}
Expand Down
1 change: 0 additions & 1 deletion code/resources/views/movement/modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<input type="hidden" name="close-modal" value="1">
<input type="hidden" name="update-field" value="movement-id-{{ $dom_id }}">
<input type="hidden" name="update-field" value="movement-date-{{ $dom_id }}">
<input type="hidden" name="close-modal" value="">
<input type="hidden" name="post-saved-function" value="refreshFilter">
<input type="hidden" name="post-saved-function" value="reloadLoadableHeaders">
<input type="hidden" name="data-refresh-target" value="#movements-filter">
Expand Down
22 changes: 15 additions & 7 deletions code/resources/views/user/partials/fee_row.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
$dom_id = rand();
$row_random_id = sprintf('fee-row-%s', $user->id);
$new_fee_url = route('movements.show', [
'movement' => 0,
Expand All @@ -11,7 +12,8 @@
'sender_type' => get_class($user),
'target_id' => $user->gas,
'target_type' => get_class($user->gas),
'amount' => $user->gas->getConfig('annual_fee_amount')
'amount' => $user->gas->getConfig('annual_fee_amount'),
'extra' => ['reload-portion' => '#' . $row_random_id],
]);
$user_status = $user->plainStatus();
Expand All @@ -22,17 +24,23 @@
$classes[] = 'hidden';
}
if ($user->fee) {
$classes[] = 'holding-movement-' . $user->fee->id;
}
if ($user->expiredFee()) {
$classes[] = 'table-danger';
}
if ($user->fee) {
$modify_fee_url = route('movements.show', [
'movement' => $user->fee->id,
'dom_id' => $dom_id,
'extra' => ['reload-portion' => '#' . $row_random_id],
]);
$classes[] = 'holding-movement-' . $user->fee->id;
}
?>

<tr data-filtered-actual_status="{{ $user_status }}" class="{{ join(' ', $classes) }}" data-reload-url="{{ route('users.fee', $user->id) }}">
<tr id="{{ $row_random_id }}" data-filtered-actual_status="{{ $user_status }}" class="{{ join(' ', $classes) }}" data-reload-url="{{ route('users.fee', $user->id) }}">
<td>
<input type="hidden" name="user_id[]" value="{{ $user->id }}">
{!! $user->printableName() !!}
Expand Down Expand Up @@ -65,7 +73,7 @@
<x-larastrap::ambutton color="success" :label="_i('Nuova Quota')" :data-modal-url="$new_fee_url" />

@if($user->fee)
<x-larastrap::ambutton color="warning" :label="_i('Modifica Quota')" :data-modal-url="route('movements.show', ['movement' => $user->fee->id, 'dom_id' => $dom_id])" />
<x-larastrap::ambutton color="warning" :label="_i('Modifica Quota')" :data-modal-url="$modify_fee_url" />
@endif
</td>
</tr>
Expand Down

0 comments on commit 4fa0a48

Please sign in to comment.