Fiddling around with forms and stuff. No clue where it will end

This commit is contained in:
2021-11-01 22:17:20 +01:00
parent 81a644cd95
commit c0eff5822b
5 changed files with 120 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
{% extends 'base.html' %}
{% load qr_code %}
{% load static %}
{% load crispy_forms_tags %}
{% block content %}
<div class="container">
<nav aria-label="breadcrumb" class="fs-4">
@@ -72,12 +74,33 @@
Manufacturer: {{stock.component.manufacturer}}
{% endif %}
</div>
<div class="ms-3">
Amount: {{stock.amount}}
{% if stock.watermark >= 0 %}
<br>Watermark: {{stock.watermark}}
{% else %}
<span class="text-secondary"><br>No Watermark</span>
{% endif %}
</div>
<div class="ms-3">
<button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#change-stock-modal-{{stock.id}}">Change</button>
</div>
<div>
<form method="post">
{% csrf_token %}
<input type="hidden" name="stock_uuid" value="{{stock.id}}">
<input type="submit" class="btn btn-danger" name="submit-delete-stock" value="X">
</form>
</div>
</li>
{% endfor %}
</div>
{% include 'paginator.html' with paginator=stocks get_param='stock_page' aria_label='Stock Page Navigation' %}
</div>
</div>
{% for stock in stocks %}
{% include 'parts/modals/update-stock-modal.html' with stock=stock form=change_stock_form %}
{% endfor %}
<!-- Modal for adding a substorage-->
{% with add_storage_form as form %}
{% include 'parts/modals/new-substorage-modal.html' %}