2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-14 15:41:10 +00:00

moving towards implementing bom upload as a page form rather than a modal form

This commit is contained in:
Oliver Walters
2019-07-02 18:43:26 +10:00
parent a23595c28d
commit 3c44fcaf5b
3 changed files with 33 additions and 8 deletions

View File

@@ -34,7 +34,9 @@
<div id='button-toolbar' class="btn-group" role="group" aria-label="...">
{% if editing_enabled %}
<button class='btn btn-default' type='button' title='Remove selected BOM items' id='bom-item-delete'><span class='glyphicon glyphicon-trash'></span></button>
<button class='btn btn-default' type='button' title='Import BOM data' id='bom-upload'><span class='glyphicon glyphicon-open-file'></span></button>
<a href="{% url 'upload-bom' part.id %}">
<button class='btn btn-default' type='button' title='Import BOM data' id='bom-upload'><span class='glyphicon glyphicon-open-file'></span></button>
</a>
<button class='btn btn-default' type='button' title='New BOM Item' id='bom-item-new'><span class='glyphicon glyphicon-plus'></span></button>
<button class='btn btn-default' type='button' title='Finish Editing' id='editing-finished'><span class='glyphicon glyphicon-ok'></span></button>
{% elif part.active %}
@@ -107,12 +109,6 @@
);
});
$("#bom-upload").click(function() {
launchModalForm(
"{% url 'bom-import' part.id %}",
);
});
{% else %}
$("#validate-bom").click(function() {

View File

@@ -0,0 +1,28 @@
{% extends "part/part_base.html" %}
{% load static %}
{% block details %}
{% include "part/tabs.html" with tab='bom' %}
<h4>Upload Bill of Materials</h4>
<hr>
<p>
Select a BOM file to upload for:<br>
<b>{{ part.name }} - <i>{{ part.description }}</i></b>
</p>
<p>The BOM file must contain the required named columns as provided in the <a href="/part/bom_template/">BOM Upload Template</a></a></p>
<form method="post" action='' class='js-modal-form' enctype="multipart/form-data">
{% csrf_token %}
{% load crispy_forms_tags %}
<input type='hidden' name='form_step' value='select_file'/>
{% crispy form %]
</form>
{% endblock %}