Try out some stuff
This commit is contained in:
@@ -95,74 +95,10 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>Parameters</h3>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th scope="col">Parameter</th>
|
||||
<th scope="col">Value</th>
|
||||
<th scope="col">Unit</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for f in param_formset %}
|
||||
<tr>
|
||||
<td><input type="text" class="form-control{% if f.parameter_type.errors %} is-invalid{% endif %}" name="{{f.parameter_type.html_name}}" value="{{f.parameter_type.value}}"></td>
|
||||
<td><input type="text" class="form-control{% if f.value.errors %} is-invalid{% endif %}" name="{{f.value.html_name}}" value="{{f.value.value}}"></td>
|
||||
<td>{{f.parameter_type_object.unit|default_if_none:"-"}}</td>
|
||||
</tr>
|
||||
{% if f.errors %}
|
||||
<tr class="text-danger">
|
||||
<td>
|
||||
{% if f.parameter_type.errors %}
|
||||
{{f.parameter_type.errors}}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if f.value.errors %}
|
||||
{{f.value.errors}}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{{param_formset.management_form}}
|
||||
<input type="submit" class="btn btn-primary" name="submit-edit-params" value="Save Parameters">
|
||||
</form>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3>Distributor Part Numbers</h3>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th scope="col">Distributor</th>
|
||||
<th scope="col">Part Number</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for form in distri_num_formset %}
|
||||
<tr>
|
||||
<td>
|
||||
{% if form.instance.distributor %}
|
||||
{{form.instance.distributor.name}}
|
||||
{% else %}
|
||||
<input type="text" name="__unused_search" id="{{form.distributor.id_for_label}}-search">
|
||||
{% endif %}
|
||||
</td>
|
||||
<input type="hidden" name="{{form.distributor.html_name}}" id="{{form.distributor.id_for_label}}" value="{{form.distributor.value|default_if_none:""}}">
|
||||
<input type="hidden" name="{{form.id.html_name}}" value="{{form.id.value|default_if_none:""}}">
|
||||
<td>
|
||||
<input class="form-control" type="text" name="{{form.distributor_part_number.html_name}}" id="{{form.distributor_part_number.id_for_label}}" value="{{form.distributor_part_number.value|default_if_none:""}}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{{distri_num_formset.management_form}}
|
||||
<input type="submit" class="btn btn-secondary" name="submit-edit-distri-nums" value="Save">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
@@ -183,6 +119,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{comp_form|crispy}}
|
||||
|
||||
</div>
|
||||
|
||||
{% if component.get_resolved_image %}
|
||||
|
@@ -0,0 +1,7 @@
|
||||
<div class="dropdown">
|
||||
<input autocomplete="off" data-bs-toggle="dropdown" class="form-control{% if widget.errors %} is-invalid{% endif %}" type="text" {% if widget.value != None %}value="{{widget.value}}"{%endif%}
|
||||
{% for name, value in widget.attrs.items %}{% if value is not False and name != 'id' %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %} id="{{widget.attrs.id}}_search_field">
|
||||
<ul id="{{form.manufacturer.id_for_label}}-ac-ul" class="dropdown-menu">
|
||||
</ul>
|
||||
<input type="hidden" value="" name={{widget.name}}>
|
||||
</div>
|
Reference in New Issue
Block a user