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

Set part category for multiple parts at once

This commit is contained in:
Oliver Walters
2019-06-25 19:15:39 +10:00
parent ea44f28bc7
commit d6fcf85cd2
7 changed files with 181 additions and 2 deletions

View File

@@ -0,0 +1,58 @@
{% extends "modal_form.html" %}
{% block form %}
<form method="post" action='' class='js-modal-form' enctype="multipart/form-data">
{% csrf_token %}
{% load crispy_forms_tags %}
<div class='control-group'>
<label class='control-label requiredField'>Location</label>
<div class='controls'>
<select class='select' name='part_category'>
<option value=''>---------</option>
{% for cat in categories %}
<option value='{{ cat.id }}' {% if category and category.id == cat.id %}selected='selected'{% endif %}>{{ cat.pathstring }} - {{ cat.description }}</option>
{% endfor %}
</select>
{% if category %}
<p class='help-block'>Select Part Category</p>
{% else %}
<p class='help-inline'>Select Part Category</p>
{% endif %}
</div>
</div>
<label class='control-label'>Parts</label>
<p class='help-block'>Set category for the following parts</p>
<table class='table table-striped'>
<tr>
<th>Part</th>
<th>Description</th>
<th>Category</th>
<th>
</tr>
{% for part in parts %}
<tr id='part_row_{{ part.id }}'>
<input type='hidden' name='part_id_{{ part.id }}' value='1'/>
<td>
{% include "hover_image.html" with image=part.image hover=False %}
{{ part.full_name }}
</td>
<td>
{{ part.description }}
</td>
<td>
{{ part.category.pathstring }}
</td>
<td>
<button class='btn btn-default btn-remove' title='Remove part' type='button'>
<span row='part_row_{{ part.id }}' onClick='removeRowFromModalForm()' class='glyphicon glyphicon-small glyphicon-remove'></span>
</button>
</td>
</tr>
{% endfor %}
</table>
</form>
{% endblock %}