mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-27 17:31:09 -06:00
Try to fix modal dialog for piggy banks.
This commit is contained in:
parent
ae1245abec
commit
c6042a9053
@ -255,8 +255,8 @@ Route::group(
|
||||
* Piggy Bank Controller
|
||||
*/
|
||||
Route::get('/piggy-banks', ['uses' => 'PiggyBankController@index', 'as' => 'piggy-banks.index']);
|
||||
Route::get('/piggy-banks/add/{piggyBank}', ['uses' => 'PiggyBankController@add']); # add money
|
||||
Route::get('/piggy-banks/remove/{piggyBank}', ['uses' => 'PiggyBankController@remove']); #remove money
|
||||
Route::get('/piggy-banks/add/{piggyBank}', ['uses' => 'PiggyBankController@add','as' => 'piggy-banks.addMoney']); # add money
|
||||
Route::get('/piggy-banks/remove/{piggyBank}', ['uses' => 'PiggyBankController@remove','as' => 'piggy-banks.removeMoney']); #remove money
|
||||
Route::get('/piggy-banks/create', ['uses' => 'PiggyBankController@create', 'as' => 'piggy-banks.create']);
|
||||
Route::get('/piggy-banks/edit/{piggyBank}', ['uses' => 'PiggyBankController@edit', 'as' => 'piggy-banks.edit']);
|
||||
Route::get('/piggy-banks/delete/{piggyBank}', ['uses' => 'PiggyBankController@delete', 'as' => 'piggy-banks.delete']);
|
||||
|
@ -9,14 +9,14 @@ $(function () {
|
||||
|
||||
function addMoney(e) {
|
||||
var pigID = parseInt($(e.target).data('id'));
|
||||
$('#moneyManagementModal').empty().load('piggy-banks/add/' + pigID).modal('show');
|
||||
$('#moneyManagementModal').empty().load('piggy-banks/add/' + pigID, function() {$('#moneyManagementModal').modal('show');});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function removeMoney(e) {
|
||||
var pigID = parseInt($(e.target).data('id'));
|
||||
$('#moneyManagementModal').empty().load('piggy-banks/remove/' + pigID).modal('show');
|
||||
$('#moneyManagementModal').empty().load('piggy-banks/remove/' + pigID, function() {$('#moneyManagementModal').modal('show');});
|
||||
|
||||
return false;
|
||||
}
|
@ -1,17 +1,19 @@
|
||||
<form style="display: inline;" id="add" action="{{route('piggy-banks.add',$piggyBank->id)}}" method="POST">
|
||||
{!! Form::token() !!}
|
||||
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">Add money to {{{$piggyBank->name}}}</h4>
|
||||
</div>
|
||||
<form style="display: inline;" id="add" action="{{route('piggy-banks.add',$piggyBank->id)}}" method="POST">
|
||||
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
The maximum amount you can add is {!! Amount::format($maxAmount) !!}
|
||||
</p>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">€</div>
|
||||
{!! Form::token() !!}
|
||||
<input step="any" class="form-control" id="amount" autocomplete="off" name="amount" max="{{round($maxAmount,2)}}" type="number">
|
||||
</div>
|
||||
</div>
|
||||
@ -19,6 +21,7 @@
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
@ -36,9 +36,9 @@
|
||||
<div class="col-lg-1 col-md-4 col-sm-4 col-xs-4">
|
||||
<div class="btn-group btn-group-xs">
|
||||
@if($piggyBank->leftToSave > 0)
|
||||
<a href="#" class="btn btn-default addMoney" data-id="{{{$piggyBank->id}}}"><span data-id="{{{$piggyBank->id}}}" class="glyphicon glyphicon-plus"></span></a>
|
||||
<a href="{{route('piggy-banks.addMoney',$piggyBank->id)}}" class="btn btn-default addMoney" data-id="{{{$piggyBank->id}}}"><span data-id="{{{$piggyBank->id}}}" class="glyphicon glyphicon-plus"></span></a>
|
||||
@endif
|
||||
<a href="#" class="btn btn-default removeMoney" data-id="{{{$piggyBank->id}}}"><span data-id="{{{$piggyBank->id}}}" class="glyphicon glyphicon-minus"></span></a>
|
||||
<a href="{{route('piggy-banks.removeMoney',$piggyBank->id)}}" class="btn btn-default removeMoney" data-id="{{{$piggyBank->id}}}"><span data-id="{{{$piggyBank->id}}}" class="glyphicon glyphicon-minus"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- One block -->
|
||||
@ -124,6 +124,9 @@
|
||||
|
||||
<!-- this is the modal for the add/remove money routine: -->
|
||||
<div class="modal fade" id="moneyManagementModal">
|
||||
|
||||
|
||||
|
||||
</div><!-- /.modal -->
|
||||
|
||||
@stop
|
||||
|
Loading…
Reference in New Issue
Block a user