Add deletion fuinctionality to storages
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
{% include 'paginator.html' with paginator=low_stocks get_param='low_stock_page' aria_label='Low Stock Page Navigation' %}
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<h1>Storages</h1>
|
||||
<h1>Storages <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#add-sub-modal"><i class="bi bi-plus-circle"></i></button></h1>
|
||||
<div class="list-group">
|
||||
{% for storage in storages %}
|
||||
<a href="{% url 'parts-stocks-detail' uuid=storage.id %}" class="text-decoration-none">
|
||||
@@ -51,5 +51,22 @@
|
||||
{% include 'paginator.html' with paginator=storages get_param='storage_page' aria_label='Storage Page Navigation'%}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add storage modal form -->
|
||||
{% with add_storage_form as form %}
|
||||
{% include 'parts/modals/new-substorage-modal.html' %}
|
||||
{% endwith %}
|
||||
|
||||
</div>
|
||||
{% endblock content %}
|
||||
{% endblock content %}
|
||||
|
||||
{% block custom_scripts %}
|
||||
{% if add_storage_form.errors %}
|
||||
<script type="text/javascript">
|
||||
var addSubStorageModal = document.querySelector('#add-sub-modal');
|
||||
var modal = bootstrap.Modal.getOrCreateInstance(addSubStorageModal);
|
||||
modal.show();
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock custom_scripts %}
|
||||
|
||||
|
Reference in New Issue
Block a user