Add component parameter forms
This commit is contained in:
@@ -95,7 +95,29 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>Parameters</h3>
|
||||
<h3>Parameters <button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#new-component-parameter-modal"><i class="bi bi-plus-circle"></i></button></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th scope="col">Parameter</th>
|
||||
<th scope="col">Value</th>
|
||||
<th scope="col"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for param in parameters %}
|
||||
<tr>
|
||||
<td>{{param.parameter_type.parameter_name}}</td>
|
||||
<td>{{param.resolved_value_as_string}}</td>
|
||||
<td>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" value="{{param.id}}" name="param_num">
|
||||
<button class="btn btn-danger" name="submit-delete-param">X</button>
|
||||
</form>
|
||||
<td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3>Distributor Part Numbers <button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#new-distributor-number-modal"><i class="bi bi-plus-circle"></i></button></h3>
|
||||
@@ -204,6 +226,7 @@
|
||||
|
||||
{% include 'parts/modals/new-distributor-number-modal.html' with component_name=component.name form=new_distri_num_form %}
|
||||
{% include 'parts/modals/edit-component-modal.html' with heading="Edit "|add:component.name form=comp_form %}
|
||||
{% include 'parts/modals/new-component-parameter-modal.html' with component_name=component.name form=new_param_form %}
|
||||
{% endblock content %}
|
||||
|
||||
{% block custom_scripts %}
|
||||
@@ -218,6 +241,9 @@ bootstrap.Modal.getOrCreateInstance(document.getElementById('component-delete-mo
|
||||
{% if new_distri_num_form.errors %}
|
||||
bootstrap.Modal.getOrCreateInstance(document.getElementById('new-distributor-number-modal')).show();
|
||||
{% endif %}
|
||||
{% if new_param_form.errors %}
|
||||
bootstrap.Modal.getOrCreateInstance(document.getElementById('new-component-parameter-modal')).show();
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endblock custom_scripts %}
|
||||
|
||||
|
Reference in New Issue
Block a user