{# Variables - progress - import - complete - failedRows - objectName - indexRoute - indexRouteParams - step - currentRoute #} {% extends '@MauticCore/Default/content.html.twig' %} {% block mauticContent %}leadImport{% endblock %} {% block headerTitle %} {{ 'mautic.lead.import.leads'|trans({'%object%': objectName|trans}) }} {% endblock %} {% block content %} {% set object = app.request.get('object', 'contacts') %} {% set objectName = objectName|trans %} {% set percent = progress.toPercent %} {% set id = complete ? 'leadImportProgressComplete' : 'leadImportProgress' %} {% set header = complete ? 'mautic.lead.import.success' : 'mautic.lead.import.donotleave' %}
{% if not complete %}
{% include '@MauticCore/Components/pictogram.html.twig' with { pictogram: 'data--processing', size: 64 } %}

{{ header|trans({'object': object}) }}

{{ 'mautic.lead.import.inprogress'|trans }}
{% else %}
{% include '@MauticCore/Components/pictogram.html.twig' with { pictogram: 'data--storage', size: 64 } %}

{{ header|trans({'object': object}) }}

{% include '@MauticCore/Helper/_tag.html.twig' with { tags: [{ label: import.object == 'lead' ? 'mautic.lead.leads' : import.object == 'company' ? 'mautic.company.company' : import.object|capitalize, icon: import.object == 'lead' ? 'ri-user-6-line' : import.object == 'company' ? 'ri-building-2-line' : 'ri-shapes', color: 'green' }] } %} {{ 'mautic.core.now'|trans }}
{% endif %}
{{ percent }}%
{% if complete %}

{{ 'mautic.lead.segments.contacts.imported_database'|trans }}

{{'mautic.lead.import.stats.created'|trans}} {% include '@MauticCore/Helper/_tag.html.twig' with { tags: [{ label: import.insertedCount, color: 'warm-gray', size: 'sm' }] } %}
{{'mautic.lead.import.stats.merged'|trans}} {% include '@MauticCore/Helper/_tag.html.twig' with { tags: [{ label: import.updatedCount, color: 'warm-gray', size: 'sm' }] } %}
{{'mautic.lead.import.stats.ignored'|trans}} {% include '@MauticCore/Helper/_tag.html.twig' with { tags: [{ label: import.ignoredCount, color: 'warm-gray', size: 'sm' }] } %}
{% set tileContent %}
{% if import.name()|length > 40 %} {{ import.name()|slice(0, 40) }}... {% else %} {{ import.name() }} {% endif %} ({{ progress.total }})
{% endset %} {% include '@MauticCore/Components/tile.html.twig' with { type: 'base', content: tileContent } %}

{% endif %}
{% if failedRows is not empty %}
    {% for row in failedRows %} {% set lineNumber = row.properties.line|default('N/A') %} {% set failure = row.properties.error|default('N/A') %} {% endfor %}
{% endif %}
{% if not complete %} {% include '@MauticCore/Helper/button.html.twig' with { buttons: [ { label: 'mautic.core.form.cancel', variant: 'primary', danger: true, size: 'xl', href: path('mautic_import_action', {'objectAction': 'cancel', 'object': object}), wide: true, attributes: { 'data-toggle': 'ajax' } }, { label: 'mautic.lead.import.queue.btn', variant: 'primary', size: 'xl', href: path('mautic_import_action', {'objectAction': 'queue', 'object': object}), wide: true, attributes: { 'data-toggle': 'ajax', 'class': 'ma-0' } } ] } %} {% else %} {% set indexRouteParams = indexRouteParams|merge({ 'search': 'mautic.lead.lead.searchcommand.import_id'|trans ~ ':' ~ import.id }) %}
{% include '@MauticCore/Helper/button.html.twig' with { buttons: [ { label: 'mautic.lead.import.import_again', variant: 'link', href: path('mautic_import_action', {'object': 'contacts', 'objectAction': 'new'}), size: 'xl', attributes: { 'data-toggle': 'ajax' } }, { label: 'mautic.lead.import.result.info'|trans({'%import%': import.name()}), variant: 'link', href: path('mautic_import_action', {'objectAction': 'view', 'objectId': import.id, 'object': object}), size: 'xl', attributes: { 'data-toggle': 'ajax' } } ] } %}
{% include '@MauticCore/Helper/button.html.twig' with { buttons: [ { label: 'mautic.lead.list.view'|trans({'%objects%': objectName}), variant: 'secondary', size: 'xl', href: path(indexRoute, indexRouteParams), attributes: { 'data-toggle': 'ajax' }, } ] } %} {% endif %}
{% endblock %}