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', 'Config',
'ExpandedForm' => [ 'ExpandedForm' => [
'is_safe' => [ 'is_safe' => [
'date','text','select','balance','optionsList' 'date','text','select','balance','optionsList','checkbox'
] ]
], ],
'Form' => [ 'Form' => [
'is_safe' => [ 'is_safe' => [
'input','select','checkbox' 'input','select','checkbox','model'
] ]
], ],
], ],

View File

@ -28,7 +28,7 @@
{{ ExpandedForm.balance('openingBalance') }} {{ ExpandedForm.balance('openingBalance') }}
{{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }} {{ 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') }} {{ ExpandedForm.balance('virtualBalance') }}
</div> </div>

View File

@ -1,18 +1,18 @@
{% extends "./layout/default.twig" %} {% extends "./layout/default.twig" %}
{% block content %} {% block content %}
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $account) !!} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute().getName(), account) }}
{!! Form::model($account, ['class' => 'form-horizontal','id' => 'update','url' => route('accounts.update',$account->id)]) !!} {{ 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="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">
<i class="fa {{{$subTitleIcon}}}"></i> Mandatory fields <i class="fa {{ subTitleIcon }}"></i> Mandatory fields
</div> </div>
<div class="panel-body"> <div class="panel-body">
{!! ExpandedForm::text('name') !!} {{ ExpandedForm.text('name') }}
</div> </div>
</div> </div>
@ -23,29 +23,29 @@
<i class="fa fa-smile-o"></i> Optional fields <i class="fa fa-smile-o"></i> Optional fields
</div> </div>
<div class="panel-body"> <div class="panel-body">
@if($account->accounttype->type == 'Default account' || $account->accounttype->type == 'Asset account') {% if account.accounttype.type == 'Default account' or account.accounttype.type == 'Asset account' %}
{!! ExpandedForm::balance('openingBalance',null, ['currency' => $openingBalance ? $openingBalance->transactionCurrency : null]) !!} {{ ExpandedForm.balance('openingBalance',null, {'currency' : openingBalance ? openingBalance.transactionCurrency : null}) }}
{!! ExpandedForm::date('openingBalanceDate') !!} {{ ExpandedForm.date('openingBalanceDate') }}
{!! ExpandedForm::select('accountRole',Config::get('firefly.accountRoles')) !!} {{ ExpandedForm.select('accountRole',Config.get('firefly.accountRoles')) }}
{!! ExpandedForm::balance('virtualBalance',null) !!} {{ ExpandedForm.balance('virtualBalance',null) }}
{!! Form::hidden('id',$account->id) !!}
@endif {% endif %}
{!! ExpandedForm::checkbox('active','1') !!} {{ ExpandedForm.checkbox('active','1') }}
</div> </div>
</div> </div>
<!-- panel for credit card options --> <!-- 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 panel-default">
<div class="panel-heading"> <div class="panel-heading">
<i class="fa fa-credit-card"></i> Credit card options <i class="fa fa-credit-card"></i> Credit card options
</div> </div>
<div class="panel-body"> <div class="panel-body">
{!! ExpandedForm::select('ccType',Config::get('firefly.ccTypes')) !!} {{ 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.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>
</div> </div>
@endif {% endif %}
<!-- panel for options --> <!-- panel for options -->
<div class="panel panel-default"> <div class="panel panel-default">
@ -53,7 +53,7 @@
<i class="fa fa-bolt"></i> Options <i class="fa fa-bolt"></i> Options
</div> </div>
<div class="panel-body"> <div class="panel-body">
{!! ExpandedForm::optionsList('update','account') !!} {{ ExpandedForm.optionsList('update','account') }}
</div> </div>
</div> </div>
</div> </div>
@ -67,6 +67,5 @@
</p> </p>
</div> </div>
</div> </div>
</form>
{!! Form::close() !!}
{% endblock %} {% 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>