Add stock list to storage dtail view and start search
This commit is contained in:
@@ -14,31 +14,68 @@
|
||||
</nav>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
{% qr_from_text object.get_qr_code size="m" image_format="svg" %}
|
||||
<div class="col-md-3">
|
||||
<div class="row-md">
|
||||
{% qr_from_text object.get_qr_code size="m" image_format="svg" %}
|
||||
</div>
|
||||
<div class="row-md">
|
||||
{% 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> {% else %}
|
||||
<h1>Sub-Storages <a class="btn btn-secondary" href="{% url 'parts-stocks'%}">Stock Overview</a>
|
||||
{% endif %}
|
||||
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#delete-storage-modal">Delete</button>
|
||||
<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>
|
||||
{% include 'paginator.html' with paginator=storages get_param='storage_page' aria_label='Storage Page Navigation' %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
{% 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> {% else %}
|
||||
<h1>Sub-Storages <a class="btn btn-secondary" href="{% url 'parts-stocks'%}">Stock Overview</a>
|
||||
{% endif %}
|
||||
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#delete-storage-modal">Delete</button>
|
||||
<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>
|
||||
<h1>Stocked Components</h1>
|
||||
<form method="get">
|
||||
<div class="input-group">
|
||||
<input class="form-control" name="search" type="search" placeholder="Search..." {% if stock_search %}value="{{stock_search}}"{% endif %}>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<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 }}
|
||||
{% for stock in stocks %}
|
||||
<li class="list-group-item list-group-item-action d-flex align-items-center">
|
||||
<div class="flex-shrink-0">
|
||||
{% if stock.component.get_resolved_image %}
|
||||
<img src="{{stock.component.get_resolved_image}}" style="max-width:64px;max-height:64px;" alt="{{ low.component.name }}" class="mr-3">
|
||||
{% else %}
|
||||
{% load static %}
|
||||
<img src="{% static 'css/icons/card-image.svg' %}" style="width:64px;max-height:64px;" alt="{{ low.component.name }}" class="mr-3">
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="flex-grow-1 ms-3">
|
||||
<h6 class="mt-0 text-primary">{{ stock.component.name }}</h6>
|
||||
{% if stock.component.package %}
|
||||
Package: {{stock.component.package}}<br>
|
||||
{% endif %}
|
||||
{% if stock.component.manufacturer %}
|
||||
Manufacturer: {{stock.component.manufacturer}}
|
||||
{% endif %}
|
||||
</div>
|
||||
<span class="badge bg-primary rounded-pill">{{storage.get_total_stock_amount}}</span>
|
||||
</li>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% include 'paginator.html' with paginator=storages get_param='storage_page' aria_label='Storage Page Navigation' %}
|
||||
{% include 'paginator.html' with paginator=stocks get_param='stock_page' aria_label='Stock Page Navigation' %}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal for adding a substorage-->
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<h1>Low Stocks</h1>
|
||||
<div class="list-group">
|
||||
{% for low in low_stocks %}
|
||||
<a href="{% url 'parts-stocks-detail' uuid=low.storage.id %}" class="text-decoration-none">
|
||||
<a href="{% url 'parts-stocks-detail' uuid=low.storage.id %}?search={{low.component.id|urlencode}}" class="text-decoration-none">
|
||||
<li class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
|
||||
<div class="flex-shrink-0">
|
||||
{% if low.component.get_resolved_image %}
|
||||
@@ -19,7 +19,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="flex-grow-1 ms-3">
|
||||
<h5 class="mt-0">{{ low.component.name }} in {{ low.component.package }}</h5>
|
||||
<h5 class="mt-0">{{ low.component.name }}{% if low.component.package %} in {{ low.component.package }}{% endif %}</h5>
|
||||
{{ low.storage }}
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user