mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-06 19:25:28 +02:00
49 lines
No EOL
1.8 KiB
Twig
49 lines
No EOL
1.8 KiB
Twig
{% extends "main_card.html.twig" %}
|
|
|
|
{% block title %}{% trans %}parts.import.title{% endtrans %}{% endblock %}
|
|
|
|
{% block card_title %}
|
|
<i class="fa-solid fa-file-import fa-fw"></i> {% trans %}parts.import.title{% endtrans %}
|
|
{% endblock %}
|
|
|
|
{% block before_card %}
|
|
{% if import_errors %}
|
|
<div class="alert alert-danger">
|
|
<h4><i class="fa-solid fa-exclamation-triangle fa-fw"></i> {% trans %}parts.import.errors.title{% endtrans %}</h4>
|
|
<ul>
|
|
{% for name, error in import_errors %}
|
|
<li>
|
|
<b>{{ name }}: </b>
|
|
{% for violation in error.violations %}
|
|
{% dump(violation) %}
|
|
<i>{{ violation.propertyPath }}</i>: {{ violation.message|trans(violation.parameters, 'validators') }}<br>
|
|
{% endfor %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block card_content %}
|
|
<p class="text-muted offset-sm-3">
|
|
{% trans %}parts.import.help{% endtrans %}<br>
|
|
{% trans with {'%link%': 'https://docs.part-db.de/'} %}parts.import.help_documentation{% endtrans %}
|
|
</p>
|
|
|
|
{{ form(import_form) }}
|
|
|
|
{% if imported_entities %}
|
|
<hr>
|
|
<h4>{% trans %}parts.import.errors.imported_entities{% endtrans %} ({{ imported_entities | length }}):</h4>
|
|
<ul>
|
|
{% for entity in imported_entities %}
|
|
{# @var \App\Entity\Parts\Part entity #}
|
|
{% if entity.id %}
|
|
<li><a href="{{ entity_url(entity) }}">{{ entity.name }}</a> (ID: {{ entity.iD }})</li>
|
|
{% else %}
|
|
<li>{{ entity.name }}</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endblock %} |