{% extends "base.html" %} {% load i18n static %} {% block title %}{% trans "Import requirements" %}{% endblock %} {% block contents %}
{% csrf_token %} {% for field in form %}
{{ field }} {% if field.help_text %} {{ field.help_text }} {% endif %} {% if field.errors %} {{ field.errors }} {% endif %}
{% endfor %} {% trans "Cancel" %}
{% trans "Download a template" %}

{% blocktrans %}Headers + three sample rows so you can see the exact column shape. Fill in your own rows and upload.{% endblocktrans %}

{% trans "Download XLSX template" %} {% trans "Download CSV template" %}
{% trans "Accepted columns" %}

{% trans "Required columns:" %} identifier, title.

{% trans "Optional columns (all free-text or FK names):" %}

description, rationale, category, source, source_section, level, product, project, feature, parent_requirement, status, priority, verification_method, asil, dal, iec62304_class, doc_id, doc_revision, effective_date, change_reason, jira_issue_key, external_refs (JSON).

{% trans "FK values resolve by human-friendly names: category name, level code, requirement identifier for parent, etc." %}

{% if import_result %}
{% trans "Total rows" %}

{{ import_result.rows_total }}

{% trans "Valid" %}

{{ import_result.rows_ok }}

{% trans "Created / Updated" %}

{{ import_result.rows_created }} / {{ import_result.rows_updated }}

{% trans "Errors" %}

{{ import_result.errors|length }}

{% if import_result.errors %}
{% trans "Error detail" %}
{% for err in import_result.errors %} {% endfor %}
{% trans "Row" %} {% trans "Identifier" %} {% trans "Error" %}
{{ err.row_num }} {{ err.identifier }} {{ err.message }}
{% endif %} {% if dry_run_used and import_result.rows_ok %}
{% csrf_token %}

{% trans "To commit the rows above, re-submit the same CSV with 'Dry run' unchecked." %}

{% endif %} {% endif %}
{% endblock %}