From 9033114545a5304bf60ee6db6db07e3e1002f254 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Wed, 30 Oct 2019 10:54:05 +0100 Subject: [PATCH] add input box for sliders --- app/common/enums.js | 18 ++-- app/controllers/realEstateFilters.js | 16 +-- app/public/main.css | 7 ++ app/views/realEstateFilters.ejs | 154 +++++++++++++++++++++------ 4 files changed, 144 insertions(+), 51 deletions(-) diff --git a/app/common/enums.js b/app/common/enums.js index 93545a6..9742f21 100644 --- a/app/common/enums.js +++ b/app/common/enums.js @@ -5,8 +5,7 @@ const PRICE_SLIDER_OPTIONS = { max: [300000] }, step: 1000, - connect: true, - tooltips: true + connect: true }; //This will be used for Flats, Apartments, Houses @@ -17,8 +16,7 @@ const HOME_SIZE_SLIDER_OPTIONS = { max: [400] }, step: 5, - connect: true, - tooltips: true + connect: true }; const GARDEN_SIZE_SLIDER_OPTIONS = { @@ -28,8 +26,7 @@ const GARDEN_SIZE_SLIDER_OPTIONS = { max: [10000] }, step: 100, - connect: true, - tooltips: true + connect: true }; const LAND_SIZE_SLIDER_OPTIONS = { @@ -39,8 +36,7 @@ const LAND_SIZE_SLIDER_OPTIONS = { max: [100000] }, step: 100, - connect: true, - tooltips: true + connect: true }; const GARAGE_SIZE_SLIDER_OPTIONS = { start: [10, 20], @@ -49,8 +45,7 @@ const GARAGE_SIZE_SLIDER_OPTIONS = { max: [150] }, step: 2, - connect: true, - tooltips: true + connect: true }; const GARAGE_PRICE_SLIDER_OPTIONS = { @@ -60,8 +55,7 @@ const GARAGE_PRICE_SLIDER_OPTIONS = { max: [100000] }, step: 500, - connect: true, - tooltips: true + connect: true }; const AD_TYPE = { diff --git a/app/controllers/realEstateFilters.js b/app/controllers/realEstateFilters.js index c29b2c4..9e23f91 100644 --- a/app/controllers/realEstateFilters.js +++ b/app/controllers/realEstateFilters.js @@ -61,10 +61,10 @@ const postFilters = async (req, res) => { const nextStepPage = req.query.nextStep || "pregled"; const nextStepUrl = `/${nextStepPage}/${searchRequest.id}`; - const priceMin = parseInt(req.body.priceFilterMin) || 0; - const priceMax = parseInt(req.body.priceFilterMax) || 0; - const sizeMin = parseInt(req.body.sizeFilterMin) || 0; - const sizeMax = parseInt(req.body.sizeFilterMax) || 0; + const priceMin = parseInt(req.body.priceMin) || 0; + const priceMax = parseInt(req.body.priceMax) || 0; + const sizeMin = parseInt(req.body.sizeMin) || 0; + const sizeMax = parseInt(req.body.sizeMax) || 0; //TODO: Filter validation @@ -74,11 +74,11 @@ const postFilters = async (req, res) => { searchRequest.sizeMax = sizeMax; if ( - req.body.gardenSizeFilterMin !== undefined && - req.body.gardenSizeFilterMax !== undefined + req.body.gardenSizeMin !== undefined && + req.body.gardenSizeMax !== undefined ) { - const gardenSizeMin = parseInt(req.body.gardenSizeFilterMin); - const gardenSizeMax = parseInt(req.body.gardenSizeFilterMax); + const gardenSizeMin = parseInt(req.body.gardenSizeMin); + const gardenSizeMax = parseInt(req.body.gardenSizeMax); //TODO: Filter validation diff --git a/app/public/main.css b/app/public/main.css index 55e0f8b..7b688a6 100644 --- a/app/public/main.css +++ b/app/public/main.css @@ -95,3 +95,10 @@ h3 { font-size: 15px; line-height: 1.5; } + +.sliderInputBox { + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4) !important; + border: 1px solid #02adba !important; + border-radius: 4px !important; + text-align: center; +} diff --git a/app/views/realEstateFilters.ejs b/app/views/realEstateFilters.ejs index ad12b7e..5d27162 100644 --- a/app/views/realEstateFilters.ejs +++ b/app/views/realEstateFilters.ejs @@ -5,32 +5,57 @@
Cijena


- - -

+
+
+
+ + +
+
+ +
+
+ +
Površina


- -
-

+
+
+
+ + +
+
+ +
+
+ +
<% if(hasGardenSize) { %>
Površina okućnice


- -
-

+
+
+
+ + +
+
+ +
+
<% } %>
@@ -42,42 +67,109 @@