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 %}

View File

@ -22,12 +22,13 @@ part_detail_urls = [
url(r'^edit/?', views.PartEdit.as_view(), name='part-edit'),
url(r'^delete/?', views.PartDelete.as_view(), name='part-delete'),
url(r'^bom-export/?', views.BomDownload.as_view(), name='bom-export'),
url(r'^bom-import/?', views.BomUpload.as_view(), name='bom-import'),
url(r'^validate-bom/', views.BomValidate.as_view(), name='bom-validate'),
url(r'^duplicate/', views.PartDuplicate.as_view(), name='part-duplicate'),
url(r'^make-variant/', views.MakePartVariant.as_view(), name='make-part-variant'),
url(r'^pricing/', views.PartPricing.as_view(), name='part-pricing'),
url(r'^bom-upload/?', views.BomUpload.as_view(template_name='part/bom_upload/upload_file.html'), name='upload-bom'),
url(r'^variants/?', views.PartDetail.as_view(template_name='part/variants.html'), name='part-variants'),
url(r'^stock/?', views.PartDetail.as_view(template_name='part/stock.html'), name='part-stock'),
url(r'^allocation/?', views.PartDetail.as_view(template_name='part/allocation.html'), name='part-allocation'),