Skip to content

Commit 0bc9ab7

Browse files
authored
Fix product number issue on UI (#198)
* update payment.yml * update * update * update * update * update * update * update * update * update * update * update * update * update * Optimize image size of samples * Update dependencies of AI project * update bom * Fix product number issue on UI
1 parent b277eb1 commit 0bc9ab7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

apps/acme-shopping/public/catalog.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ <h1>Products</h1>
7171
</div>
7272
<div class="info-bar">
7373
<div class="row">
74-
<div class="col-lg-4 products-showing">Showing <strong>8</strong> of <strong>8</strong> products</div>
74+
<div class="col-lg-4 products-showing" id="productCount">Showing <strong>8</strong> of <strong>8</strong> products</div>
7575
<div class="col-lg-8 products-number-sort">
7676
<form class="form-inline"></form>
7777
<div class="row">
7878
<div class="col-6 col-lg-7">
79-
<div class="products-number"><strong>Show</strong><a href="#" class="btn btn-sm btn-outline-primary mr-1">12</a> <a href="#" class="btn btn-outline-secondary btn-sm mr-1">24</a> <a href="#" class="btn btn-outline-secondary btn-sm mr-1">All</a> products</div>
79+
<!-- <div class="products-number"><strong>Show</strong><a href="#" class="btn btn-sm btn-outline-primary mr-1" onclick="showProducts(12)">12</a> <a href="#" class="btn btn-outline-secondary btn-sm mr-1" onclick="showProducts(24)">24</a> <a href="#" class="btn btn-outline-secondary btn-sm mr-1" onclick="showProducts(-1)">All</a> products</div> -->
8080
</div>
8181
<div class="col-6 col-lg-5">
8282
<div class="products-sort-by d-flex justify-content-end"><strong>Sort by</strong>
@@ -135,11 +135,11 @@ <h1>Products</h1>
135135
if (data != null) {
136136

137137
var content = ''
138-
138+
var count = 0
139139
$.each(data.data, function(index, product){
140140

141141
console.log('product ID: ' + product.id)
142-
142+
count = count + 1
143143
content += '<div class="col-md-3 col-sm-4">\
144144
<div class="product">\
145145
<div class="image"><a href="detail.html?id='+ product.id+ '"' + '><img src="'+ product.imageUrl1+ '" alt=""\
@@ -158,11 +158,11 @@ <h3><a href="detail.html?id=' + product.id + '"' + ' </a>' + product.name+ '</h3
158158
})
159159

160160
$("#rowProducts").append(content);
161+
$("#productCount").html("Showing <strong>"+count+"</strong> of <strong>"+count+"</strong> products")
161162

162163
}
163164
},
164165
error: function(jqXHR, textStatus, errorThrown) {
165-
166166
console.log(errorThrown)
167167
}
168168

0 commit comments

Comments
 (0)