From 488b1bd4a361fbb961cf6f4141ddc46172a93c81 Mon Sep 17 00:00:00 2001 From: Revanth Date: Wed, 17 Aug 2022 23:18:03 +0800 Subject: [PATCH 1/2] Minor Ui changes --- public/styles/btn.css | 16 ++++++++++++++++ public/styles/pastorderDetails.css | 6 +++--- views/pastOrderDetails.handlebars | 28 ++++++++++++++++------------ 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/public/styles/btn.css b/public/styles/btn.css index 0e6a9b6..ac55429 100644 --- a/public/styles/btn.css +++ b/public/styles/btn.css @@ -14,6 +14,22 @@ .blue-btn:focus { box-shadow: 0 0 0 2px white, 0 0 0 3px #2098ce; } +.blue-btn-10 { + width: 8rem; + background: #2098ce; + font-weight: bold; + color: white; + border: 0 none; + border-radius: 25px; + cursor: pointer; + padding: 10px 5px; + margin: 10px 5px; +} + +.blue-btn-10:hover, +.blue-btn-10:focus { + box-shadow: 0 0 0 2px white, 0 0 0 3px #2098ce; +} .blue-btn-25 { background: #2098ce; font-weight: bold; diff --git a/public/styles/pastorderDetails.css b/public/styles/pastorderDetails.css index 11391dc..c2cb26d 100644 --- a/public/styles/pastorderDetails.css +++ b/public/styles/pastorderDetails.css @@ -140,13 +140,13 @@ input.star:checked~.rev-box { } .cart-price { - width: 25%; + width: 20%; font-size: 1.2em; color: #333; } .cart-quantity { - width: 30%; + width: 15%; } .cart-item-title { @@ -219,7 +219,7 @@ input.star:checked~.rev-box { } .c-t { - width: 25%; + width: 45%; } .cart-total { diff --git a/views/pastOrderDetails.handlebars b/views/pastOrderDetails.handlebars index dc72492..c3facf7 100644 --- a/views/pastOrderDetails.handlebars +++ b/views/pastOrderDetails.handlebars @@ -17,7 +17,7 @@ ITEM PRICE QUANTITY - Order Status + ORDER STATUS
{{#each orderitems}} @@ -38,12 +38,13 @@

{{this.orderStatus}}

{{!-- --}} - {{#equals this.review 0}} - + {{/equals}}
@@ -92,13 +93,13 @@
- + - + - + - + @@ -110,8 +111,8 @@ - + @@ -164,9 +165,12 @@ if (orderStatus == "Delivered") { btn = cartRow.getElementsByClassName("confirm-btn")[0] btn.style.display = "block" - } else if(orderStatus == "Delivery Confirmed") { + } else if (orderStatus == "Delivery Confirmed") { btn = cartRow.getElementsByClassName("review-btn")[0] - btn.style.display = "block" + if (typeof (btn) != "undefined") { + console.log(btn) + btn.style.display = "block" + } } } From a9801bea0481f7c7f361df326945551701157476 Mon Sep 17 00:00:00 2001 From: Revanth Date: Wed, 17 Aug 2022 23:54:07 +0800 Subject: [PATCH 2/2] Name changes --- public/js/demo/sellerdashboard.js | 2 +- routes/datapipeline.js | 4 ++-- views/seller/dashboard.handlebars | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/js/demo/sellerdashboard.js b/public/js/demo/sellerdashboard.js index bee48d9..8e333ca 100644 --- a/public/js/demo/sellerdashboard.js +++ b/public/js/demo/sellerdashboard.js @@ -25,7 +25,7 @@ function updateStats() { var n = string.length - 4 var rest = string.length - n; var str = string.slice(0, Math.ceil(rest / 2) + 1) + '*'.repeat(n) + string.slice(-Math.floor(rest / 2) + 1); - $("#bankacc").text("Bank Account : " + str) + $("#bankacc").text("Bank Account No. : " + str) } }) } diff --git a/routes/datapipeline.js b/routes/datapipeline.js index 9904cd5..b69395d 100644 --- a/routes/datapipeline.js +++ b/routes/datapipeline.js @@ -511,7 +511,7 @@ router.get('/totalSalesPerDay', async (req, res) => { }); router.get('/myProduct/:id', async (req, res) => { - const product = await Product.findAll({ where: { OwnerID: req.params.id } }); + const product = await Product.findAll({limit: 10, order: [['sold', 'DESC'], ['sales', 'DESC']], where: { OwnerID: req.params.id } }); let data = []; let cols = ["Name", "Sales", "Sold"]; @@ -527,7 +527,7 @@ router.get('/myProduct/:id', async (req, res) => { }); router.get('/myProductWishlist/:id', async (req, res) => { - const product = await Product.findAll({ where: { OwnerID: req.params.id } }); + const product = await Product.findAll({limit: 10, order: [['wishlistcount', 'DESC'], ['sold', 'DESC']], where: { OwnerID: req.params.id } }); let data = []; let cols = ["Name", "Wishlistcount"]; diff --git a/views/seller/dashboard.handlebars b/views/seller/dashboard.handlebars index 509c3a5..640789e 100644 --- a/views/seller/dashboard.handlebars +++ b/views/seller/dashboard.handlebars @@ -69,7 +69,8 @@