- Timestamp:
- 01/13/25 14:18:51 (2 days ago)
- Branches:
- master
- Parents:
- 0a7426e
- Location:
- frontend
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/index.html
r0a7426e rdf7f390 54 54 <span class="close">×</span> 55 55 <div class="saved-trips-container"> 56 <h2> Saved Trips</h2>56 <h2>Зачувани патувања</h2> 57 57 <div id="savedTripsList"></div> 58 58 </div> 59 59 <div class="price-changes-container"> 60 <h2> Price Changes</h2>60 <h2>Промени во понудата</h2> 61 61 <div id="priceChangesList"></div> 62 62 </div> … … 107 107 <div class="loading-content"> 108 108 <div class="spinner"></div> 109 <p> Loading, please wait...</p>109 <p>Пребарувам. ве молиме почекајте...</p> 110 110 </div> 111 111 </div> 112 112 <div id="AccountDetailsOverlay" class="popup accDetails"> 113 113 <div class="popup-content"> 114 <h1> My account</h1>114 <h1>Мој профил</h1> 115 115 <div class="popup-content" style="display: none" id="confDel"> 116 116 <div class="delete" > 117 <h1> Are you sure you want to delete your account?</h1>118 <button onclick="deleteAccount()" class="button" id="confirmDelete" style="background-color: red"> Yes</button>119 <button id="cancel" class="button" onclick="closeConfirmDelete()"> No</button>117 <h1>Дали сте сигурни дека сакате да го избришете профилот?</h1> 118 <button onclick="deleteAccount()" class="button" id="confirmDelete" style="background-color: red">Да</button> 119 <button id="cancel" class="button" onclick="closeConfirmDelete()">Не</button> 120 120 </div> 121 121 </div> 122 <button class="button" id="pswdChange">Change password</button> 123 <button class="button" style="background-color: red" id="deleteAcc" onclick="confirmDelete()">Delete Account</button> 122 <button class="button" style="background-color: red" id="deleteAcc" onclick="confirmDelete()">Избриши профил</button> 124 123 </div> 125 124 </div> -
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'); -
frontend/js/siteFlow.js
r0a7426e rdf7f390 168 168 .then(data => { 169 169 console.log('Option saved:', data); 170 // Update the UI to reflect that the option was saved171 170 updateFavoriteButtons(); 172 171 }) … … 243 242 tripDiv.appendChild(price); 244 243 244 // Add change indicator 245 if(trip.changes && trip.changes.length > 0) { 246 const changeDiv = document.createElement('div'); 247 changeDiv.classList.add('changes'); 248 trip.changes.forEach(change => { 249 const changeParagraph = document.createElement('p'); 250 changeParagraph.textContent = `${change.attribute} се смени од ${change.oldValue} во ${change.newValue}`; 251 changeDiv.appendChild(changeParagraph); 252 }); 253 tripDiv.appendChild(changeDiv); 254 } 255 245 256 savedTripsList.appendChild(tripDiv); 246 257 }); 247 248 258 249 259 const priceChangesList = document.getElementById('priceChangesList'); … … 258 268 }); 259 269 } else { 260 priceChangesList.textContent = "нема промена на цената.";270 priceChangesList.textContent = "нема промена во зачуваните патувања."; 261 271 } 262 272 }) … … 265 275 }); 266 276 } 277 267 278 function removeFromSaved(optionId) { 268 279 const userEmail = sessionStorage.getItem('user').replace(/^"|"$/g, '');
Note:
See TracChangeset
for help on using the changeset viewer.