Changeset df7f390 for frontend/js/formHandler.js
- Timestamp:
- 01/13/25 14:18:51 (2 days ago)
- Branches:
- master
- Parents:
- 0a7426e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/js/formHandler.js
r0a7426e rdf7f390 51 51 const dataList = document.getElementById('givenOptions'); 52 52 dataList.innerHTML = ''; 53 53 54 if (data.length === 0) { 54 55 const wrapper = document.createElement('div'); … … 66 67 img.src = item.imgSrc || ''; 67 68 optionDiv.appendChild(img); 68 const WrapperDiv = document.createElement('div');69 optionDiv.appendChild( WrapperDiv);69 const wrapperDiv = document.createElement('div'); 70 optionDiv.appendChild(wrapperDiv); 70 71 71 72 const nameParagraph = document.createElement('p'); 72 73 nameParagraph.id = 'name'; 73 74 nameParagraph.textContent = item.hotelName || 'N/A'; 74 WrapperDiv.appendChild(nameParagraph);75 wrapperDiv.appendChild(nameParagraph); 75 76 76 77 const countryParagraph = document.createElement('p'); … … 78 79 countryParagraph.style.fontSize = '20px'; 79 80 countryParagraph.textContent = item.country || 'N/A'; 80 WrapperDiv.appendChild(countryParagraph);81 wrapperDiv.appendChild(countryParagraph); 81 82 82 83 const dateParagraph = document.createElement('h2'); 83 84 dateParagraph.id = 'date'; 84 85 dateParagraph.textContent = item.dateRange || 'N/A'; 85 WrapperDiv.appendChild(dateParagraph);86 wrapperDiv.appendChild(dateParagraph); 86 87 87 88 const peopleParagraph = document.createElement('p'); 88 89 peopleParagraph.id = 'numPeople'; 89 90 peopleParagraph.textContent = item.numPeople === 1 ? item.numPeople + " лице" : item.numPeople + " лица"; 90 WrapperDiv.appendChild(peopleParagraph);91 wrapperDiv.appendChild(peopleParagraph); 91 92 92 93 const priceHeading = document.createElement('h1'); 93 94 priceHeading.textContent = 'Цена:'; 94 WrapperDiv.appendChild(priceHeading);95 wrapperDiv.appendChild(priceHeading); 95 96 const priceParagraph = document.createElement('h2'); 96 97 priceParagraph.id = 'price'; 97 98 priceParagraph.textContent = (item.price || 0) + " EUR"; 98 WrapperDiv.appendChild(priceParagraph);99 wrapperDiv.appendChild(priceParagraph); 99 100 100 101 const infoDiv = document.createElement('div'); … … 110 111 infoDiv.appendChild(amenities); 111 112 optionDiv.appendChild(infoDiv); 113 114 const changesDiv = document.createElement('div'); 115 item.changes.forEach(change => { 116 const changeParagraph = document.createElement('p'); 117 changeParagraph.textContent = change.attribute + " changed from " + change.oldValue + " to " + change.newValue; 118 changesDiv.appendChild(changeParagraph); 119 }); 120 optionDiv.appendChild(changesDiv); 112 121 113 122 const link = document.createElement('a');
Note:
See TracChangeset
for help on using the changeset viewer.