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