Begin modal for adding substorages

This commit is contained in:
Mario Hüttel 2021-08-14 02:35:09 +02:00
parent a9bcda045a
commit e4a83f3e58
2 changed files with 28 additions and 4 deletions

View File

@ -149,3 +149,6 @@ class StockViewDetail(LoginRequiredMixin, BaseTemplateMixin, DetailView):
context['storages'] = storage_paginator.get_page(storage_page) context['storages'] = storage_paginator.get_page(storage_page)
return context return context
def post(self):
pass

View File

@ -18,10 +18,11 @@
</div> </div>
<div class="col-md"> <div class="col-md">
{% if object.parent_storage %} {% if object.parent_storage %}
<h1>Sub-Storages <a class="btn btn-secondary" href="{% url 'parts-stocks-detail' uuid=object.parent_storage.id %}">Parent Storage</a></h1> <h1>Sub-Storages <a class="btn btn-secondary" href="{% url 'parts-stocks-detail' uuid=object.parent_storage.id %}">Parent Storage</a> {% else %}
{% else %} <h1>Sub-Storages <a class="btn btn-secondary" href="{% url 'parts-stocks'%}">Stock Overview</a>
<h1>Sub-Storages <a class="btn btn-secondary" href="{% url 'parts-stocks'%}">Stock Overview</a></h1>
{% endif %} {% endif %}
<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"> <div class="list-group">
{% for storage in storages %} {% for storage in storages %}
<a href="{% url 'parts-stocks-detail' uuid=storage.id %}" class="text-decoration-none"> <a href="{% url 'parts-stocks-detail' uuid=storage.id %}" class="text-decoration-none">
@ -38,6 +39,26 @@
{% include 'paginator.html' with paginator=storages get_param='storage_page' aria_label='Storage Page Navigation' %} {% include 'paginator.html' with paginator=storages get_param='storage_page' aria_label='Storage Page Navigation' %}
</div> </div>
</div> </div>
<!-- Modal for adding a substorage-->
<div class="modal fade" id="add-sub-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">Add Storage</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form action="" method="post">
{% csrf_token %}
<div class="modal-body">
<label for="add-storage-name" class="form-label">Storage Name</label>
<input class="form-control" id="add-storage-name" name="storage-name" type="text">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<input type="submit" class="btn btn-primary" value="Add Storage" name="submit-add-storage">
</div>
</form>
</div>
</div>
</div> </div>
{% endblock content %} {% endblock content %}