#9 Delete Product box now available
This commit is contained in:
@ -3,7 +3,8 @@
|
||||
|
||||
{% if product != None %}
|
||||
{% if user.id == product.sellerID %}
|
||||
<form class="product-fs" method="POST" action="/products/update/{{product.id}}" enctype="multipart/form-data">
|
||||
<!-- Form -->
|
||||
<form class="product-fs" method="POST" action="{{url_for('main.products.update_product', id=product.id)}}" enctype="multipart/form-data">
|
||||
<img class="product-image" src="{{url_for('static', filename='assets/img/products/' + product.image)}}" alt="Brake Disks"/>
|
||||
<div class="product-details">
|
||||
<div class="input-form-row">
|
||||
@ -32,6 +33,7 @@
|
||||
<div class="input-form-row">
|
||||
<input type="submit" id="Create Product" value="Update Product">
|
||||
</div>
|
||||
<label class="modal-btn" for="deleteModal">Delete Product</label>
|
||||
</div>
|
||||
<div class="product-acquisition-pane">
|
||||
<div class="input-form-row">
|
||||
@ -46,13 +48,31 @@
|
||||
{% if product.quantityAvailable > 0 %}
|
||||
<div class="product-instock">In Stock</div>
|
||||
<div class="product-quantity">{{product.quantityAvailable}} Available</div>
|
||||
<a href="{{url_for('main.stats.view_product_stats', id=product.id)}}"><input type="button" class="product-add-to-cart" value="View Product Stats"/></a>
|
||||
<a href="{{url_for('main.stats.view_product_stats', id=product.id)}}">
|
||||
<input type="button" class="product-add-to-cart" value="View Product Stats"/>
|
||||
</a>
|
||||
{% else %}
|
||||
<div class="product-nostock">Out of Stock</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Modal -->
|
||||
<input class="modal-state" id="deleteModal" type="checkbox" />
|
||||
<div class="modal">
|
||||
<label class="modal__bg" for="deleteModal"></label>
|
||||
<div class="modal__inner">
|
||||
<label class="modal__close" for="deleteModal"></label>
|
||||
<h2>Confirm Delete</h2>
|
||||
<p>Are you sure you want to <b>delete {{product.name}}</b> from your products</p>
|
||||
<form method="POST" action="{{url_for('main.products.delete_product', id=product.id)}}">
|
||||
<div class="input-form-row">
|
||||
<input type="submit" class="modal-btn error" for="deleteModal" value="Delete" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product-fs">
|
||||
<img class="product-image" src="{{url_for('static', filename='assets/img/products/' + product.image)}}" alt="Brake Disks"/>
|
||||
|
Reference in New Issue
Block a user