{% extends "base.html" %} {% from "macros.html" import icon, btn, badge %} {% block title %}{{ t('Import') }} {{ model_label }}{% endblock %} {% block content %}
{{ request.csrf_input() }}
{{ icon('upload', 12) }} {{ t('CSV Upload') }}
{{ icon('upload', 24, 'empty-icon') }}

{{ t('Click or drag CSV here') }}

{{ t('File must follow the column structure') }}

{{ btn(t("Start Import"), 'primary', icon_name='upload', type='submit', extra_class='btn-lg') }}

{{ t('Columns Mapping') }}

{% for col in importable %} {{ col }} {% endfor %}
  • {{ icon('check', 14, 'text-success') }} {{ t('The first row must be the header') }}
  • {{ icon('check', 14, 'text-success') }} {{ t('Unrecognized columns will be skipped') }}
  • {{ icon('check', 14, 'text-success') }} {{ t('Foreign keys should use numerical IDs') }}
{% if report %}
{{ icon('history', 12) }} {{ t('Import Summary') }}
{{ t('Successfully Created') }}
{{ report.created }}
{{ t('Records Updated') }}
{{ report.updated }}
{{ t('Failed Records') }}
{{ report.failed }}
{% if report.errors %}

{{ t('Detailed Errors') }}

{% for err in report.errors %}
{{ icon('x', 14) }} {{ err }}
{% endfor %}
{% endif %}
{% endif %} {% endblock %}