{% extends './layout/default' %}
{% block breadcrumbs %}
    {{ Breadcrumbs.render(Route.getCurrentRoute.getName, piggyBank) }}
{% endblock %}

{% block content %}
    <form id="remove" class="form-horizontal" action="{{ route('piggy-banks.remove', piggyBank.id) }}" method="POST">
        <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">{{ trans('firefly.remove_money_from_piggy_title', {name: piggyBank.name}) }}</h3>
                    </div>
                    <div class="box-body">

                        {% for account in accounts %}
                            <p>
                                {{  account.account.name }}: {{ 'max_amount_remove'|_ }}: {{ formatAmountByCurrency(piggyBank.transactionCurrency, account.saved_so_far) }}.
                            </p>
                            <div class="input-group">
                                <div class="input-group-addon">{{ piggyBank.transactionCurrency.symbol|raw }}</div>
                                <input step="any" class="form-control" id="amount_{{ account.account.id }}" autocomplete="off" name="amount[{{ account.account.id }}]" max="{{ account.saved_so_far }}"
                                       type="number">
                            </div>
                        {% endfor %}

                        <p>
                            &nbsp;
                        </p>
                        <button type="submit" class="btn btn-success pull-right">
                            {{ 'remove'|_ }}
                        </button>


                    </div>
                </div>
            </div>

        </div>
    </form>
{% endblock %}
