From a6bd63b7b849b08595dfacd2a1eeaabb362221ff Mon Sep 17 00:00:00 2001 From: Nedim Uka Date: Thu, 11 Jul 2019 14:25:38 +0200 Subject: [PATCH 1/3] Handle nav-bar --- app/controllers/gardenSizes.js | 4 +++- app/controllers/goAgain.js | 3 ++- app/controllers/municipalities.js | 4 +++- app/controllers/neighborhoodMap.js | 6 +++++- app/controllers/prices.js | 4 +++- app/controllers/queryReview.js | 3 +++ app/controllers/querySubmit.js | 5 ++++- app/controllers/realEstateTypes.js | 3 ++- app/controllers/regions.js | 3 ++- app/controllers/sizes.js | 3 ++- app/controllers/unsubscribe.js | 4 +++- app/controllers/welcome.js | 3 ++- app/public/main.css | 15 +++++++++++++++ app/views/gardenSize.ejs | 4 +--- app/views/goAgain.ejs | 10 ++-------- app/views/municipality.ejs | 4 +--- app/views/neighborhoodMap.ejs | 4 +--- app/views/partials/navBar.ejs | 7 +++++++ app/views/partials/range.ejs | 6 +++--- app/views/price.ejs | 4 +--- app/views/queryReview.ejs | 4 +--- app/views/querySubmit.ejs | 5 ++++- app/views/realEstateType.ejs | 4 +--- app/views/region.ejs | 4 +--- app/views/size.ejs | 4 +--- app/views/unsubscribe.ejs | 4 +--- index.js | 29 ++++++++++------------------- 27 files changed, 84 insertions(+), 69 deletions(-) create mode 100644 app/views/partials/navBar.ejs diff --git a/app/controllers/gardenSizes.js b/app/controllers/gardenSizes.js index 5ba8ab5..11f89ac 100644 --- a/app/controllers/gardenSizes.js +++ b/app/controllers/gardenSizes.js @@ -3,6 +3,8 @@ const { getRealEstateTypeEnum } = require('../helpers/enums'); const getGardenSize = (req,res) => { + const title = "Koliko okućnice tražite ?" + const unit = " m2" const rangeFrom = { min : 10, @@ -18,7 +20,7 @@ const getGardenSize = (req,res) => { step : 10 } - res.render('gardenSize', { rangeFrom, rangeTo, unit }); + res.render('gardenSize', { rangeFrom, rangeTo, unit, title }); }; const postGardenSize = async (req, res) => { diff --git a/app/controllers/goAgain.js b/app/controllers/goAgain.js index 5261171..c6b6d81 100644 --- a/app/controllers/goAgain.js +++ b/app/controllers/goAgain.js @@ -1,5 +1,6 @@ const getGoAgain = async (req,res) => { - res.render('goAgain'); + const title = "Želite li pretražiti još jednu nekretninu ?"; + res.render('goAgain', {title}); }; module.exports = { diff --git a/app/controllers/municipalities.js b/app/controllers/municipalities.js index 9dbf8c6..349fd9c 100644 --- a/app/controllers/municipalities.js +++ b/app/controllers/municipalities.js @@ -2,10 +2,12 @@ const { currentRERequest } = require('../helpers/url'); const { getMunicipalitiesForRegion, getMunicipalityName } = require('../helpers/codes'); const getMunicipality = async (req, res) => { + + const title = "U kojem mjestu tražite nekretninu?" let request = await currentRERequest(req); const municipalities = getMunicipalitiesForRegion(request.region); - res.render('municipality', { municipalities }); + res.render('municipality', { municipalities, title }); }; const postMunicipality = async (req, res) => { diff --git a/app/controllers/neighborhoodMap.js b/app/controllers/neighborhoodMap.js index e88193d..1edd926 100644 --- a/app/controllers/neighborhoodMap.js +++ b/app/controllers/neighborhoodMap.js @@ -1,11 +1,15 @@ const { currentRERequest } = require('../helpers/url'); const getNeighborhood = async (req, res) => { + + const title = "U kojem naselju tražite nekretninu?" const municipality = req.params.municipality const nextStep = req.query.nextStep || '/'; + res.render('neighborhoodMap', { nextStep, - municipality + municipality, + title }); }; diff --git a/app/controllers/prices.js b/app/controllers/prices.js index 1c027ca..d4c99fe 100644 --- a/app/controllers/prices.js +++ b/app/controllers/prices.js @@ -2,6 +2,8 @@ const { currentRERequest } = require('../helpers/url'); const getPrice = (req,res) => { + const title = "Koja Vam okvirna cijena odgovara ?" + const unit = " KM" const rangeFrom = { min : 1000, @@ -18,7 +20,7 @@ const getPrice = (req,res) => { } - res.render('price', {rangeFrom, rangeTo, unit }); + res.render('price', {rangeFrom, rangeTo, unit, title }); }; const postPrice = async (req, res) => { diff --git a/app/controllers/queryReview.js b/app/controllers/queryReview.js index 3ec1240..023435c 100644 --- a/app/controllers/queryReview.js +++ b/app/controllers/queryReview.js @@ -3,6 +3,8 @@ const { getRegionName, getMunicipalityName } = require('../helpers/codes'); const { realEstateTypes, sizes, gardenSizes, prices, getEnumTypeTitle, getRealEstateTypeEnum } = require('../helpers/enums'); const getQueryReview = async (req,res) => { + + const title = "Da li je ovo to što ste tražili ?" const request = await currentRERequest(req); const nextStep = req.query.nextStep; @@ -69,6 +71,7 @@ const getQueryReview = async (req,res) => { res.render('queryReview', { nextStep, queryData, + title }); }; diff --git a/app/controllers/querySubmit.js b/app/controllers/querySubmit.js index f73fa1f..5d111d8 100644 --- a/app/controllers/querySubmit.js +++ b/app/controllers/querySubmit.js @@ -3,12 +3,15 @@ const { isValidEmail } = require('../helpers/email'); const { sendTemplatedEmail} = require('../helpers/awsEmail'); const getQuerySubmit = async (req, res) => { + + const title = "Upišite vaš e-mail" const nextStep = req.query.nextStep; const error = req.query.error; res.render('querySubmit', { nextStep, - error + error, + title }); }; diff --git a/app/controllers/realEstateTypes.js b/app/controllers/realEstateTypes.js index 6b22c38..50b1aad 100644 --- a/app/controllers/realEstateTypes.js +++ b/app/controllers/realEstateTypes.js @@ -5,7 +5,8 @@ const { realEstateTypes, getRealEstateTypeEnum } = require('../helpers/enums'); const getRealEstateTypes = (req,res) => { - res.render('realEstateType', { realEstateTypes }); + const title = "Koju nekretninu tražite?" + res.render('realEstateType', { realEstateTypes, title }); }; const postRealEstateTypes = async (req, res) => { diff --git a/app/controllers/regions.js b/app/controllers/regions.js index 549af1e..b3f0b71 100644 --- a/app/controllers/regions.js +++ b/app/controllers/regions.js @@ -4,7 +4,8 @@ const { getRegions } = require('../helpers/codes'); const regions = getRegions(); const getRegion = (req,res) => { - res.render('region', { regions }); + const title = "U kojoj regiji tražite nekretninu?" + res.render('region', { regions, title }); }; const postRegion = async (req, res) => { diff --git a/app/controllers/sizes.js b/app/controllers/sizes.js index 597064d..58ec4a7 100644 --- a/app/controllers/sizes.js +++ b/app/controllers/sizes.js @@ -3,6 +3,7 @@ const { sizes, getRealEstateTypeEnum } = require('../helpers/enums'); const getSize = (req,res) => { + const title = "Od koliko kvadrata tražite nekretninu ?" const unit = " m2" const rangeFrom = { min : 10, @@ -18,7 +19,7 @@ const getSize = (req,res) => { step : 10 } - res.render('size', { rangeFrom, rangeTo, unit }); + res.render('size', { rangeFrom, rangeTo, unit, title }); }; const postSize = async (req, res) => { diff --git a/app/controllers/unsubscribe.js b/app/controllers/unsubscribe.js index 423f379..5e32ddb 100644 --- a/app/controllers/unsubscribe.js +++ b/app/controllers/unsubscribe.js @@ -2,11 +2,13 @@ const { currentRERequest } = require('../helpers/url'); const getUnsubscribe = async (req, res) => { + + const title = "Uspješno ste se odjavili" const request = await currentRERequest(req); request.subscribed = false; await request.save(); - res.render('unsubscribe', { nextStep: '/vrstanekretnine' }); + res.render('unsubscribe', { nextStep: '/vrstanekretnine', title }); }; diff --git a/app/controllers/welcome.js b/app/controllers/welcome.js index 8ded508..258b551 100644 --- a/app/controllers/welcome.js +++ b/app/controllers/welcome.js @@ -1,5 +1,6 @@ const getWelcome = (req,res) => { - res.render('welcome', { nextStep: '/vrstanekretnine' } ); + const title = "Koju nekretninu tražite?" + res.render('welcome', { nextStep: '/vrstanekretnine', title } ); }; module.exports = { diff --git a/app/public/main.css b/app/public/main.css index 61c39f3..452997e 100644 --- a/app/public/main.css +++ b/app/public/main.css @@ -2,6 +2,12 @@ width: 100%; } +.next-center-button { + width: 50%; + left: 25%; +} + + .welcome-big-logo { font-size: 200pt; background-image: url(./images/logo.png); @@ -13,6 +19,15 @@ width: 95% } +.centered-element { + margin-top: 200px; +} + + +.centered-element-small { + margin-top: 100px; +} + #map { height: 50%; diff --git a/app/views/gardenSize.ejs b/app/views/gardenSize.ejs index 9926b2d..c0c1b91 100644 --- a/app/views/gardenSize.ejs +++ b/app/views/gardenSize.ejs @@ -1,6 +1,4 @@ -
-

Koliko okućnice tražite ?

-
+<% include partials/navBar %> <% include partials/range %> diff --git a/app/views/goAgain.ejs b/app/views/goAgain.ejs index 422b0f0..1040e96 100644 --- a/app/views/goAgain.ejs +++ b/app/views/goAgain.ejs @@ -1,14 +1,8 @@ -
-

Provjerite Vaš email !

-
- -
-

Želite li pretražiti još jednu nekretninu ?

-
+<% include partials/navBar %>
-
+
Da diff --git a/app/views/municipality.ejs b/app/views/municipality.ejs index e151451..aae8813 100644 --- a/app/views/municipality.ejs +++ b/app/views/municipality.ejs @@ -1,7 +1,5 @@ -
-

U kojem mjestu tražite nekretninu?

-
+<% include partials/navBar %>
diff --git a/app/views/neighborhoodMap.ejs b/app/views/neighborhoodMap.ejs index 185c920..e8cf5fd 100644 --- a/app/views/neighborhoodMap.ejs +++ b/app/views/neighborhoodMap.ejs @@ -1,6 +1,4 @@ -
-

U kojem naselju tražite nekretninu?

-
+<% include partials/navBar %>
diff --git a/app/views/partials/navBar.ejs b/app/views/partials/navBar.ejs new file mode 100644 index 0000000..0ec9f3f --- /dev/null +++ b/app/views/partials/navBar.ejs @@ -0,0 +1,7 @@ +
+ +
\ No newline at end of file diff --git a/app/views/partials/range.ejs b/app/views/partials/range.ejs index 70f2324..4dc1e4c 100644 --- a/app/views/partials/range.ejs +++ b/app/views/partials/range.ejs @@ -1,9 +1,9 @@ -
+
-
- + diff --git a/app/views/price.ejs b/app/views/price.ejs index 47c590a..c0c1b91 100644 --- a/app/views/price.ejs +++ b/app/views/price.ejs @@ -1,6 +1,4 @@ -
-

Koja Vam okvirna cijena odgovara ?

-
+<% include partials/navBar %> <% include partials/range %> diff --git a/app/views/queryReview.ejs b/app/views/queryReview.ejs index b81c9ff..e8105b4 100644 --- a/app/views/queryReview.ejs +++ b/app/views/queryReview.ejs @@ -1,7 +1,5 @@ -
-

Da li je ovo to što ste tražili ?

-
+<% include partials/navBar %>
diff --git a/app/views/querySubmit.ejs b/app/views/querySubmit.ejs index ded8ac6..e608805 100644 --- a/app/views/querySubmit.ejs +++ b/app/views/querySubmit.ejs @@ -1,6 +1,9 @@ +<% include partials/navBar %> + +
-

Da Vam javimo kada se Vaša željena nekretnina pojavi u oglasima, upišite svoj e-mail

+
Da Vam javimo kada se Vaša željena nekretnina pojavi u oglasima, upišite vaš e-mail
diff --git a/app/views/realEstateType.ejs b/app/views/realEstateType.ejs index d8a0c24..eac9357 100644 --- a/app/views/realEstateType.ejs +++ b/app/views/realEstateType.ejs @@ -1,7 +1,5 @@ -
-

Koju nekretninu tražite?

-
+<% include partials/navBar %>
diff --git a/app/views/region.ejs b/app/views/region.ejs index e0b4466..a5c4a40 100644 --- a/app/views/region.ejs +++ b/app/views/region.ejs @@ -1,7 +1,5 @@ -
-

U kojoj regiji tražite nekretninu?

-
+<% include partials/navBar %>
diff --git a/app/views/size.ejs b/app/views/size.ejs index 058b0c0..c0c1b91 100644 --- a/app/views/size.ejs +++ b/app/views/size.ejs @@ -1,6 +1,4 @@ -
-

Od koliko kvadrata tražite nekretninu ?

-
+<% include partials/navBar %> <% include partials/range %> diff --git a/app/views/unsubscribe.ejs b/app/views/unsubscribe.ejs index f976698..c97f5b7 100644 --- a/app/views/unsubscribe.ejs +++ b/app/views/unsubscribe.ejs @@ -1,10 +1,8 @@ +<% include partials/navBar %>
-
-
Uspješno ste se odjavili
-
diff --git a/index.js b/index.js index 4f65b4d..f46f55e 100644 --- a/index.js +++ b/index.js @@ -119,25 +119,6 @@ app.post("/api/payforalert", (req, res) => { }); }); -var runServices = async () => { - - -} - -runServices(); - -var rule = new schedule.RecurrenceRule(); - rule.seccond = 1; - schedule.scheduleJob(rule, async function () { - console.log(new Date(), 'Crawler service started'); - await crawlAll(); - console.log(new Date(), 'Crawler service finished, starting Notification service'); - await processNotifications(); - console.log(new Date(), 'Notification service finished'); - }); - - - app.get('/', welcome); app.get('/vrstanekretnine/:request_id', getRealEstateTypes); app.get('/vrstanekretnine', getRealEstateTypes); @@ -176,3 +157,13 @@ app.get('/ponovo', getGoAgain); app.use('/assets', express.static('./app/public')); app.listen(port, () => console.log(`Example app listening on port ${port}!`)); + +var rule = new schedule.RecurrenceRule(); + rule.seccond = 1; + schedule.scheduleJob(rule, async function () { + console.log(new Date(), 'Crawler service started'); + // await crawlAll(); + console.log(new Date(), 'Crawler service finished, starting Notification service'); + // await processNotifications(); + console.log(new Date(), 'Notification service finished'); + }); From afeffe8c7193f2242f74c9d4e90c73697cf3571e Mon Sep 17 00:00:00 2001 From: Nedim Uka Date: Thu, 11 Jul 2019 14:33:59 +0200 Subject: [PATCH 2/3] Added roboto font --- app/public/main.css | 1 + app/views/layout.ejs | 43 ++++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/app/public/main.css b/app/public/main.css index 452997e..b936827 100644 --- a/app/public/main.css +++ b/app/public/main.css @@ -38,6 +38,7 @@ body { height: 100%; margin: 0; padding: 0; + font-family: 'Tangerine', serif; } #floating-panel { diff --git a/app/views/layout.ejs b/app/views/layout.ejs index 9f44505..2dad9cc 100644 --- a/app/views/layout.ejs +++ b/app/views/layout.ejs @@ -1,22 +1,23 @@ - + - - - - - - - - - - -
- <%-body%> -
- - - - - - - + + + + + + + + + + + + +
+ <%-body%> +
+ + + + + + \ No newline at end of file From f9abf48f611e81782abc1c2fb81dd631e1143de6 Mon Sep 17 00:00:00 2001 From: Nedim Uka Date: Fri, 12 Jul 2019 10:53:23 +0200 Subject: [PATCH 3/3] Removed unecessary comments --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f46f55e..6718d83 100644 --- a/index.js +++ b/index.js @@ -162,8 +162,8 @@ var rule = new schedule.RecurrenceRule(); rule.seccond = 1; schedule.scheduleJob(rule, async function () { console.log(new Date(), 'Crawler service started'); - // await crawlAll(); + await crawlAll(); console.log(new Date(), 'Crawler service finished, starting Notification service'); - // await processNotifications(); + await processNotifications(); console.log(new Date(), 'Notification service finished'); });