From 9e06731c84c77d047b5693831401c0afa44eb517 Mon Sep 17 00:00:00 2001 From: Naida Vatric Date: Fri, 7 Feb 2020 14:05:00 +0100 Subject: [PATCH] WiP Added location input. --- app/controllers/publishRealEstate.js | 6 + app/views/publishLocation.ejs | 192 +++++++++++++++++++++++++++ app/views/publishPrice.ejs | 1 - app/views/publishRealEstate.ejs | 26 +++- 4 files changed, 219 insertions(+), 6 deletions(-) create mode 100644 app/views/publishLocation.ejs delete mode 100644 app/views/publishPrice.ejs diff --git a/app/controllers/publishRealEstate.js b/app/controllers/publishRealEstate.js index 308d819..0dde499 100644 --- a/app/controllers/publishRealEstate.js +++ b/app/controllers/publishRealEstate.js @@ -234,6 +234,9 @@ const postPublishInputs = async (req, res) => { const streetName = req.body.streetName || ""; const longDescription = req.body.longDescription || ""; + const locationLat = req.body.lat || null; + const locationLong = req.body.lng || null; + realEstate.balcony = balcony; realEstate.elevator = elevator; realEstate.newBuilding = newBuilding; @@ -278,6 +281,9 @@ const postPublishInputs = async (req, res) => { realEstate.longDescription = longDescription; + realEstate.locationLat = locationLat; + realEstate.locationLong = locationLong; + await realEstate.save(); res.redirect(nextStepUrl); diff --git a/app/views/publishLocation.ejs b/app/views/publishLocation.ejs new file mode 100644 index 0000000..d2dfd01 --- /dev/null +++ b/app/views/publishLocation.ejs @@ -0,0 +1,192 @@ +
+

+ Izaberite lokaciju nekretnine na mapi. +

+
+ +
+
+ +
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + diff --git a/app/views/publishPrice.ejs b/app/views/publishPrice.ejs deleted file mode 100644 index 34d2e61..0000000 --- a/app/views/publishPrice.ejs +++ /dev/null @@ -1 +0,0 @@ -Publish Price \ No newline at end of file diff --git a/app/views/publishRealEstate.ejs b/app/views/publishRealEstate.ejs index 7b5093c..b621e82 100644 --- a/app/views/publishRealEstate.ejs +++ b/app/views/publishRealEstate.ejs @@ -5,7 +5,7 @@ @@ -16,8 +16,8 @@
<%- include("./publishAdditionalData.ejs") %>
-
- <%- include("./publishPrice.ejs") %> +
+ <%- include("./publishLocation.ejs") %>
<%- include("./publishEnd.ejs") %> @@ -30,10 +30,26 @@ \ No newline at end of file