diff --git a/app.js b/app.js index 79b85c2..ee85c17 100644 --- a/app.js +++ b/app.js @@ -56,8 +56,10 @@ 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) + .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/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 da4e0a2..ff0d3d3 100644 --- a/public/main.css +++ b/public/main.css @@ -74,7 +74,10 @@ article { } .miniItemImg{ width:100%; - +} +.miniItemDesc{ + white-space: nowrap; + overflow: hidden; } .searchResultList { list-style: none; diff --git a/views/partials/itemImgInfo.ejs b/views/partials/itemImgInfo.ejs index cdfa50a..e9d45d8 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].model %>
<% }else{ %> - + +
<%-matches[0].similarItems[i].model %>
<%}%>
<% } %>