{% extends "./layout/default.twig" %}
{% block content %}
    {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, piggyBank) }}
    {{ Form.model(piggyBank, {'class' : 'form-horizontal','id' : 'update','url' : route('piggy-banks.update',piggyBank.id)}) }}

    <input type="hidden" name="repeats" value="0" />
    <input type="hidden" name="id" value="{{ piggyBank.id }}" />

<div class="row">
    <div class="col-lg-6 col-md-12 col-sm-6">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <i class="fa fa-fw fa-exclamation"></i> {{ 'mandatoryFields'|_ }}
            </div>
            <div class="panel-body">

                {{ ExpandedForm.text('name') }}
                {{ ExpandedForm.select('account_id',accounts,null,{'label' : 'saveOnAccount'|_}) }}
                {{ ExpandedForm.amount('targetamount') }}

            </div>
        </div>

    </div>
    <div class="col-lg-6 col-md-12 col-sm-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
            </div>
            <div class="panel-body">
                {{ ExpandedForm.date('targetdate') }}
                {{ ExpandedForm.checkbox('remind_me','1',preFilled.remind_me) }}
                {{ ExpandedForm.select('reminder',periods,preFilled.reminder) }}
            </div>
        </div>

        <!-- panel for options -->
        <div class="panel panel-default">
            <div class="panel-heading">
                <i class="fa fa-bolt"></i> {{ 'options'|_ }}
            </div>
            <div class="panel-body">
                {{ ExpandedForm.optionsList('update','piggy bank') }}
            </div>
        </div>

    </div>
</div>
<div class="row">
    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
        <p>
            <button type="submit" class="btn btn-lg btn-success">
                <i class="fa fa-pencil"></i> {{ 'update_piggy_button'|_ }}
            </button>
        </p>
    </div>
</div>

</form>
{% endblock %}
