mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Can create accounts.
This commit is contained in:
parent
3e5e5b376f
commit
11baa968cd
@ -163,7 +163,16 @@ class ConfigServiceProvider extends ServiceProvider
|
|||||||
'Session',
|
'Session',
|
||||||
'Route',
|
'Route',
|
||||||
'Config',
|
'Config',
|
||||||
'ExpandedForm'
|
'ExpandedForm' => [
|
||||||
|
'is_safe' => [
|
||||||
|
'date','text','select','balance','optionsList'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'Form' => [
|
||||||
|
'is_safe' => [
|
||||||
|
'input','select','checkbox'
|
||||||
|
]
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -71,6 +71,12 @@ class General extends Twig_Extension
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$functions[] = new Twig_SimpleFunction(
|
||||||
|
'phpdate', function ($str) {
|
||||||
|
return date($str);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
$functions[] = new Twig_SimpleFunction(
|
$functions[] = new Twig_SimpleFunction(
|
||||||
'env', function ($name, $default) {
|
'env', function ($name, $default) {
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, what) }}
|
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, what) }}
|
||||||
<form action="{{ route('accounts.store') }}" method="post" id="store" class="form-horizontal">
|
<form action="{{ route('accounts.store') }}" method="post" id="store" class="form-horizontal">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||||
<input type="hidden" name="what" value="{{ what }}" />
|
<input type="hidden" name="what" value="{{ what }}" />
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
@ -18,7 +19,7 @@
|
|||||||
|
|
||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
|
|
||||||
@if(what == 'asset')
|
{% if what == 'asset' %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> Optional fields
|
<i class="fa fa-smile-o"></i> Optional fields
|
||||||
@ -26,13 +27,13 @@
|
|||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
||||||
{{ ExpandedForm.balance('openingBalance') }}
|
{{ ExpandedForm.balance('openingBalance') }}
|
||||||
{{ ExpandedForm.date('openingBalanceDate', date('Y-m-d')) }}
|
{{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }}
|
||||||
{{ ExpandedForm.select('accountRole',Config.get('firefly.accountRoles'), null, {'helpText' : 'Any extra options resulting from your choice can be set later.'}) }}
|
{{ ExpandedForm.select('accountRole') }}
|
||||||
{{ ExpandedForm.balance('virtualBalance') }}
|
{{ ExpandedForm.balance('virtualBalance') }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
{% endif %}
|
||||||
|
|
||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
@ -45,8 +46,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
<p>
|
<p>
|
||||||
<button type="submit" class="btn btn-lg btn-success">
|
<button type="submit" class="btn btn-lg btn-success">
|
||||||
@ -54,8 +55,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
-->
|
|
||||||
{% endblock %}
|
{% endblock %}
|
22
resources/twig/form/balance.twig
Normal file
22
resources/twig/form/balance.twig
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<div class="{{ classes }}">
|
||||||
|
<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle balanceCurrencyDropdown" data-toggle="dropdown" aria-expanded="false">
|
||||||
|
<span id="balanceCurrentSymbol">{{ defaultCurrency.symbol|raw }}</span> <span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu" role="menu">
|
||||||
|
{% for currency in currencies %}
|
||||||
|
<li><a href="#" class="currencySelect" data-id="{{ currency.id }}" data-field="balance" data-currency="{{ currency.code }}" data-symbol="{{ currency.symbol }}">{{ currency.name }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{ Form.input('number', name, value, options) }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% include 'form/feedback.twig' %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" name="balance_currency_id" value="{{ defaultCurrency.id }}" />
|
||||||
|
</div>
|
8
resources/twig/form/date.twig
Normal file
8
resources/twig/form/date.twig
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div class="{{ classes }}">
|
||||||
|
<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
{{ Form.input('date', name, value, options) }}
|
||||||
|
{% include 'form/help.twig' %}
|
||||||
|
{% include 'form/feedback.twig' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
4
resources/twig/form/feedback.twig
Normal file
4
resources/twig/form/feedback.twig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{% if errors.has(name) %}
|
||||||
|
<span class="form-control-feedback"><i class="fa fa-fw fa-remove"></i></span>
|
||||||
|
<p class="text-danger">{{ errors.first(name) }}</p>
|
||||||
|
{% endif %}
|
3
resources/twig/form/help.twig
Normal file
3
resources/twig/form/help.twig
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% if options.helpText %}
|
||||||
|
<p class="help-block">{{ options.helpText }}</p>
|
||||||
|
{% endif %}
|
30
resources/twig/form/options.twig
Normal file
30
resources/twig/form/options.twig
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{% if type == 'create' %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="{{ name }}_return_to_form" class="col-sm-4 control-label">
|
||||||
|
Return here
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="radio">
|
||||||
|
<label>
|
||||||
|
{{ Form.checkbox('create_another', '1') }}
|
||||||
|
After storing, return here to create another one.
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if type == 'update' %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="{{ name }}_return_to_edit" class="col-sm-4 control-label">
|
||||||
|
Return here
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="radio"><label>
|
||||||
|
{{ Form.checkbox('return_to_edit', '1', Input.old('return_to_edit') == '1') }}
|
||||||
|
After updating, return here.
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
9
resources/twig/form/select.twig
Normal file
9
resources/twig/form/select.twig
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<div class="{{ classes }}">
|
||||||
|
<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
{{ Form.select(name, list, selected , options ) }}
|
||||||
|
{% include 'form/help.twig' %}
|
||||||
|
{% include 'form/feedback.twig' %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
7
resources/twig/form/text.twig
Normal file
7
resources/twig/form/text.twig
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<div class="{{ classes }}">
|
||||||
|
<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
{{ Form.input('text', name, value, options) }}
|
||||||
|
{% include 'form/feedback.twig' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user