Add attachment thing to views #2828

This commit is contained in:
James Cole
2020-03-19 08:56:00 +01:00
parent 6129b9d25c
commit aceaf5f891
10 changed files with 46 additions and 13 deletions

View File

@@ -9,7 +9,7 @@
var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";
</script>
<form action="{{ route('accounts.store') }}" method="post" id="store" class="form-horizontal">
<form action="{{ route('accounts.store') }}" method="post" id="store" class="form-horizontal" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="objectType" value="{{ objectType }}"/>
<input type="hidden" name="active" value="1"/>
@@ -58,6 +58,7 @@
{{ ExpandedForm.checkbox('include_net_worth', 1) }}
{{ ExpandedForm.textarea('notes',null,{helpText: trans('firefly.field_supports_markdown')}) }}
{{ ExpandedForm.location('location', null, {locations: locations}) }}
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
</div>
</div>
</div>

View File

@@ -11,8 +11,12 @@
var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";
</script>
{{ 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),
'enctype': 'multipart/form-data'
} ) }}
<input type="hidden" name="id" value="{{ account.id }}"/>
<input type="hidden" name="objectType" value="{{ objectType }}"/>
@@ -70,6 +74,8 @@
{# only correct way to do active checkbox #}
{{ ExpandedForm.location('location', null, {locations: locations}) }}
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
</div>
</div>