You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
241 lines
14 KiB
241 lines
14 KiB
{% extends "./layout/default" %}
|
|
{% import "roles-macros.twig" as helper %}
|
|
{% block content %}
|
|
<div class="container">
|
|
<div class="row mt-3">
|
|
<div class="col-lg-10 offset-lg-1">
|
|
<h1>{{ mainTitle }}</h1>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-lg-10 offset-lg-1">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
{{ subTitle }}
|
|
</div>
|
|
<div class="card-body">
|
|
<p>
|
|
CAMT files come in a few "layers" each with their own content.
|
|
Your options per field may be limited. Firefly III will not be able to
|
|
store all content of a CAMT file. If you feel your choices are limited, please
|
|
open an issue.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% if not errors.isEmpty %}
|
|
<div class="row mt-3">
|
|
<div class="col-lg-10 offset-lg-1">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
Errors :(
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="text-danger">Some error(s) occurred:</p>
|
|
<ul>
|
|
{% for error in errors.all %}
|
|
<li class="text-danger">{{ error }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<div class="row mt-3">
|
|
<div class="col-lg-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
Role configuration
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="post" action="{{ route('005-roles.post') }}" accept-charset="UTF-8">
|
|
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
|
|
|
|
{% for key, level in levels %}
|
|
<h4>Level {{ key }}: {{ level.title }}</h4>
|
|
<p>
|
|
{{ level.title }}: {{ level.explanation }}
|
|
</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width:30%;">Field<br><!--<span class="text-muted small">XML path</span>--></th>
|
|
<th style="width:30%;">Example data</th>
|
|
<th>Firefly III role</th>
|
|
<th style="width:10%">Map data?</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for field in level.fields %}
|
|
{% if true == field.section %}
|
|
<tr>
|
|
<th colspan="4">{{ trans('camt.section_' ~ field.title) }}</th>
|
|
</tr>
|
|
{% endif %}
|
|
{% if false == field.section %}
|
|
<tr>
|
|
<td>
|
|
{{ trans('camt.field_'~field.title) }}
|
|
{% if trans('camt.field_'~field.title~'_description') != 'camt.field_'~field.title~'_description' %}
|
|
<br><span class="text-muted small">{{ trans('camt.field_'~field.title~'_description') }}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if 0 == field.examples|length %}
|
|
<small class="text-muted"><em>(no example data)</em></small>
|
|
{% endif %}
|
|
{% if 0 != field.examples|length %}
|
|
TODO examples
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if 0 == field.roles|length %}
|
|
<small class="text-muted"><em>(no roles available)</em></small>
|
|
{% endif %}
|
|
{% if 0 != field.roles|length %}
|
|
<select name="roles[{{ field.title }}]" id="roles_{{ field.title }}" class="form-control">
|
|
{% for roleKey, role in field.roles %}
|
|
<option value="{{ roleKey }}" label="{{ trans('import.column_'~roleKey) }}"
|
|
{% if field.selected_role == roleKey %}selected="selected"{% endif %}>
|
|
{{ trans('import.column_'~roleKey) }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if true == field.mappable %}
|
|
<label for="do_mapping_{{ field.title }}">
|
|
<input type="checkbox" name="do_mapping[{{ field.title }}]" id="do_mapping_{{ field.title }}"
|
|
value="1"/>
|
|
</label>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endfor %}
|
|
<button type="submit" class="float-end btn btn-primary">Submit →</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-3">
|
|
<div class="col-lg-10 offset-lg-1">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="btn-group btn-group-sm">
|
|
<a href="{{ route('back.config') }}" class="btn btn-secondary"><span
|
|
class="fas fa-arrow-left"></span> Go back to configuration</a>
|
|
<a href="{{ route('flush') }}" class="btn btn-danger btn-sm"><span
|
|
class="fas fa-redo-alt"></span> Start over</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--
|
|
<div class="row">
|
|
<div class="col-lg-6">
|
|
|
|
</div>
|
|
<div class="col-lg-6">
|
|
|
|
</div>
|
|
</div>
|
|
-->
|
|
|
|
<!--<tr>
|
|
{{ helper.field("field_messageCreationDate") }}
|
|
{% if examples[index]|length > 0 %}
|
|
{% for example in examples[index] %}
|
|
<pre style="color:#e83e8c;margin-bottom:0;">{{ example }}</pre>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if index == configuration.getUniqueColumnIndex and 'cell' == configuration.getDuplicateDetectionMethod %}
|
|
{#
|
|
User cannot select a role because its the unique column so it MUST be this role.
|
|
#}
|
|
<p class="form-text">
|
|
<span class="text-muted small">
|
|
This column is your unique identifier, so it will be fixed to
|
|
</span>
|
|
<code class="small">{{ configuration.getUniqueColumnType }}</code>
|
|
</p>
|
|
{# smart users can overrule this of course. #}
|
|
<input type="hidden" name="roles[{{ index }}]"
|
|
value="{{ configuration.getUniqueColumnType }}"/>
|
|
{% else %}
|
|
<select name="roles[{{ index }}]" id="roles_{{ index }}"
|
|
class="form-control">
|
|
{{ helper.roleselection(roles) }}
|
|
</select>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<label for="do_mapping_{{ index }}">
|
|
{# reverse if statement is pretty sloppy but OK. #}
|
|
{% if index == configuration.getUniqueColumnIndex and 'cell' == configuration.getDuplicateDetectionMethod %}
|
|
|
|
{% else %}
|
|
<input type="checkbox"
|
|
{% if configuredDoMapping[index] %}checked{% endif %}
|
|
name="do_mapping[{{ index }}]" id="do_mapping_{{ index }}"
|
|
value="1"/>
|
|
{% endif %}
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
{{ helper.field("field_messagePageNr") }}
|
|
{% if examples[index]|length > 0 %}
|
|
{% for example in examples[index] %}
|
|
<pre style="color:#e83e8c;margin-bottom:0;">{{ example }}</pre>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if index == configuration.getUniqueColumnIndex and 'cell' == configuration.getDuplicateDetectionMethod %}
|
|
{#
|
|
User cannot select a role because its the unique column so it MUST be this role.
|
|
#}
|
|
<p class="form-text">
|
|
<span class="text-muted small">
|
|
This column is your unique identifier, so it will be fixed to
|
|
</span>
|
|
<code class="small">{{ configuration.getUniqueColumnType }}</code>
|
|
</p>
|
|
{# smart users can overrule this of course. #}
|
|
<input type="hidden" name="roles[{{ index }}]"
|
|
value="{{ configuration.getUniqueColumnType }}"/>
|
|
{% else %}
|
|
<select name="roles[{{ index }}]" id="roles_{{ index }}"
|
|
class="form-control">
|
|
{{ helper.roleselection(roles) }}
|
|
</select>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<label for="do_mapping_{{ index }}">
|
|
{# reverse if statement is pretty sloppy but OK. #}
|
|
{% if index == configuration.getUniqueColumnIndex and 'cell' == configuration.getDuplicateDetectionMethod %}
|
|
|
|
{% else %}
|
|
<input type="checkbox"
|
|
{% if configuredDoMapping[index] %}checked{% endif %}
|
|
name="do_mapping[{{ index }}]" id="do_mapping_{{ index }}"
|
|
value="1"/>
|
|
{% endif %}
|
|
</label>
|
|
</td>
|
|
</tr>-->
|
|
{% endblock %}
|
|
|