{% extends "part/part_app_base.html" %} {% load inventree_extras %} {% load i18n %} {% load static %} {% block sidebar %} {% url 'part-index' as url %} {% trans "Return to Parts" as text %} {% include "sidebar_link.html" with url=url text=text icon="fa-undo" %} {% endblock sidebar %} {% block content %} {% trans "Import Parts from File" as header_text %} {% trans "Insufficient privileges." as error_text %}

{{ header_text }} {{ wizard.form.media }}

{% if roles.part.change %}

{% blocktrans with step=wizard.steps.step1 count=wizard.steps.count %}Step {{step}} of {{count}}{% endblocktrans %} {% if description %}- {{ description }}{% endif %}

{% block form_alert %}
{% trans "Requirements for part import" %}:
{% endblock form_alert %}
{% csrf_token %} {% load crispy_forms_tags %} {% block form_buttons_top %} {% endblock form_buttons_top %}
{{ wizard.management_form }} {% block form_content %} {% crispy wizard.form %} {% endblock form_content %}
{% block form_buttons_bottom %} {% if wizard.steps.prev %} {% endif %}
{% endblock form_buttons_bottom %} {% else %} {% endif %}
{% endblock content %} {% block js_ready %} {{ block.super }} enableSidebar('partupload'); $('#part-template-download').click(function() { downloadPartImportTemplate(); }); function downloadPartImportTemplate(options={}) { var format = options.format; if (!format) { format = inventreeLoad('part-import-format', 'csv'); } constructFormBody({}, { title: '{% trans "Download Part Import Template" %}', fields: { format: { label: '{% trans "Format" %}', help_text: '{% trans "Select file format" %}', required: true, type: 'choice', value: format, choices: exportFormatOptions(), } }, onSubmit: function(fields, opts) { var format = getFormFieldValue('format', fields['format'], opts); // Save the format for next time inventreeSave('part-import-format', format); // Hide the modal $(opts.modal).modal('hide'); // Download the file location.href = `{% url "part-template-download" %}?format=${format}`; } }); } {% endblock js_ready %}