{{~exec(function() { helpers.var.translations = { offers : data.translations.offers, leo : data.translations.leo } })}} {{#tour}} {{~exec(() => { helpers.var.imageUrl = helpers.plugins.cloudinary.createResource({imageUrl : data.images[0].url}).getThumbnailUrl({width : 414, height : 275, crop : 'fill', sv : {gravity : 'focalPoint'}}); if (data.description) { let formattedDesc = helpers.plugins.stringLib.stripHtml(data.description); helpers.var.formattedDesc = helpers.plugins.stringLib.substringOnWord(formattedDesc, 180, {ellipsis : true}); } if (data.rating) { let roundedRating = parseFloat(data.rating.toFixed(1)); let totalStars = Math.floor(roundedRating); let partialStars = parseFloat(roundedRating - totalStars).toFixed(1); if (partialStars > 0.5) totalStars += 1; let fullStar = ``; let emptyStar = ``; let halfStar = ``; let totalStarsArr = []; for (let i = 0; i < totalStars; i++) { totalStarsArr.push(fullStar); } let testArr = []; for (let i = 0; i < 3; i++) { testArr.push(fullStar); } if (totalStars < 5) { if (partialStars === 0.5) totalStarsArr.push(halfStar); let emptyStars = 5 - totalStarsArr.length; for (let i = 0; i < emptyStars; i++) { totalStarsArr.push(emptyStar); } } helpers.var.totalStarsArr = totalStarsArr.join(''); } })}}
{{~var.formattedDesc}}