mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-11 00:16:54 +00:00
Moved views.
This commit is contained in:
134
resources/views/transactions/create.twig
Normal file
134
resources/views/transactions/create.twig
Normal file
@@ -0,0 +1,134 @@
|
||||
{% extends "./layout/default.twig" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, what) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<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>
|
||||
</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','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
|
||||
|
||||
</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>
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script type="text/javascript">
|
||||
var what = "{{ what }}";
|
||||
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>
|
||||
<script type="text/javascript" src="js/transactions.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block styles %}
|
||||
<link href="css/bootstrap-tagsinput.css" type="text/css" rel="stylesheet" media="all">
|
||||
{% endblock %}
|
||||
42
resources/views/transactions/delete.twig
Normal file
42
resources/views/transactions/delete.twig
Normal file
@@ -0,0 +1,42 @@
|
||||
{% extends "./layout/default.twig" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, journal) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ Form.open({'class' : 'form-horizontal','id' : 'destroy','url' : route('transactions.destroy',journal.id)}) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-lg-offset-3 col-md-6 col-sm-12">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('form.delete_journal', {'description': journal.description}) }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p class="text-danger">
|
||||
{{ trans('form.permDeleteWarning') }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{{ trans('form.journal_areYouSure', {'description': journal.description}) }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>
|
||||
{% if journal.transactiontype.type == 'Withdrawal' %}
|
||||
<a href="{{ route('transactions.index','withdrawal') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
|
||||
{% endif %}
|
||||
{% if journal.transactiontype.type == 'Deposit' %}
|
||||
<a href="{{ route('transactions.index','deposit') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
|
||||
{% endif %}
|
||||
{% if journal.transactiontype.type == 'Transfer' %}
|
||||
<a href="{{ route('transactions.index','transfers') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form.close|raw }}
|
||||
{% endblock %}
|
||||
114
resources/views/transactions/edit.twig
Normal file
114
resources/views/transactions/edit.twig
Normal file
@@ -0,0 +1,114 @@
|
||||
{% extends "./layout/default.twig" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, journal) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form method="POST" action="{{ route('transactions.update',journal.id) }}" accept-charset="UTF-8" class="form-horizontal" id="update"
|
||||
enctype="multipart/form-data">
|
||||
|
||||
<input name="_token" type="hidden" value="{{ csrf_token() }}">
|
||||
<input type="hidden" name="id" value="{{ journal.id }}"/>
|
||||
<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">
|
||||
<!-- ALWAYS AVAILABLE -->
|
||||
{{ ExpandedForm.text('description',journal.description) }}
|
||||
|
||||
<!-- SHOW ACCOUNT (FROM) ONLY FOR WITHDRAWALS AND DEPOSITS -->
|
||||
{% if what == 'deposit' or what == 'withdrawal' %}
|
||||
{{ ExpandedForm.select('account_id',accounts,data['account_id']) }}
|
||||
{% endif %}
|
||||
|
||||
<!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS -->
|
||||
{% if what == 'withdrawal' %}
|
||||
{{ ExpandedForm.text('expense_account',data['expense_account']) }}
|
||||
{% endif %}
|
||||
|
||||
<!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS -->
|
||||
{% if what == 'deposit' %}
|
||||
{{ ExpandedForm.text('revenue_account',data['revenue_account']) }}
|
||||
{% endif %}
|
||||
|
||||
<!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER -->
|
||||
{% if what == 'transfer' %}
|
||||
{{ ExpandedForm.select('account_from_id',accounts,data['account_from_id']) }}
|
||||
{{ ExpandedForm.select('account_to_id',accounts,data['account_to_id']) }}
|
||||
{% endif %}
|
||||
|
||||
<!-- ALWAYS SHOW AMOUNT -->
|
||||
{{ ExpandedForm.amount('amount',data.amount,{'currency' : journal.transactionCurrency}) }}
|
||||
|
||||
<!-- ALWAYS SHOW DATE -->
|
||||
{{ ExpandedForm.date('date',data['date']) }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- close panel -->
|
||||
|
||||
</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 -->
|
||||
{% if what == 'withdrawal' %}
|
||||
{{ ExpandedForm.select('budget_id',budgets,data['budget_id']) }}
|
||||
{% endif %}
|
||||
|
||||
<!-- CATEGORY ALWAYS -->
|
||||
{{ ExpandedForm.text('category',data['category']) }}
|
||||
|
||||
<!-- TAGS -->
|
||||
{{ ExpandedForm.text('tags') }}
|
||||
|
||||
<!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
|
||||
{% if what == 'withdrawal' and piggies|length > 0 %}
|
||||
{{ ExpandedForm.select('piggy_bank_id',piggies,data['piggy_bank_id']) }}
|
||||
{% endif %}
|
||||
|
||||
<!-- ATTACHMENTS -->
|
||||
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end of panel for options-->
|
||||
|
||||
<!-- 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('update','transaction') }}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="pull-right btn btn-success">{{ ('update_' ~ what)|_ }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script type="text/javascript">
|
||||
var what = "{{ what }}";
|
||||
</script>
|
||||
<script type="text/javascript" src="js/bootstrap3-typeahead.min.js"></script>
|
||||
<script type="text/javascript" src="js/bootstrap-tagsinput.min.js"></script>
|
||||
<script type="text/javascript" src="js/transactions.js"></script>
|
||||
{% endblock %}
|
||||
{% block styles %}
|
||||
<link href="css/bootstrap-tagsinput.css" type="text/css" rel="stylesheet" media="all">
|
||||
{% endblock %}
|
||||
25
resources/views/transactions/index.twig
Normal file
25
resources/views/transactions/index.twig
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends "./layout/default.twig" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, what) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-sm-12 col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ subTitle }}</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
{% include 'list.journals' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<script src="js/transactions.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
176
resources/views/transactions/show.twig
Normal file
176
resources/views/transactions/show.twig
Normal file
@@ -0,0 +1,176 @@
|
||||
{% extends "./layout/default.twig" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, journal) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Metadata</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
<table class="table table-hover sortable">
|
||||
<tr>
|
||||
<td>{{ trans('list.date') }}</td>
|
||||
<td>{{ journal.date.formatLocalized(monthAndDayFormat) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ trans('list.type') }}</td>
|
||||
<td>{{ journal.transactiontype.type|_ }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ trans('list.completed') }}</td>
|
||||
<td>
|
||||
{% if journal.completed %}
|
||||
<span class="text-success">{{ 'yes'|_ }}</span>
|
||||
{% else %}
|
||||
<span class="text-danger">{{ 'no'|_ }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% for budget in journal.budgets %}
|
||||
<tr>
|
||||
<td>{{ 'budget'|_ }}</td>
|
||||
<td><a href="{{ route('budgets.show',budget.id) }}">{{ budget.name }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for category in journal.categories %}
|
||||
<tr>
|
||||
<td>{{ 'category'|_ }}</td>
|
||||
<td><a href="{{ route('categories.show',category.id) }}">{{ category.name }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if journal.bill %}
|
||||
<tr>
|
||||
<td>{{ 'bill'|_ }}</td>
|
||||
<td><a href="{{ route('bills.show', journal.bill_id) }}">{{ journal.bill.name }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if journal.tags|length > 0 %}
|
||||
<tr>
|
||||
<td>{{ 'tags'|_ }}</td>
|
||||
<td>
|
||||
{% for tag in journal.tags %}
|
||||
|
||||
<h4 style="display: inline;"><a class="label label-success" href="{{ route('tags.show',tag) }}">
|
||||
{% if tag.tagMode == 'nothing' %}
|
||||
<i class="fa fa-fw fa-tag"></i>
|
||||
{% endif %}
|
||||
{% if tag.tagMode == 'balancingAct' %}
|
||||
<i class="fa fa-fw fa-refresh"></i>
|
||||
{% endif %}
|
||||
{% if tag.tagMode == 'advancePayment' %}
|
||||
<i class="fa fa-fw fa-sort-numeric-desc"></i>
|
||||
{% endif %}
|
||||
{{ tag.tag }}</a>
|
||||
</h4>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-default" href="{{ route('transactions.edit',journal.id) }}">{{ 'edit'|_ }}</a>
|
||||
<a href="{{ route('transactions.delete',journal.id) }}" class="btn btn-danger">{{ 'delete'|_ }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- attachments -->
|
||||
{% if journal.attachments|length > 0 %}
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'attachments'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
<table class="table table-hover">
|
||||
{% for att in journal.attachments %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="btn-group btn-group-xs">
|
||||
<a href="{{ route('attachments.edit', att.id) }}" class="btn btn-default"><i class="fa fa-pencil"></i></a>
|
||||
<a href="{{ route('attachments.delete', att.id) }}" class="btn btn-danger"><i class="fa fa-trash"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<i class="fa {{ att.mime|mimeIcon }}"></i>
|
||||
<a href="{{ route('attachments.download', att.id) }}" tle="{{ att.filename }}">
|
||||
{% if att.title %}
|
||||
{{ att.title }}
|
||||
{% else %}
|
||||
{{ att.filename }}
|
||||
{% endif %}
|
||||
</a>
|
||||
({{ att.size|filesize }})
|
||||
{% if att.description %}
|
||||
<br/>
|
||||
<em>{{ att.description }}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="width:100px;">
|
||||
<img src="{{ route('attachments.preview', att.id) }}"></img>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- events, if present -->
|
||||
{% if journal.piggyBankEvents|length > 0 %}
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'piggyBanks'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{% include 'list/piggy-bank-events' with {'events': events, 'showPiggyBank':true} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
|
||||
{% for t in journal.transactions %}
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ t.account.name }}</h3>
|
||||
</div>
|
||||
<table class="table table-hover sortable">
|
||||
<tr>
|
||||
<td>{{ 'account'|_ }}</td>
|
||||
<td><a href="{{ route('accounts.show',t.account.id) }}">{{ t.account.name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'account_type'|_ }}</td>
|
||||
<td>{{ t.account.accounttype.type|_ }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'amount'|_ }}</td>
|
||||
<td>{{ t|formatTransaction }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'newBalance'|_ }}</td>
|
||||
<td>{{ t.before|formatAmount }} → {{ t.after|formatAmount }}</td>
|
||||
</tr>
|
||||
{% if t.description %}
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>{{ t.description }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script type="text/javascript" src="js/transactions.js"></script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user