New code for import routine.

This commit is contained in:
James Cole
2016-07-02 17:33:57 +02:00
parent cbe3fb73a8
commit a56a5fc228
11 changed files with 264 additions and 129 deletions

View File

@@ -10,11 +10,11 @@
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_csv_configure_title'|_ }}</h3>
<h3 class="box-title">{{ trans('csv.import_configure_title') }}</h3>
</div>
<div class="box-body">
<p>
{{ 'import_csv_configure_intro'|_ }}
{{ trans('csv.import_configure_intro') }}
</p>
</div>
</div>
@@ -29,17 +29,14 @@
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_csv_configure_form'|_ }}</h3>
<h3 class="box-title">{{ trans('csv.import_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.checkbox('has_headers',1,job.configuration['has-headers'],{helpText: trans('csv.header_help')}) }}
{{ ExpandedForm.text('date_format',job.configuration['date-format'],{helpText: trans('csv.date_help', {dateExample: phpdate('Ymd')}) }) }}
{{ ExpandedForm.select('csv_delimiter', data.delimiters, job.configuration['delimiter'], {helpText: trans('csv.delimiter_help') } ) }}
{{ ExpandedForm.select('csv_import_account', data.accounts, 0, {helpText: trans('csv.import_account_help')} ) }}
{% for type, specific in data.specifics %}
<div class="form-group">
@@ -49,7 +46,8 @@
<div class="col-sm-8">
<div class="radio"><label>
{{ Form.checkbox('specifics['~type~']', '1', Input.old('specifics')[type] == '1', {'id': type ~ '_label'}) }}
{{ Form.checkbox('specifics['~type~']', '1',
job.configuration.specifics[type] == '1', {'id': type ~ '_label'}) }}
{{ specific.description }}
</label>
</div>
@@ -66,7 +64,7 @@
<div class="col-sm-8">
<pre>{{ data.upload_path }}</pre>
<p class="text-danger">
{{ 'csv_upload_not_writeable'|_ }}
{{ trans('csv.upload_not_writeable') }}
</p>
</div>
</div>
@@ -82,7 +80,7 @@
<div class="box">
<div class="box-body">
<button type="submit" class="pull-right btn btn-success">
{{ 'csv_upload_button'|_ }}
{{ 'import_finish_configuration'|_ }}
</button>
</div>
</div>