Can edit as well.

This commit is contained in:
James Cole 2015-05-01 23:35:35 +02:00
parent 11baa968cd
commit f8e9ce0d52
4 changed files with 34 additions and 24 deletions

View File

@ -165,12 +165,12 @@ class ConfigServiceProvider extends ServiceProvider
'Config',
'ExpandedForm' => [
'is_safe' => [
'date','text','select','balance','optionsList'
'date','text','select','balance','optionsList','checkbox'
]
],
'Form' => [
'is_safe' => [
'input','select','checkbox'
'input','select','checkbox','model'
]
],
],

View File

@ -28,7 +28,7 @@
{{ ExpandedForm.balance('openingBalance') }}
{{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }}
{{ ExpandedForm.select('accountRole') }}
{{ ExpandedForm.select('accountRole', Config.get('firefly.accountRoles'),null,{'helpText' : 'Any extra options resulting from your choice can be set later.'}) }}
{{ ExpandedForm.balance('virtualBalance') }}
</div>

View File

@ -1,18 +1,18 @@
{% extends "./layout/default.twig" %}
{% block content %}
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $account) !!}
{!! Form::model($account, ['class' => 'form-horizontal','id' => 'update','url' => route('accounts.update',$account->id)]) !!}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute().getName(), account) }}
{{ Form.model(account, {'class' : 'form-horizontal','id' : 'update','url' : route('accounts.update',account.id) } ) }}
<input type="hidden" name="id" value="{{$account->id}}" />
<input type="hidden" name="id" value="{{account.id}}" />
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa {{{$subTitleIcon}}}"></i> Mandatory fields
<i class="fa {{ subTitleIcon }}"></i> Mandatory fields
</div>
<div class="panel-body">
{!! ExpandedForm::text('name') !!}
{{ ExpandedForm.text('name') }}
</div>
</div>
@ -23,37 +23,37 @@
<i class="fa fa-smile-o"></i> Optional fields
</div>
<div class="panel-body">
@if($account->accounttype->type == 'Default account' || $account->accounttype->type == 'Asset account')
{!! ExpandedForm::balance('openingBalance',null, ['currency' => $openingBalance ? $openingBalance->transactionCurrency : null]) !!}
{!! ExpandedForm::date('openingBalanceDate') !!}
{!! ExpandedForm::select('accountRole',Config::get('firefly.accountRoles')) !!}
{!! ExpandedForm::balance('virtualBalance',null) !!}
{!! Form::hidden('id',$account->id) !!}
@endif
{!! ExpandedForm::checkbox('active','1') !!}
{% if account.accounttype.type == 'Default account' or account.accounttype.type == 'Asset account' %}
{{ ExpandedForm.balance('openingBalance',null, {'currency' : openingBalance ? openingBalance.transactionCurrency : null}) }}
{{ ExpandedForm.date('openingBalanceDate') }}
{{ ExpandedForm.select('accountRole',Config.get('firefly.accountRoles')) }}
{{ ExpandedForm.balance('virtualBalance',null) }}
{% endif %}
{{ ExpandedForm.checkbox('active','1') }}
</div>
</div>
<!-- panel for credit card options -->
@if(Session::get('preFilled')['accountRole'] == 'ccAsset')
{% if Session.get('preFilled').accountRole == 'ccAsset' %}
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-credit-card"></i> Credit card options
</div>
<div class="panel-body">
{!! ExpandedForm::select('ccType',Config::get('firefly.ccTypes')) !!}
{!! ExpandedForm::date('ccMonthlyPaymentDate',null,['helpText' => 'Select any year and any month, it will be ignored anway. Only the day of the month is relevant.']) !!}
{{ ExpandedForm.select('ccType',Config.get('firefly.ccTypes')) }}
{{ ExpandedForm.date('ccMonthlyPaymentDate',null,{'helpText' : 'Select any year and any month, it will be ignored anway. Only the day of the month is relevant.'}) }}
</div>
</div>
@endif
{% endif %}
<!-- panel for options -->
<!-- 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','account') !!}
{{ ExpandedForm.optionsList('update','account') }}
</div>
</div>
</div>
@ -67,6 +67,5 @@
</p>
</div>
</div>
{!! Form::close() !!}
</form>
{% endblock %}

View File

@ -0,0 +1,11 @@
<div class="{{ classes }}">
<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
{{ Form.checkbox(name, value, options.checked, options) }}
</label>
</div>
{% include 'form/feedback.twig' %}
</div>
</div>