firefly-iii/resources/views/transactions/create.twig

136 lines
5.7 KiB
Twig
Raw Normal View History

{% extends "./layout/default.twig" %}
2015-06-19 13:59:14 -05:00
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, what) }}
2015-06-19 13:59:14 -05:00
{% endblock %}
{% block content %}
2015-07-18 01:59:33 -05:00
<form method="POST" action="{{ route('transactions.store',what) }}" accept-charset="UTF-8" class="form-horizontal" id="store" enctype="multipart/form-data">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<input type="hidden" name="what" value="{{ what }}"/>
<div class="row">
<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="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>
2015-06-03 10:32:50 -05:00
</div>
2015-06-27 01:06:24 -05:00
</div>
2015-06-03 10:32:50 -05:00
2015-07-18 01:59:33 -05:00
<!-- DESCRIPTION ALWAYS AVAILABLE -->
{{ ExpandedForm.text('description') }}
2015-06-03 10:32:50 -05:00
2015-07-18 01:59:33 -05:00
<!-- ACCOUNT ONLY FOR DEPOSITS AND WITHDRAWALS -->
{{ ExpandedForm.select('account_id',accounts) }}
2015-07-18 01:59:33 -05:00
<!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS -->
{{ ExpandedForm.text('expense_account') }}
2015-07-18 01:59:33 -05:00
<!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS -->
{{ ExpandedForm.text('revenue_account') }}
2015-07-18 01:59:33 -05:00
<!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER -->
{{ ExpandedForm.select('account_from_id',accounts) }}
{{ ExpandedForm.select('account_to_id',accounts) }}
2015-07-18 01:59:33 -05:00
<!-- ALWAYS SHOW AMOUNT -->
{{ ExpandedForm.amount('amount') }}
2015-07-18 01:59:33 -05:00
<!-- ALWAYS SHOW DATE -->
{{ ExpandedForm.date('date', phpdate('Y-m-d')) }}
</div>
</div>
</div>
2015-07-18 01:59:33 -05:00
<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') }}
2015-07-18 01:59:33 -05:00
<!-- TAGS -->
{{ ExpandedForm.text('tags') }}
2015-07-17 14:45:58 -05:00
2015-07-18 01:59:33 -05:00
<!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
{{ ExpandedForm.select('piggy_bank_id',piggies) }}
2015-07-17 14:45:58 -05:00
2015-07-18 01:59:33 -05:00
<!-- ATTACHMENTS -->
2015-07-19 07:30:20 -05:00
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
2015-06-20 14:55:55 -05:00
2015-07-18 01:59:33 -05:00
</div>
</div>
2015-07-18 01:59:33 -05:00
<!-- 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>
2015-06-20 14:55:55 -05:00
</div>
</div>
</div>
2015-07-18 01:59:33 -05:00
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript">
var what = "{{ what }}";
2015-06-03 10:32:50 -05:00
var piggiesLength = {{ piggies|length }};
var doSwitch = true;
// some titles and names:
var txt = [];
var title = [];
var breadcrumbs = [];
var middleCrumbName = [];
var middleCrumbUrl = [];
var button = [];
{% for type in {0:'withdrawal',1:'deposit',2:'transfer'} %}
txt['{{ type }}'] = '{{ type|_ }}';
title['{{ type }}'] = '{{ trans('form.add_new_' ~ type) }}';
breadcrumbs['{{ type }}'] = '{{ trans('breadcrumbs.create_' ~ type) }}';
middleCrumbName['{{ type }}'] = '{{ trans('breadcrumbs.' ~ type ~ '_list') }}';
middleCrumbUrl['{{ type }}'] = '{{ route('transactions.index', type) }}';
button['{{ type }}'] = '{{ trans('form.store_new_' ~ type) }}';
{% endfor %}
</script>
<script type="text/javascript" src="js/bootstrap3-typeahead.min.js"></script>
<script type="text/javascript" src="js/bootstrap-tagsinput.min.js"></script>
2016-01-29 11:39:50 -06:00
<script type="text/javascript" src="js/transactions/create-edit.js"></script>
<script type="text/javascript" src="js/transactions/create.js"></script>
{% endblock %}
{% block styles %}
<link href="css/bootstrap-tagsinput.css" type="text/css" rel="stylesheet" media="all">
{% endblock %}