BOM upload templates fixes

This commit is contained in:
eeintech 2021-08-05 17:39:08 -04:00
parent 76572bf82f
commit 1eb8a9f310
2 changed files with 61 additions and 34 deletions

View File

@ -5,7 +5,7 @@
{% block form_alert %} {% block form_alert %}
{% if missing_columns and missing_columns|length > 0 %} {% if missing_columns and missing_columns|length > 0 %}
<div class='alert alert-danger alert-block' role='alert'> <div class='alert alert-danger alert-block' style='margin-top:12px;' role='alert'>
{% trans "Missing selections for the following required columns" %}: {% trans "Missing selections for the following required columns" %}:
<br> <br>
<ul> <ul>

View File

@ -3,47 +3,74 @@
{% load i18n %} {% load i18n %}
{% load inventree_extras %} {% load inventree_extras %}
{% block heading %} {% block menubar %}
{% trans "Upload BOM File" %} <ul class='list-group'>
<li class='list-group-item'>
<a href='#' id='part-menu-toggle'>
<span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
</a>
</li>
<li class='list-group-item' title='{% trans "Return To BOM" %}'>
<a href='{% url "part-detail" part.id %}' id='select-upload-file' class='nav-toggle'>
<span class='fas fa-undo side-icon'></span>
{% trans "Return To BOM" %}
</a>
</li>
</ul>
{% endblock %} {% endblock %}
{% block page_content %} {% block page_content %}
<h4>{% trans "Upload Bill of Materials" %}</h4> <div class='panel panel-default panel-inventree' id='panel-upload-file'>
<div class='panel-heading'>
{% block heading %}
<h4>{% trans "Upload Bill of Materials" %}</h4>
{{ wizard.form.media }}
{% endblock %}
</div>
<div class='panel-content'>
{% block details %}
{% block form_alert %} <p>{% blocktrans with step=wizard.steps.step1 count=wizard.steps.count %}Step {{step}} of {{count}}{% endblocktrans %}
<div class='alert alert-info alert-block'> {% if description %}- {{ description }}{% endif %}</p>
<b>{% trans "Requirements for BOM upload" %}:</b>
<ul>
<li>{% trans "The BOM file must contain the required named columns as provided in the " %} <b><a href="/part/bom_template/">{% trans "BOM Upload Template" %}</a></b></li>
<li>{% trans "Each part must already exist in the database" %}</li>
</ul>
</div>
{% endblock %}
<p>{% blocktrans with step=wizard.steps.step1 count=wizard.steps.count %}Step {{step}} of {{count}}{% endblocktrans %} <form action="" method="post" class='js-modal-form' enctype="multipart/form-data">
{% if description %}- {{ description }}{% endif %}</p> {% csrf_token %}
{% load crispy_forms_tags %}
<form action="" method="post" class='js-modal-form' enctype="multipart/form-data"> {% block form_buttons_top %}
{% csrf_token %} {% endblock form_buttons_top %}
{% load crispy_forms_tags %}
{% block form_buttons_top %} {% block form_alert %}
{% endblock form_buttons_top %} <div class='alert alert-info alert-block'>
<b>{% trans "Requirements for BOM upload" %}:</b>
<ul>
<li>{% trans "The BOM file must contain the required named columns as provided in the " %} <b><a href="/part/bom_template/">{% trans "BOM Upload Template" %}</a></b></li>
<li>{% trans "Each part must already exist in the database" %}</li>
</ul>
</div>
{% endblock %}
<table class='table table-striped' style='margin-top: 12px; margin-bottom: 0px'> <table class='table table-striped' style='margin-top: 12px; margin-bottom: 0px'>
{{ wizard.management_form }} {{ wizard.management_form }}
{% block form_content %} {% block form_content %}
{% crispy wizard.form %} {% crispy wizard.form %}
{% endblock form_content %} {% endblock form_content %}
</table> </table>
{% block form_buttons_bottom %} {% block form_buttons_bottom %}
{% if wizard.steps.prev %} {% if wizard.steps.prev %}
<button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}" class="save btn btn-default">{% trans "Previous Step" %}</button> <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}" class="save btn btn-default">{% trans "Previous Step" %}</button>
{% endif %} {% endif %}
<button type="submit" class="save btn btn-default">{% trans "Upload File" %}</button> <button type="submit" class="save btn btn-default">{% trans "Upload File" %}</button>
</form> </form>
{% endblock form_buttons_bottom %} {% endblock form_buttons_bottom %}
{% endblock %} {% endblock details %}
</div>
{% endblock page_content %}
{% block js_ready %}
{{ block.super }}
{% endblock js_ready %}