shimatta-kenkyusho/shimatta_kenkyusho/templates/parts/stocks-detail.html

72 lines
3.0 KiB
HTML
Raw Normal View History

2021-08-07 17:37:36 +02:00
{% extends 'base.html' %}
{% load qr_code %}
{% block content %}
<div class="container">
<nav aria-label="breadcrumb" class="fs-4">
<ol class="breadcrumb">
<li class="breadcrumb-item"></li>
{% for crumb in breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'parts-stocks-detail' uuid=crumb.id %}">{{crumb.name}}</a></li>
{% endfor %}
<li class="breadcrumb-item active" aria-current="page">{{object.name}}</li>
</ol>
</nav>
2021-08-07 17:37:36 +02:00
<div class="row">
<div class="col-md">
{% qr_from_text object.get_qr_code size="m" image_format="svg" %}
</div>
<div class="col-md">
{% if object.parent_storage %}
2021-08-14 02:35:09 +02:00
<h1>Sub-Storages <a class="btn btn-secondary" href="{% url 'parts-stocks-detail' uuid=object.parent_storage.id %}">Parent Storage</a> {% else %}
<h1>Sub-Storages <a class="btn btn-secondary" href="{% url 'parts-stocks'%}">Stock Overview</a>
{% endif %}
2021-10-25 19:33:13 +02:00
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#delete-storage-modal">Delete</button>
2021-08-14 02:35:09 +02:00
<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">
<li class="list-group-item list-group-item-action justify-content-between align-items-center d-flex">
<div>
<h5>{{storage.name}}</h5>
Responsible: {{ storage.responsible }}
</div>
<span class="badge bg-primary rounded-pill">{{storage.get_total_stock_amount}}</span>
</li>
</a>
{% endfor %}
</div>
2021-08-14 02:20:45 +02:00
{% include 'paginator.html' with paginator=storages get_param='storage_page' aria_label='Storage Page Navigation' %}
</div>
</div>
2021-08-14 02:35:09 +02:00
<!-- Modal for adding a substorage-->
{% with add_storage_form as form %}
{% include 'parts/modals/new-substorage-modal.html' %}
{% endwith %}
<!-- Modal for deleting this storage -->
{% with delete_storage_errors as err_msgs %}
{% include 'parts/modals/delete-storage-modal.html' %}
{% endwith %}
2021-08-07 17:37:36 +02:00
</div>
{% endblock content %}
{% block custom_scripts %}
{% if add_storage_form.errors %}
<script type="text/javascript">
var addSubStorageModal = document.querySelector('#add-sub-modal');
var c_modal = bootstrap.Modal.getOrCreateInstance(addSubStorageModal);
c_modal.show();
</script>
{% endif %}
{% if delete_storage_errors %}
<script type="text/javascript">
var deleteStorageModal = document.querySelector('#delete-storage-modal');
var d_modal = bootstrap.Modal.getOrCreateInstance(deleteStorageModal);
d_modal.show();
</script
{% endif %}
{% endblock custom_scripts %}