From e9eb07f2d7b2477747e549e866f2d579236bb910 Mon Sep 17 00:00:00 2001 From: Spazcool Date: Fri, 17 Nov 2017 10:30:26 +0800 Subject: [PATCH 1/3] FIX: conditional for similarItems div --- app.js | 2 +- views/partials/itemImgInfo.ejs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 79b85c2..9dc179d 100644 --- a/app.js +++ b/app.js @@ -56,7 +56,7 @@ app.get('/:uuid', (req, res) => { } recentScans.assigned.push([matches[0].fixture, req.params.uuid]); // console.log(recentScans); - matches.similarItems = searchDatabase({ fixture: matches[0].fixture }, allItems) + matches[0].similarItems = searchDatabase({ fixture: matches[0].fixture }, allItems) .filter(item => item.uuid !== matches[0].uuid) .splice(0, 3); res.render('item', { matches }); diff --git a/views/partials/itemImgInfo.ejs b/views/partials/itemImgInfo.ejs index cdfa50a..c65119a 100644 --- a/views/partials/itemImgInfo.ejs +++ b/views/partials/itemImgInfo.ejs @@ -14,16 +14,18 @@ <% } %> -<% if ( matches.similarItems ) { %> +<% if ( matches[0].similarItems.length ) { %>

Similar Items

- <% for(var i = 0; i < matches.similarItems.length; i++){ %> + <% for(var i = 0; i < matches[0].similarItems.length; i++){ %>
- <% if (matches.similarItems[i].picture === undefined || matches.similarItems[i].picture === '') { %> - + <% if (matches[0].similarItems[i].picture === undefined || matches[0].similarItems[i].picture === '') { %> + + <%-matches[0].similarItems[i].uuid %> <% }else{ %> - + + <%-matches[0].similarItems[i].uuid %> <%}%>
<% } %> From 64ff666e76963784ebc59511836414e7b72ed0a0 Mon Sep 17 00:00:00 2001 From: Spazcool Date: Fri, 17 Nov 2017 14:28:33 +0800 Subject: [PATCH 2/3] FIX: similarItems title, model detail, WIP --- app.js | 2 ++ public/main.css | 10 +++++++++- views/partials/itemImgInfo.ejs | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 9dc179d..ee85c17 100644 --- a/app.js +++ b/app.js @@ -58,6 +58,8 @@ app.get('/:uuid', (req, res) => { // console.log(recentScans); matches[0].similarItems = searchDatabase({ fixture: matches[0].fixture }, allItems) .filter(item => item.uuid !== matches[0].uuid) + .filter(item => item.floor === matches[0].floor) + // .sort((a, b) => (a.floor === b.floor ? 0 : +(a.floor > b.floor) || -1)) .splice(0, 3); res.render('item', { matches }); }); diff --git a/public/main.css b/public/main.css index da4e0a2..7cc9171 100644 --- a/public/main.css +++ b/public/main.css @@ -71,10 +71,18 @@ article { .miniSearchItem{ padding-top: 1em; padding-bottom: 1em; + white-space: nowrap; + overflow: hidden; + /*text-overflow: ellipsis;*/ } .miniItemImg{ width:100%; - +} +.miniItemDesc{ + /*max-width: 50%;*/ + /*text-overflow: ellipsis;*/ + /*overflow: hidden; + white-space: nowrap;*/ } .searchResultList { list-style: none; diff --git a/views/partials/itemImgInfo.ejs b/views/partials/itemImgInfo.ejs index c65119a..e9d45d8 100644 --- a/views/partials/itemImgInfo.ejs +++ b/views/partials/itemImgInfo.ejs @@ -22,10 +22,10 @@
<% if (matches[0].similarItems[i].picture === undefined || matches[0].similarItems[i].picture === '') { %> - <%-matches[0].similarItems[i].uuid %> +
<%-matches[0].similarItems[i].model %>
<% }else{ %> - <%-matches[0].similarItems[i].uuid %> +
<%-matches[0].similarItems[i].model %>
<%}%>
<% } %> From 99932cccf1565d7c3c8a33785fba276d38445fc7 Mon Sep 17 00:00:00 2001 From: Slipp Douglas Thompson Date: Sun, 19 Nov 2017 14:10:48 +0800 Subject: [PATCH 3/3] FIX: similarItems styling --- package.json | 4 ++-- i_love_qr.svg => public/i_love_qr.svg | 0 public/main.css | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) rename i_love_qr.svg => public/i_love_qr.svg (100%) diff --git a/package.json b/package.json index 9c75dad..11f8122 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "lint": "eslint *.js", "check": "npm ls > /dev/null" }, - "pre-commit": [ + /*"pre-commit": [ "lint", "check" - ], + ],*/ "author": "Alex Miller", "license": "ISC", "dependencies": { diff --git a/i_love_qr.svg b/public/i_love_qr.svg similarity index 100% rename from i_love_qr.svg rename to public/i_love_qr.svg diff --git a/public/main.css b/public/main.css index 7cc9171..ff0d3d3 100644 --- a/public/main.css +++ b/public/main.css @@ -71,18 +71,13 @@ article { .miniSearchItem{ padding-top: 1em; padding-bottom: 1em; - white-space: nowrap; - overflow: hidden; - /*text-overflow: ellipsis;*/ } .miniItemImg{ width:100%; } .miniItemDesc{ - /*max-width: 50%;*/ - /*text-overflow: ellipsis;*/ - /*overflow: hidden; - white-space: nowrap;*/ + white-space: nowrap; + overflow: hidden; } .searchResultList { list-style: none;