Initial code base for new CSV import.

This commit is contained in:
James Cole
2016-06-10 21:00:00 +02:00
parent beda6ec3a9
commit 5a79bc0a99
21 changed files with 646 additions and 123 deletions

View File

@@ -0,0 +1,84 @@
{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, job) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_csv_configure_title'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'import_csv_configure_intro' }}
</p>
</div>
</div>
</div>
</div>
<form class="form-horizontal" action="#" method="post" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_csv_configure_form'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.checkbox('has_headers',1,null,{helpText: 'csv_header_help'|_}) }}
{{ ExpandedForm.text('date_format','Ymd',{helpText: trans('firefly.csv_date_help', {dateExample: phpdate('Ymd')}) }) }}
{{ ExpandedForm.select('csv_delimiter', data.delimiters, 0, {helpText: 'csv_delimiter_help'|_} ) }}
{{ ExpandedForm.file('csv_config',{helpText: 'csv_csv_config_file_help'|_}) }}
{{ ExpandedForm.select('csv_import_account', data.accounts, 0, {helpText: 'csv_import_account_help'|_} ) }}
{{ ExpandedForm.multiCheckbox('specifix', data.specifix) }}
{% if not uploadPossible %}
<div class="form-group" id="csv_holder">
<div class="col-sm-4">
&nbsp;
</div>
<div class="col-sm-8">
<pre>{{ path }}</pre>
<p class="text-danger">
{{ 'csv_upload_not_writeable'|_ }}
</p>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-body">
<button type="submit" class="pull-right btn btn-success">
{{ 'csv_upload_button'|_ }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -25,7 +25,7 @@
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
{{ ExpandedForm.file('import_file',{helpText: 'import_file_help'|_}) }}
{{ ExpandedForm.file('import_file', {helpText: 'import_file_help'|_}) }}
{{ ExpandedForm.select('import_file_type', importFileTypes, defaultImportType, {'helpText' : 'import_file_type_help'|_}) }}

View File

@@ -110,8 +110,7 @@
</li>
<!-- import and export -->
<li class="{{ activeRoutePartial('export') }} {{ activeRoutePartial('csv') }} treeview">
<li class="{{ activeRoutePartial('export') }} {{ activeRoutePartial('import') }} treeview">
<a href="#">
<i class="fa fa-arrows-alt fa-fw"></i>
<span>
@@ -120,12 +119,9 @@
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
{% if Config.get('firefly.csv_import_enabled') %}
<li class="{{ activeRoutePartial('csv') }}">
<a href="{{ route('csv.index') }}"><i class="fa fa-file-text-o fa-fw"></i> {{ 'csv_import'|_ }}</a>
</li>
{% endif %}
<li class="{{ activeRoutePartial('import') }}">
<a href="{{ route('import.index') }}"><i class="fa fa-archive fa-fw"></i> {{ 'import_data'|_ }}</a>
</li>
<li class="{{ activeRoutePartial('export') }}">
<a href="{{ route('export.index') }}"><i class="fa fa-file-archive-o fa-fw"></i> {{ 'export_data'|_ }}</a>
</li>