Implement edit componant form and adapt UI
This commit is contained in:
@@ -36,17 +36,37 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">{{component.name}}</th>
|
||||
<th>{% if component.package %}<a href="{% url 'parts-packages-detail' uuid=component.package.id %}" class="link-primary text-decoration-none">{{component.package.name}}</a>{% endif %}</th>
|
||||
<th>{% if component.manufacturer %}{{component.manufacturer.name}}{% endif %}</th>
|
||||
<th>{% if component.component_type %}{{component.component_type.class_name}}{% endif %}
|
||||
<th>{{component.get_total_amount}}</th>
|
||||
<td class="align-middle" scope="row">
|
||||
{{component.name}}
|
||||
</td>
|
||||
<td class="align-middle" >
|
||||
{% if component.package %}
|
||||
<a href="{% url 'parts-packages-detail' uuid=component.package.id %}" class="link-primary text-decoration-none">{{component.package.name}}</a>
|
||||
{% if component.package.image %}
|
||||
<img src="{{component.package.image.url}}" class="component-img-small">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="align-middle" >
|
||||
{% if component.manufacturer %}
|
||||
{{component.manufacturer.name}}
|
||||
{% if component.manufacturer.image %}
|
||||
<img src="{{component.manufacturer.image.url}}" class="component-img-small">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{% if component.component_type %}{{component.component_type.class_name}}{% endif %}
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{{component.get_total_amount}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2>Description</h2>
|
||||
{% if component.description %}
|
||||
{{component.description}}
|
||||
{{component.description|linebreaks}}
|
||||
{% else %}
|
||||
<div class="alert alert-secondary" role="alert">
|
||||
No description available
|
||||
@@ -80,7 +100,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include 'parts/modals/edit-component-modal.html' with heading="Edit "|add:component.name edit_form=edit_form %}
|
||||
{% include 'parts/modals/edit-component-modal.html' with heading="Edit "|add:component.name form=edit_form %}
|
||||
{% endblock content %}
|
||||
|
||||
{% block custom_scripts %}
|
||||
|
Reference in New Issue
Block a user