Fix form and upload thing.

This commit is contained in:
James Cole 2015-07-18 08:59:33 +02:00
parent 142bdc9430
commit a34782575f
3 changed files with 86 additions and 84 deletions

View File

@ -52,7 +52,7 @@ return [
'csv_config' => 'CSV import configuration', 'csv_config' => 'CSV import configuration',
'specifix' => 'Bank- or file specific fixes', 'specifix' => 'Bank- or file specific fixes',
'csv_import_account' => 'Default import account', 'csv_import_account' => 'Default import account',
'attachments' => 'Attachments', 'attachments[]' => 'Attachments',
'store_new_withdrawal' => 'Store new withdrawal', 'store_new_withdrawal' => 'Store new withdrawal',
'store_new_deposit' => 'Store new deposit', 'store_new_deposit' => 'Store new deposit',
'store_new_transfer' => 'Store new transfer', 'store_new_transfer' => 'Store new transfer',

View File

@ -51,7 +51,7 @@ return [
'date_format' => 'Datumformaat', 'date_format' => 'Datumformaat',
'csv_config' => 'Configuratiebestand', 'csv_config' => 'Configuratiebestand',
'specifix' => 'Bank- or of bestandsspecifieke opties', 'specifix' => 'Bank- or of bestandsspecifieke opties',
'attachments' => 'Bijlagen', 'attachments[]' => 'Bijlagen',
'store_new_withdrawal' => 'Nieuwe uitgave opslaan', 'store_new_withdrawal' => 'Nieuwe uitgave opslaan',
'store_new_deposit' => 'Nieuwe inkomsten opslaan', 'store_new_deposit' => 'Nieuwe inkomsten opslaan',

View File

@ -5,97 +5,99 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{{ Form.open({'class' : 'form-horizontal','id' : 'store','url' : route('transactions.store',what)}) }} <form method="POST" action="{{ route('transactions.store',what) }}" accept-charset="UTF-8" class="form-horizontal" id="store" enctype="multipart/form-data">
<input type="hidden" name="what" value="{{ what }}"/> <input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row"> <input type="hidden" name="what" value="{{ what }}"/>
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
<div class="form-group">
<label class="col-sm-4 control-label">Quickswitch</label>
<div class="col-sm-8"> <div class="row">
<div class="btn-group btn-group-justified"> <div class="col-lg-6 col-md-12 col-sm-12">
<a href="#" data-what="withdrawal" class="switch btn btn-default"> {{ 'withdrawal'|_ }}</a> <div class="box box-primary">
<a href="#" data-what="deposit" class="switch btn btn-default"> {{ 'deposit'|_ }}</a> <div class="box-header with-border">
<a href="#" data-what="transfer" class="switch btn btn-default">{{ 'transfer'|_ }}</a> <h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
<div class="form-group">
<label class="col-sm-4 control-label">Quickswitch</label>
<div class="col-sm-8">
<div class="btn-group btn-group-justified">
<a href="#" data-what="withdrawal" class="switch btn btn-default"> {{ 'withdrawal'|_ }}</a>
<a href="#" data-what="deposit" class="switch btn btn-default"> {{ 'deposit'|_ }}</a>
<a href="#" data-what="transfer" class="switch btn btn-default">{{ 'transfer'|_ }}</a>
</div>
</div> </div>
</div> </div>
<!-- DESCRIPTION ALWAYS AVAILABLE -->
{{ ExpandedForm.text('description') }}
<!-- ACCOUNT ONLY FOR DEPOSITS AND WITHDRAWALS -->
{{ ExpandedForm.select('account_id',accounts) }}
<!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS -->
{{ ExpandedForm.text('expense_account') }}
<!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS -->
{{ ExpandedForm.text('revenue_account') }}
<!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER -->
{{ ExpandedForm.select('account_from_id',accounts) }}
{{ ExpandedForm.select('account_to_id',accounts) }}
<!-- ALWAYS SHOW AMOUNT -->
{{ ExpandedForm.amount('amount') }}
<!-- ALWAYS SHOW DATE -->
{{ ExpandedForm.date('date', phpdate('Y-m-d')) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
<!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
{{ ExpandedForm.select('budget_id',budgets,0) }}
<!-- CATEGORY ALWAYS -->
{{ ExpandedForm.text('category') }}
<!-- TAGS -->
{{ ExpandedForm.text('tags') }}
<!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
{{ ExpandedForm.select('piggy_bank_id',piggies) }}
<!-- ATTACHMENTS -->
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple'}) }}
</div> </div>
</div>
<!-- DESCRIPTION ALWAYS AVAILABLE --> <!-- panel for options -->
{{ ExpandedForm.text('description') }} <div class="box">
<div class="box-header with-border">
<!-- ACCOUNT ONLY FOR DEPOSITS AND WITHDRAWALS --> <h3 class="box-title">{{ 'options'|_ }}</h3>
{{ ExpandedForm.select('account_id',accounts) }} </div>
<div class="box-body">
{{ ExpandedForm.optionsList('create','transaction') }}
<!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS --> </div>
{{ ExpandedForm.text('expense_account') }} <div class="box-footer">
<button type="submit" id="transaction-btn" class="btn btn-success pull-right">
<!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS --> {{ trans('form.store_new_'~what) }}
{{ ExpandedForm.text('revenue_account') }} </button>
</div>
<!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER -->
{{ ExpandedForm.select('account_from_id',accounts) }}
{{ ExpandedForm.select('account_to_id',accounts) }}
<!-- ALWAYS SHOW AMOUNT -->
{{ ExpandedForm.amount('amount') }}
<!-- ALWAYS SHOW DATE -->
{{ ExpandedForm.date('date', phpdate('Y-m-d')) }}
</div> </div>
</div> </div>
</div> </div>
<div class="col-lg-6 col-md-12 col-sm-12"> </form>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
<!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
{{ ExpandedForm.select('budget_id',budgets,0) }}
<!-- CATEGORY ALWAYS -->
{{ ExpandedForm.text('category') }}
<!-- TAGS -->
{{ ExpandedForm.text('tags') }}
<!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
{{ ExpandedForm.select('piggy_bank_id',piggies) }}
<!-- ATTACHMENTS -->
{{ ExpandedForm.file('attachments', {'multiple': 'multiple'}) }}
</div>
</div>
<!-- panel for options -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('create','transaction') }}
</div>
<div class="box-footer">
<button type="submit" id="transaction-btn" class="btn btn-success pull-right">
{{ trans('form.store_new_'~what) }}
</button>
</div>
</div>
</div>
</div>
{{ Form.close|raw }}
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}