Real Estate Slider
This commit is contained in:
@@ -18,7 +18,7 @@ const getQueryReview = async (req,res) => {
|
|||||||
const realEstateTypeTitle = realEstateType ? getEnumTypeTitle(realEstateTypes, realEstateType) : null;
|
const realEstateTypeTitle = realEstateType ? getEnumTypeTitle(realEstateTypes, realEstateType) : null;
|
||||||
const regionName = region ? getRegionName(region) : null;
|
const regionName = region ? getRegionName(region) : null;
|
||||||
const municipalityName = (region && municipality) ? getMunicipalityName(region, municipality) : null;
|
const municipalityName = (region && municipality) ? getMunicipalityName(region, municipality) : null;
|
||||||
const sizeTitle = size ? getEnumTypeTitle(sizes, size) : null;
|
const sizeTitle = size ? size + "m2" : null;
|
||||||
const gardenSizeTitle = gardenSize ? getEnumTypeTitle(gardenSizes, gardenSize) : null;
|
const gardenSizeTitle = gardenSize ? getEnumTypeTitle(gardenSizes, gardenSize) : null;
|
||||||
const priceTitle = price ? getEnumTypeTitle(prices, price) : null;
|
const priceTitle = price ? getEnumTypeTitle(prices, price) : null;
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ const postSize = async (req, res) => {
|
|||||||
const nextStep = realEstateType && realEstateType.hasGardenSize ? 'okucnica' : 'cijena';
|
const nextStep = realEstateType && realEstateType.hasGardenSize ? 'okucnica' : 'cijena';
|
||||||
const nextStepPage = req.query.nextStep || nextStep;
|
const nextStepPage = req.query.nextStep || nextStep;
|
||||||
const nextStepUrl = `/${nextStepPage}/${request.uniqueId}`;
|
const nextStepUrl = `/${nextStepPage}/${request.uniqueId}`;
|
||||||
|
request.size = req.body.from + "-" + req.body.to ;
|
||||||
request.size = req.body.size;
|
|
||||||
await request.save();
|
await request.save();
|
||||||
|
|
||||||
res.redirect(nextStepUrl);
|
res.redirect(nextStepUrl);
|
||||||
|
|||||||
@@ -1,29 +1,49 @@
|
|||||||
<!--suppress HtmlUnknownAnchorTarget -->
|
<!--suppress HtmlUnknownAnchorTarget -->
|
||||||
<div class="row center-align">
|
<div class="row center-align">
|
||||||
<h2>Do koliko kvadrata tražite nekretninu ?</h2>
|
<h2>Od koliko kvadrata tražite nekretninu ?</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="POST" id="form-size">
|
<form method="POST" id="form-size">
|
||||||
<div class="row center-align">
|
|
||||||
<ul class="collection with-header">
|
<div>
|
||||||
<% for(const size of sizes) { %>
|
<div class="row center-align">
|
||||||
<li class="collection-item">
|
<h6>Od</h6>
|
||||||
<div id="<%= size.id %>" onclick="saveAndSubmit(this.id)"><%= size.title %>
|
</div>
|
||||||
<a href="#" class="secondary-content">
|
<p class="range-field">
|
||||||
<i class="material-icons">send</i>
|
<input name="from" id="from" type="range" value="0" min="0" max="250" />
|
||||||
</a>
|
</p>
|
||||||
</div>
|
<div class="row center-align">
|
||||||
</li>
|
<h6>Do</h6>
|
||||||
<% } %>
|
</div>
|
||||||
</ul>
|
<p class="range-field">
|
||||||
<input type="hidden" name="size" id="size" />
|
<input name="to" id="to" type="range" value="50" min="0" max="250" />
|
||||||
</div>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="col s6 push-s3">
|
||||||
|
<a id="btnsubmit" href="#" class="welcome-center-button waves-effect waves-light btn">
|
||||||
|
Dalje
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function saveAndSubmit(id) {
|
|
||||||
$("#size").val(id);
|
|
||||||
$("#form-size").submit();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
$(document).ready(() => {
|
||||||
|
|
||||||
|
$("#btnsubmit").click(() => {
|
||||||
|
var from = $("#from").val();
|
||||||
|
var to = $("#to").val();
|
||||||
|
console.log("From " + from + " " + to);
|
||||||
|
|
||||||
|
if (parseInt(from, 10) >= parseInt(to, 10)) {
|
||||||
|
alert("\"Od\" vrijednost ne smije biti veca od \"Do\" vrijednosti ")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#form-size").submit();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// function saveAndSubmit(id) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user