Restore views (#262)

This commit is contained in:
James Cole 2016-06-06 09:28:35 +02:00
parent 8dc106b79a
commit 8091dbfdfa
6 changed files with 365 additions and 1 deletions

View File

@ -0,0 +1,77 @@
{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'csv_column_roles_title'|_ }}</h3>
</div>
<div class="box-body">
<p>{{ 'csv_column_roles_text'|_ }}</p>
</div>
</div>
</div>
</div>
<form action="{{ route('csv.initial_parse') }}" method="post">
<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">{{ 'csv_column_roles_table'|_ }}</h3>
</div>
<div class="box-body">
<table class="table">
<thead>
<tr>
<th style="width:20%;">{{ 'csv_column_name'|_ }}</th>
<th style="width:40%;">{{ 'csv_column_example'|_ }}</th>
<th style="width:30%;">{{ 'csv_column_role'|_ }}</th>
<th style="width:10%;">{{ 'csv_do_map_value'|_ }}</th>
</tr>
</thead>
{% for index,header in headers %}
<tr>
<td>{{ header }}</td>
<td><code>{{ example[index] }}</code></td>
<td>
{{ Form.select(('role['~index~']'), availableRoles,roles[index],{class: 'form-control'}) }}
</td>
<td>
{{ Form.checkbox(('map['~index~']'),1,map[index]) }}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-body">
<a href="{{ route('csv.index') }}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> {{ 'csv_go_back'|_ }}</a>
<button type="submit" class="btn btn-success pull-right">
{{ 'csv_continue'|_ }} <i class="fa fa-arrow-right"></i>
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@ -0,0 +1,44 @@
{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'csv_download_config_title'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'csv_download_config_text'|_ }}
</p>
<p>
<a href="{{ route('csv.download-config') }}" class="btn btn-info"><i class="fa fa-download"></i> {{ 'csv_do_download_config'|_ }}</a>
</p>
<p>
{{ 'csv_more_information_text'|_ }}
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-body">
<a href="{{ route('csv.column-roles') }}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> {{ 'csv_go_back'|_ }}</a>
<a href="{{ route('csv.process') }}" class="btn btn-success pull-right">{{ 'csv_continue'|_ }} <i class="fa fa-arrow-right"></i></a>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,96 @@
{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'csv_index_title'|_ }}</h3>
</div>
<div class="box-body">
{{ 'csv_index_text'|_ }}
<p class="text-info">{{ 'csv_index_beta_warning'|_ }}</p>
{% if unsupported|length > 0 %}
<p class="text-danger">{{ 'csv_index_unsupported_warning'|_ }}</p>
<ul>
{% for message in unsupported %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
</div>
</div>
<form class="form-horizontal" action="{{ route('csv.upload') }}" 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">{{ 'csv_upload_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.file('csv',{helpText: 'csv_csv_file_help'|_}) }}
{{ ExpandedForm.select('csv_delimiter', delimiters, 0, {helpText: 'csv_delimiter_help'|_} ) }}
{{ ExpandedForm.file('csv_config',{helpText: 'csv_csv_config_file_help'|_}) }}
{{ ExpandedForm.select('csv_import_account', accounts, 0, {helpText: 'csv_import_account_help'|_} ) }}
{{ ExpandedForm.multiCheckbox('specifix', 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

@ -0,0 +1,82 @@
{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'csv_map_title'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'csv_map_text'|_ }}
</p>
</div>
</div>
</div>
</div>
<form action="{{ route('csv.save_mapping') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
{% for index,columnName in map %}
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ Config.get('csv.roles.'~columnName~'.name') }}</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
<thead>
<tr>
<th style="width:50%;">{{ 'csv_field_value'|_ }}</th>
<th>{{ 'csv_field_mapped_to'|_ }}</th>
</tr>
</thead>
<tbody>
{% for value in values[index] %}
<tr>
<td><code>{{ value }}</code></td>
<td>
{{ Form.select('mapping['~index~']['~value~']',options[index], mapped[index][value], {class: 'form-control'}) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endfor %}
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-body">
<a href="{{ route('csv.column-roles') }}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> {{ 'csv_go_back'|_ }}</a>
<button type="submit" class="btn btn-success pull-right">
{{ 'csv_continue'|_ }} <i class="fa fa-arrow-right"></i>
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@ -0,0 +1,58 @@
{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'csv_process_title'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ trans('firefly.csv_process_text',{rows: rows}) }}
</p>
{% if errors|length > 0 %}
<p class="text-danger">{{ Lang.choice('firefly.csv_import_with_errors',errors|length,{errors: errors|length}) }}</p>
<ul>
{% for index,err in errors %}
<li>{{ 'csv_row'|_ }} #{{ index }}: {{ err }}</li>
{% endfor %}
</ul>
<p>
{{ trans('firefly.csv_error_see_logs') }}
</p>
{% endif %}
<p>
{{ trans('firefly.csv_process_new_entries',{imported: imported}) }}
</p>
{% if journals|length > 0 %}
<ul>
{% for journal in journals %}
<li>#{{ journal.id }}: <a href="{{ route('transactions.show', [journal.id]) }}">{{ journal.description }}</a></li>
{% endfor %}
</ul>
{% endif %}
<p>
<a href="{{ route('csv.index') }}" class="btn btn-warning">{{ 'csv_start_over'|_ }}</a>
<a href="{{ route('index') }}" class="btn btn-success">{{ 'csv_to_index'|_ }}</a>
<a href="{{ route('csv.download-config') }}" class="btn btn-info"><i class="fa fa-download"></i> {{ 'csv_do_download_config'|_ }}</a>
</p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -110,7 +110,8 @@
</li> </li>
<!-- import and export --> <!-- import and export -->
<li class="{{ activeRoutePartial('export') }} treeview"> <li class="{{ activeRoutePartial('export') }} {{ activeRoutePartial('csv') }} treeview">
<a href="#"> <a href="#">
<i class="fa fa-arrows-alt fa-fw"></i> <i class="fa fa-arrows-alt fa-fw"></i>
<span> <span>
@ -119,6 +120,12 @@
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
<ul class="treeview-menu"> <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('export') }}"> <li class="{{ activeRoutePartial('export') }}">
<a href="{{ route('export.index') }}"><i class="fa fa-file-archive-o fa-fw"></i> {{ 'export_data'|_ }}</a> <a href="{{ route('export.index') }}"><i class="fa fa-file-archive-o fa-fw"></i> {{ 'export_data'|_ }}</a>
</li> </li>