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

Form is now fully transferred to a formview

This commit is contained in:
Oliver Walters
2019-07-02 19:20:45 +10:00
parent 4008a9fb45
commit fc5682f565
6 changed files with 40 additions and 21 deletions

View File

@@ -62,11 +62,6 @@
{% endblock %}
{% block js_load %}
{{ block.super }}
<script type='text/javascript' src="{% static 'script/inventree/bom.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}

View File

@@ -1,16 +1,20 @@
{% extends "modal_form.html" %}
{% extends "part/part_base.html" %}
{% load static %}
{% load inventree_extras %}
{% block form %}
{% block details %}
{% include "part/tabs.html" with tab='bom' %}
<h4>Upload Bill of Materials</h4>
<h4>Step 2 of 3 - Select BOM Fields</h4>
<p>Step 2 - Select Fields</p>
<hr>
{% if missing and missing|length > 0 %}
<div class='alert alert-danger alert-block' role='alert'>
Missing selections for the following required columns:
<br>
<ul>
{% for col in missing %}
{% for col in missing_columns %}
<li>{{ col }}</li>
{% endfor %}
</ul>
@@ -29,7 +33,7 @@
<thead>
<tr>
<th>Row</th>
{% for col in bom_cols %}
{% for col in bom_columns %}
<th>
<div>
<input type='hidden' name='col_name_{{ forloop.counter0 }}' value='{{ col.name }}'/>
@@ -45,11 +49,11 @@
<tbody>
<tr>
<td></td>
{% for col in bom_cols %}
{% for col in bom_columns %}
<td>
<select class='select' id='id_col_{{ forloop.counter0 }}' name='col_select_{{ forloop.counter0 }}'>
<option value=''>---------</option>
{% for req in req_cols %}
{% for req in bom_headers %}
<option value='{{ req }}'{% if req == col.guess %}selected='selected'{% endif %}>{{ req }}</option>
{% endfor %}
</select>
@@ -73,6 +77,7 @@
</tbody>
</table>
<button type="submit" class="save btn btn-default">Next</button>
</form>
<b>BOM Rows: {{ bom.row_count }}</b>

View File

@@ -1,5 +1,6 @@
{% extends "part/part_base.html" %}
{% load static %}
{% load inventree_extras %}
{% block details %}
@@ -8,6 +9,8 @@
<h4>Upload Bill of Materials</h4>
<hr>
<p>Step 1 - Select BOM File</p>
<div class='alert alert-info alert-block'>
<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>
</div>
@@ -20,7 +23,7 @@
{% crispy form %}
<button type="submit" class="save btn btn-default">Upload</button>
<button type="submit" class="save btn btn-default">Next</button>
</form>
{% endblock %}