WiP Ad preview page - flexslider problem.
This commit is contained in:
@@ -9,6 +9,8 @@ const {
|
|||||||
ACCESS_ROAD_TYPE,
|
ACCESS_ROAD_TYPE,
|
||||||
HEATING_TYPE
|
HEATING_TYPE
|
||||||
} = require("../common/enums");
|
} = require("../common/enums");
|
||||||
|
const { APP_URL } = require("../config/appConfig");
|
||||||
|
|
||||||
const {
|
const {
|
||||||
BASIC_BOOLEAN_PUBLISH,
|
BASIC_BOOLEAN_PUBLISH,
|
||||||
BASIC_SEGMENT_PUBLISH,
|
BASIC_SEGMENT_PUBLISH,
|
||||||
@@ -185,8 +187,6 @@ const postPublishInputs = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const nextStepPage = req.query.nextStep || "/uspjesnaobjava";
|
const nextStepPage = req.query.nextStep || "/uspjesnaobjava";
|
||||||
//
|
|
||||||
console.log("Req body:", req.body);
|
|
||||||
|
|
||||||
const balcony = req.body.balcony === "on";
|
const balcony = req.body.balcony === "on";
|
||||||
const elevator = req.body.elevator === "on";
|
const elevator = req.body.elevator === "on";
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const {
|
|||||||
const { createKiviOriginal } = require("../helpers/db/kiviOriginal");
|
const { createKiviOriginal } = require("../helpers/db/kiviOriginal");
|
||||||
|
|
||||||
const { AD_CATEGORY, AD_TYPE, AD_AGENCY } = require("../common/enums");
|
const { AD_CATEGORY, AD_TYPE, AD_AGENCY } = require("../common/enums");
|
||||||
|
const { APP_URL } = require("../config/appConfig");
|
||||||
|
|
||||||
const getPublishTypes = async (req, res) => {
|
const getPublishTypes = async (req, res) => {
|
||||||
const kiviOriginal = await currentKiviRealEstate(req);
|
const kiviOriginal = await currentKiviRealEstate(req);
|
||||||
@@ -77,11 +78,12 @@ const postPublishTypes = async (req, res) => {
|
|||||||
const newKiviOriginal = await createKiviOriginal({
|
const newKiviOriginal = await createKiviOriginal({
|
||||||
email: ""
|
email: ""
|
||||||
});
|
});
|
||||||
|
const newKiviAdViewUrl = `${APP_URL}/preglednekretnine/${newKiviOriginal.kiviAdId}`;
|
||||||
|
|
||||||
const newRealEstate = await createRealEstate({
|
const newRealEstate = await createRealEstate({
|
||||||
adType: adTypeStringId,
|
adType: adTypeStringId,
|
||||||
realEstateType: selectedRealEstateType,
|
realEstateType: selectedRealEstateType,
|
||||||
url: "http://localhost:5000/",
|
url: newKiviAdViewUrl,
|
||||||
originAgencyName: AD_AGENCY.KIVI,
|
originAgencyName: AD_AGENCY.KIVI,
|
||||||
agencyObjectId: newKiviOriginal.kiviAdId
|
agencyObjectId: newKiviOriginal.kiviAdId
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ const {
|
|||||||
ADDITIONAL_INPUT_PUBLISH
|
ADDITIONAL_INPUT_PUBLISH
|
||||||
} = require("../common/publishEnums");
|
} = require("../common/publishEnums");
|
||||||
|
|
||||||
|
const { AD_CATEGORY, AD_TYPE } = require("../common/enums");
|
||||||
|
|
||||||
const getViewRealEstate = async (req, res) => {
|
const getViewRealEstate = async (req, res) => {
|
||||||
const kiviOriginal = await currentKiviRealEstate(req);
|
const kiviOriginal = await currentKiviRealEstate(req);
|
||||||
|
|
||||||
@@ -163,6 +165,20 @@ const getViewRealEstate = async (req, res) => {
|
|||||||
"https://cdn.pixabay.com/photo/2020/02/18/01/16/down-4858219__340.jpg"
|
"https://cdn.pixabay.com/photo/2020/02/18/01/16/down-4858219__340.jpg"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const showRealEstateType = AD_CATEGORY[realEstateType].title.toUpperCase();
|
||||||
|
let showAdType = "";
|
||||||
|
switch (adType) {
|
||||||
|
case AD_TYPE.AD_TYPE_SALE.stringId:
|
||||||
|
showAdType = AD_TYPE.AD_TYPE_SALE.title.toUpperCase();
|
||||||
|
break;
|
||||||
|
case AD_TYPE.AD_TYPE_RENT.stringId:
|
||||||
|
showAdType = AD_TYPE.AD_TYPE_RENT.title.toUpperCase();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
showAdType = "-";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
res.render("viewRealEstate", {
|
res.render("viewRealEstate", {
|
||||||
title: pageTitle,
|
title: pageTitle,
|
||||||
booleanFields,
|
booleanFields,
|
||||||
@@ -172,8 +188,8 @@ const getViewRealEstate = async (req, res) => {
|
|||||||
allSegmentSelectedValues,
|
allSegmentSelectedValues,
|
||||||
locationLat,
|
locationLat,
|
||||||
locationLong,
|
locationLong,
|
||||||
adType,
|
showAdType,
|
||||||
realEstateType,
|
showRealEstateType,
|
||||||
realEstatePhotosUrls
|
realEstatePhotosUrls
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ const { createSearchRequest } = require("../helpers/db/searchRequest");
|
|||||||
const { createRealEstate } = require("../helpers/db/realEstate");
|
const { createRealEstate } = require("../helpers/db/realEstate");
|
||||||
const { createKiviOriginal } = require("../helpers/db/kiviOriginal");
|
const { createKiviOriginal } = require("../helpers/db/kiviOriginal");
|
||||||
const { AD_TYPE, AD_CATEGORY, AD_AGENCY } = require("../common/enums");
|
const { AD_TYPE, AD_CATEGORY, AD_AGENCY } = require("../common/enums");
|
||||||
|
const { APP_URL } = require("../config/appConfig");
|
||||||
|
|
||||||
const getWelcome = (req, res) => {
|
const getWelcome = (req, res) => {
|
||||||
res.render("welcome", {
|
res.render("welcome", {
|
||||||
@@ -39,11 +40,12 @@ const postWelcome = async (req, res) => {
|
|||||||
email: ""
|
email: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const newKiviAdViewUrl = `${APP_URL}/preglednekretnine/${newKiviOriginal.kiviAdId}`;
|
||||||
|
|
||||||
const newRealEstate = await createRealEstate({
|
const newRealEstate = await createRealEstate({
|
||||||
adType: adTypeStringId,
|
adType: adTypeStringId,
|
||||||
realEstateType: AD_CATEGORY.FLAT.id,
|
realEstateType: AD_CATEGORY.FLAT.id,
|
||||||
//Temp variable because of the not null constraints
|
url: newKiviAdViewUrl,
|
||||||
url: "http://localhost:5000/",
|
|
||||||
originAgencyName: AD_AGENCY.KIVI,
|
originAgencyName: AD_AGENCY.KIVI,
|
||||||
agencyObjectId: newKiviOriginal.kiviAdId
|
agencyObjectId: newKiviOriginal.kiviAdId
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -181,3 +181,7 @@ h3 {
|
|||||||
-webkit-hyphens: auto;
|
-webkit-hyphens: auto;
|
||||||
hyphens: auto;
|
hyphens: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex-direction-nav li a {
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,16 +1,28 @@
|
|||||||
|
<br/>
|
||||||
|
<div class="row col s12 center-align">
|
||||||
|
<div class="col s6 center-align distinguished">
|
||||||
|
<div><%= showAdType %> </div>
|
||||||
|
</div>
|
||||||
|
<div class="col s6 center-align distinguished">
|
||||||
|
<%= showRealEstateType %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<section class="slider">
|
<section class="slider">
|
||||||
<div class="flexslider" style="direction:rtl">
|
<div class="flexslider" >
|
||||||
<ul class="slides">
|
<ul class="slides">
|
||||||
<% for (const photoUrl of realEstatePhotosUrls) { %>
|
<% for (const photoUrl of realEstatePhotosUrls) { %>
|
||||||
<li>
|
<li>
|
||||||
<img src=<%= photoUrl %> alt=""/>
|
<img src=<%= photoUrl %> alt=""/>
|
||||||
</li>
|
</li>
|
||||||
<% } %>
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<br/>
|
||||||
<br>
|
<br>
|
||||||
<div class="row col s12">
|
<div class="row col s12">
|
||||||
<% for (const field of inputFields){ %>
|
<% for (const field of inputFields){ %>
|
||||||
@@ -60,12 +72,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// Can also be used with $(document).ready()
|
|
||||||
$(window).load(function() {
|
$(window).load(function() {
|
||||||
$('.flexslider').flexslider({
|
|
||||||
|
$('.flexslider').flexslider({
|
||||||
animation: "slide",
|
animation: "slide",
|
||||||
rtl: true
|
|
||||||
|
smoothHeight: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user