fixing product layout
This commit is contained in:
@@ -11,14 +11,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if products %}
|
{% if products %}
|
||||||
<table class="table table-striped">
|
<table class="table table-striped table-bordered align-middle">
|
||||||
<thead>
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Product ID</th>
|
<th style="width: 15%">Product ID</th>
|
||||||
<th>Name</th>
|
<th style="width: 25%">Name</th>
|
||||||
<th>Price</th>
|
<th style="width: 10%">Price</th>
|
||||||
<th>Image</th>
|
<th style="width: 20%">Image</th>
|
||||||
<th>Actions</th>
|
<th style="width: 30%">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -42,12 +42,14 @@
|
|||||||
<td>
|
<td>
|
||||||
{% for field in product_data %}
|
{% for field in product_data %}
|
||||||
{% if field.fieldName == '_image' %}
|
{% if field.fieldName == '_image' %}
|
||||||
<img src="{{ field.value }}" alt="Product image" style="max-height: 100px; max-width: 100px;">
|
<div class="product-image-container">
|
||||||
|
<img src="{{ field.value }}" alt="Product image" class="product-image">
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group">
|
<div class="d-flex justify-content-center gap-2">
|
||||||
<a href="{{ url_for('admin.edit_product', product_id=product_id) }}" class="btn btn-sm btn-outline-primary">Edit</a>
|
<a href="{{ url_for('admin.edit_product', product_id=product_id) }}" class="btn btn-sm btn-outline-primary">Edit</a>
|
||||||
<a href="{{ url_for('admin.generate_barcode_page', product_id=product_id) }}" class="btn btn-sm btn-outline-success">Barcodes</a>
|
<a href="{{ url_for('admin.generate_barcode_page', product_id=product_id) }}" class="btn btn-sm btn-outline-success">Barcodes</a>
|
||||||
<button type="button" class="btn btn-sm btn-outline-danger"
|
<button type="button" class="btn btn-sm btn-outline-danger"
|
||||||
|
|||||||
@@ -23,6 +23,33 @@
|
|||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Product image styles for consistent display */
|
||||||
|
.product-image-container {
|
||||||
|
width: 100px;
|
||||||
|
height: 120px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image {
|
||||||
|
max-width: 100px;
|
||||||
|
max-height: 120px;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Table styles */
|
||||||
|
.table td {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure consistent height for table rows */
|
||||||
|
.table tr {
|
||||||
|
height: 150px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
{% block extra_css %}{% endblock %}
|
{% block extra_css %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in New Issue
Block a user