Update templates/menu.html
Browse files- templates/menu.html +460 -230
templates/menu.html
CHANGED
|
@@ -9,317 +9,547 @@
|
|
| 9 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
|
| 10 |
<style>
|
| 11 |
body {
|
| 12 |
-
font-family:
|
| 13 |
-
background-color: #
|
| 14 |
margin: 0;
|
| 15 |
padding: 0;
|
|
|
|
| 16 |
display: flex;
|
| 17 |
flex-direction: column;
|
| 18 |
}
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
}
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
| 34 |
border-radius: 20px;
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
background-color: #fff;
|
| 37 |
-
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
}
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
}
|
|
|
|
| 43 |
.menu-image {
|
| 44 |
-
height:
|
| 45 |
width: 100%;
|
| 46 |
object-fit: cover;
|
| 47 |
-
border-radius:
|
| 48 |
-
}
|
| 49 |
-
.card-body {
|
| 50 |
-
padding: 15px;
|
| 51 |
}
|
|
|
|
| 52 |
.card-title {
|
| 53 |
-
font-size: 1.
|
| 54 |
-
font-weight:
|
| 55 |
-
|
| 56 |
-
margin-bottom: 5px;
|
| 57 |
}
|
|
|
|
| 58 |
.card-text {
|
| 59 |
font-size: 1rem;
|
| 60 |
-
color: #
|
| 61 |
-
font-weight: 500;
|
| 62 |
-
margin-bottom: 10px;
|
| 63 |
}
|
|
|
|
| 64 |
.btn-primary {
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
transition: background-color 0.3s ease;
|
| 72 |
}
|
|
|
|
| 73 |
.btn-primary:hover {
|
| 74 |
-
background-color: #
|
| 75 |
-
border-color: #
|
| 76 |
-
}
|
| 77 |
-
.btn-primary:active,
|
| 78 |
-
.btn-primary:focus {
|
| 79 |
-
background-color: #d35400;
|
| 80 |
-
border-color: #d35400;
|
| 81 |
-
box-shadow: none;
|
| 82 |
-
}
|
| 83 |
-
.customizable-label {
|
| 84 |
-
font-size: 0.85rem;
|
| 85 |
-
color: #888;
|
| 86 |
-
font-style: italic;
|
| 87 |
}
|
|
|
|
| 88 |
.view-cart-container {
|
| 89 |
position: fixed;
|
| 90 |
bottom: 20px;
|
| 91 |
right: 20px;
|
| 92 |
z-index: 999;
|
| 93 |
}
|
|
|
|
| 94 |
.view-cart-button {
|
| 95 |
-
background-color: #
|
| 96 |
color: #fff;
|
| 97 |
-
padding:
|
| 98 |
-
border-radius:
|
| 99 |
font-size: 1rem;
|
| 100 |
-
font-weight:
|
| 101 |
text-decoration: none;
|
| 102 |
-
box-shadow:
|
| 103 |
-
|
| 104 |
-
align-items: center;
|
| 105 |
-
justify-content: center;
|
| 106 |
-
transition: background-color 0.3s ease;
|
| 107 |
-
}
|
| 108 |
.view-cart-button:hover {
|
| 109 |
-
background-color: #
|
| 110 |
text-decoration: none;
|
|
|
|
| 111 |
}
|
| 112 |
-
|
| 113 |
-
.
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
.modal-header {
|
| 118 |
-
border-bottom: none;
|
| 119 |
-
padding-bottom: 0;
|
| 120 |
}
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
}
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
object-fit: cover;
|
| 130 |
-
border-radius: 10px;
|
| 131 |
-
margin-bottom: 15px;
|
| 132 |
}
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
}
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
|
|
|
| 142 |
margin-bottom: 10px;
|
| 143 |
}
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
| 147 |
}
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
margin-right: 10px;
|
| 150 |
}
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
color: #
|
| 154 |
-
|
| 155 |
-
margin-left: 5px;
|
| 156 |
-
}
|
| 157 |
-
.modal-body textarea {
|
| 158 |
-
width: 100%;
|
| 159 |
-
border-radius: 8px;
|
| 160 |
-
border: 1px solid #ddd;
|
| 161 |
-
padding: 10px;
|
| 162 |
-
font-size: 0.9rem;
|
| 163 |
-
resize: none;
|
| 164 |
}
|
|
|
|
| 165 |
.modal-footer {
|
| 166 |
-
|
| 167 |
-
|
|
|
|
| 168 |
}
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
|
|
|
|
|
|
|
|
|
| 175 |
}
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
|
|
|
|
|
|
| 179 |
}
|
| 180 |
</style>
|
| 181 |
</head>
|
| 182 |
<body>
|
| 183 |
-
<div class="
|
| 184 |
-
<
|
| 185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
{% for section, items in ordered_menu.items() %}
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
</div>
|
| 203 |
-
</div>
|
| 204 |
-
</div>
|
| 205 |
</div>
|
| 206 |
-
|
| 207 |
</div>
|
|
|
|
|
|
|
| 208 |
{% endfor %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
</div>
|
| 210 |
|
| 211 |
-
<!-- Modal for Item Details -->
|
| 212 |
<div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
|
| 213 |
-
<div class="modal-dialog modal-
|
| 214 |
<div class="modal-content">
|
| 215 |
<div class="modal-header">
|
| 216 |
-
<h5 class="modal-title" id="
|
| 217 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
| 218 |
</div>
|
| 219 |
<div class="modal-body">
|
| 220 |
-
<img id="modal-img"
|
| 221 |
-
|
| 222 |
-
<
|
| 223 |
-
|
| 224 |
-
<
|
| 225 |
-
<
|
| 226 |
-
|
| 227 |
-
<div
|
| 228 |
-
<input class="form-check-input" type="radio" name="oilPreference" id="ghee">
|
| 229 |
-
<label class="form-check-label" for="ghee">Ghee</label>
|
| 230 |
-
</div>
|
| 231 |
-
<div class="form-check me-3">
|
| 232 |
-
<input class="form-check-input" type="radio" name="oilPreference" id="butter">
|
| 233 |
-
<label class="form-check-label" for="butter">Butter</label>
|
| 234 |
-
</div>
|
| 235 |
-
<div class="form-check me-3">
|
| 236 |
-
<input class="form-check-input" type="radio" name="oilPreference" id="mustardOil">
|
| 237 |
-
<label class="form-check-label" for="mustardOil">Mustard Oil</label>
|
| 238 |
-
</div>
|
| 239 |
-
<div class="form-check">
|
| 240 |
-
<input class="form-check-input" type="radio" name="oilPreference" id="oliveOil">
|
| 241 |
-
<label class="form-check-label" for="oliveOil">Olive Oil</label>
|
| 242 |
-
</div>
|
| 243 |
</div>
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
<input class="form-check-input" type="checkbox" id="extraPaneer">
|
| 249 |
-
<label class="form-check-label" for="extraPaneer">Extra Paneer <span class="price">($2)</span></label>
|
| 250 |
-
</div>
|
| 251 |
-
<div class="form-check me-3">
|
| 252 |
-
<input class="form-check-input" type="checkbox" id="extraButter">
|
| 253 |
-
<label class="form-check-label" for="extraButter">Extra Butter <span class="price">($2)</span></label>
|
| 254 |
-
</div>
|
| 255 |
-
<div class="form-check">
|
| 256 |
-
<input class="form-check-input" type="checkbox" id="extraCream">
|
| 257 |
-
<label class="form-check-label" for="extraCream">Extra Cream <span class="price">($2)</span></label>
|
| 258 |
-
</div>
|
| 259 |
-
</div>
|
| 260 |
-
|
| 261 |
-
<h6>Accompaniments</h6>
|
| 262 |
-
<div class="d-flex flex-wrap">
|
| 263 |
-
<div class="form-check me-3">
|
| 264 |
-
<input class="form-check-input" type="checkbox" id="butterRoti">
|
| 265 |
-
<label class="form-check-label" for="butterRoti">Butter Roti <span class="price">($1)</span></label>
|
| 266 |
-
</div>
|
| 267 |
-
<div class="form-check me-3">
|
| 268 |
-
<input class="form-check-input" type="checkbox" id="jeeraRice">
|
| 269 |
-
<label class="form-check-label" for="jeeraRice">Jeera Rice <span class="price">($1)</span></label>
|
| 270 |
-
</div>
|
| 271 |
-
<div class="form-check me-3">
|
| 272 |
-
<input class="form-check-input" type="checkbox" id="plainRice">
|
| 273 |
-
<label class="form-check-label" for="plainRice">Plain Rice <span class="price">($1)</span></label>
|
| 274 |
-
</div>
|
| 275 |
-
<div class="form-check">
|
| 276 |
-
<input class="form-check-input" type="checkbox" id="bagaraRice">
|
| 277 |
-
<label class="form-check-label" for="bagaraRice">Bagara Rice <span class="price">($1)</span></label>
|
| 278 |
-
</div>
|
| 279 |
-
</div>
|
| 280 |
-
|
| 281 |
-
<h6>Special Request</h6>
|
| 282 |
-
<textarea rows="3" placeholder="Enter any special instructions here..."></textarea>
|
| 283 |
-
|
| 284 |
-
<!-- Spice Level (Optional) -->
|
| 285 |
-
<h6>Spice Level</h6>
|
| 286 |
-
<div class="d-flex">
|
| 287 |
-
<div class="form-check me-3">
|
| 288 |
-
<input class="form-check-input" type="radio" name="spiceLevel" id="mild">
|
| 289 |
-
<label class="form-check-label" for="mild">Mild</label>
|
| 290 |
-
</div>
|
| 291 |
-
<div class="form-check me-3">
|
| 292 |
-
<input class="form-check-input" type="radio" name="spiceLevel" id="medium">
|
| 293 |
-
<label class="form-check-label" for="medium">Medium</label>
|
| 294 |
-
</div>
|
| 295 |
-
<div class="form-check">
|
| 296 |
-
<input class="form-check-input" type="radio" name="spiceLevel" id="spicy">
|
| 297 |
-
<label class="form-check-label" for="spicy">Spicy</label>
|
| 298 |
-
</div>
|
| 299 |
</div>
|
|
|
|
| 300 |
</div>
|
| 301 |
<div class="modal-footer">
|
| 302 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
</div>
|
| 304 |
</div>
|
| 305 |
</div>
|
| 306 |
</div>
|
| 307 |
|
| 308 |
-
<
|
| 309 |
-
<a href="/cart" class="view-cart-button">
|
| 310 |
-
View Cart
|
| 311 |
-
</a>
|
| 312 |
-
</div>
|
| 313 |
-
|
| 314 |
<script>
|
|
|
|
| 315 |
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
| 316 |
document.getElementById('modal-name').innerText = name;
|
| 317 |
-
document.getElementById('modal-price').innerText =
|
| 318 |
document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
|
| 319 |
document.getElementById('modal-description').innerText = description || 'No description available.';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 320 |
}
|
| 321 |
-
</script>
|
| 322 |
|
| 323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
</body>
|
| 325 |
</html>
|
|
|
|
| 9 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
|
| 10 |
<style>
|
| 11 |
body {
|
| 12 |
+
font-family: Arial, sans-serif;
|
| 13 |
+
background-color: #fdf4e3;
|
| 14 |
margin: 0;
|
| 15 |
padding: 0;
|
| 16 |
+
min-height: 100vh;
|
| 17 |
display: flex;
|
| 18 |
flex-direction: column;
|
| 19 |
}
|
| 20 |
+
|
| 21 |
+
.fixed-top-bar {
|
| 22 |
+
position: fixed;
|
| 23 |
+
top: 0;
|
| 24 |
+
left: 0;
|
| 25 |
+
width: 100%;
|
| 26 |
+
height: 60px;
|
| 27 |
+
background-color: #FF6B35;
|
| 28 |
+
color: white;
|
| 29 |
+
padding: 10px 20px;
|
| 30 |
+
display: flex;
|
| 31 |
+
align-items: center;
|
| 32 |
+
justify-content: space-between;
|
| 33 |
+
z-index: 1000;
|
| 34 |
}
|
| 35 |
+
|
| 36 |
+
.search-bar-container {
|
| 37 |
+
position: relative;
|
| 38 |
+
width: 300px;
|
| 39 |
}
|
| 40 |
+
|
| 41 |
+
.search-bar-container input {
|
| 42 |
+
width: 100%;
|
| 43 |
+
padding: 8px 8px 8px 35px;
|
| 44 |
border-radius: 20px;
|
| 45 |
+
border: none;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.search-icon {
|
| 49 |
+
position: absolute;
|
| 50 |
+
left: 10px;
|
| 51 |
+
top: 50%;
|
| 52 |
+
transform: translateY(-50%);
|
| 53 |
+
font-size: 18px;
|
| 54 |
+
color: #888;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.avatar-dropdown-container {
|
| 58 |
+
position: relative;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
.avatar-icon {
|
| 62 |
+
width: 40px;
|
| 63 |
+
height: 40px;
|
| 64 |
+
border-radius: 50%;
|
| 65 |
+
background-color: #5bbfc1;
|
| 66 |
+
cursor: pointer;
|
| 67 |
+
display: flex;
|
| 68 |
+
align-items: center;
|
| 69 |
+
justify-content: center;
|
| 70 |
+
color: white;
|
| 71 |
+
font-size: 20px;
|
| 72 |
+
font-weight: bold;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.dropdown-menu {
|
| 76 |
+
position: absolute;
|
| 77 |
+
right: 0;
|
| 78 |
+
top: 100%;
|
| 79 |
background-color: #fff;
|
| 80 |
+
border-radius: 5px;
|
| 81 |
+
width: 200px;
|
| 82 |
+
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
| 83 |
+
display: none;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
.avatar-dropdown-container:hover .dropdown-menu {
|
| 87 |
+
display: block;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
.dropdown-menu .dropdown-item {
|
| 91 |
+
padding: 10px 15px;
|
| 92 |
+
text-decoration: none;
|
| 93 |
+
color: #333;
|
| 94 |
+
border-bottom: 1px solid #ddd;
|
| 95 |
+
display: block;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.dropdown-menu .dropdown-item:last-child {
|
| 99 |
+
border-bottom: none;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
.dropdown-menu .dropdown-item:hover {
|
| 103 |
+
background-color: #f1f1f1;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
.container {
|
| 107 |
+
max-width: 900px;
|
| 108 |
+
margin-top: 80px; /* Space for fixed header */
|
| 109 |
+
padding: 20px;
|
| 110 |
}
|
| 111 |
+
|
| 112 |
+
.menu-card {
|
| 113 |
+
max-width: 350px;
|
| 114 |
+
border-radius: 15px;
|
| 115 |
+
background-color: #fff;
|
| 116 |
+
margin: 0 auto 20px;
|
| 117 |
}
|
| 118 |
+
|
| 119 |
.menu-image {
|
| 120 |
+
height: 200px;
|
| 121 |
width: 100%;
|
| 122 |
object-fit: cover;
|
| 123 |
+
border-radius: 15px 15px 0 0;
|
|
|
|
|
|
|
|
|
|
| 124 |
}
|
| 125 |
+
|
| 126 |
.card-title {
|
| 127 |
+
font-size: 1.2rem;
|
| 128 |
+
font-weight: bold;
|
| 129 |
+
margin: 10px 0;
|
|
|
|
| 130 |
}
|
| 131 |
+
|
| 132 |
.card-text {
|
| 133 |
font-size: 1rem;
|
| 134 |
+
color: #6c757d;
|
|
|
|
|
|
|
| 135 |
}
|
| 136 |
+
|
| 137 |
.btn-primary {
|
| 138 |
+
background-color: #0FAA39;
|
| 139 |
+
border-color: #0FAA39;
|
| 140 |
+
font-size: 13px;
|
| 141 |
+
font-weight: bold;
|
| 142 |
+
border-radius: 5px;
|
| 143 |
+
width: 100px;
|
|
|
|
| 144 |
}
|
| 145 |
+
|
| 146 |
.btn-primary:hover {
|
| 147 |
+
background-color: #109835;
|
| 148 |
+
border-color: #109835;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
}
|
| 150 |
+
|
| 151 |
.view-cart-container {
|
| 152 |
position: fixed;
|
| 153 |
bottom: 20px;
|
| 154 |
right: 20px;
|
| 155 |
z-index: 999;
|
| 156 |
}
|
| 157 |
+
|
| 158 |
.view-cart-button {
|
| 159 |
+
background-color: #0FAA39;
|
| 160 |
color: #fff;
|
| 161 |
+
padding: 10px 20px;
|
| 162 |
+
border-radius: 30px;
|
| 163 |
font-size: 1rem;
|
| 164 |
+
font-weight: bold;
|
| 165 |
text-decoration: none;
|
| 166 |
+
box-shadow: 0px ව
|
| 167 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
.view-cart-button:hover {
|
| 169 |
+
background-color: #109835;
|
| 170 |
text-decoration: none;
|
| 171 |
+
color: #fff;
|
| 172 |
}
|
| 173 |
+
|
| 174 |
+
.form-check {
|
| 175 |
+
display: inline-flex;
|
| 176 |
+
align-items: center;
|
| 177 |
+
margin: 0 15px 10px 0;
|
|
|
|
|
|
|
|
|
|
| 178 |
}
|
| 179 |
+
|
| 180 |
+
.custom-radio {
|
| 181 |
+
appearance: none;
|
| 182 |
+
width: 20px;
|
| 183 |
+
height: 20px;
|
| 184 |
+
border: 3px solid #4CAF50;
|
| 185 |
+
border-radius: 50%;
|
| 186 |
+
margin-right: 8px;
|
| 187 |
+
cursor: pointer;
|
| 188 |
+
position: relative;
|
| 189 |
}
|
| 190 |
+
|
| 191 |
+
.custom-radio:checked {
|
| 192 |
+
background-color: #4CAF50;
|
|
|
|
|
|
|
|
|
|
| 193 |
}
|
| 194 |
+
|
| 195 |
+
.form-check-label {
|
| 196 |
+
font-size: 16px;
|
| 197 |
}
|
| 198 |
+
|
| 199 |
+
.addon-section {
|
| 200 |
+
background-color: #fff;
|
| 201 |
+
border: 2px solid #6c757d;
|
| 202 |
+
border-radius: 8px;
|
| 203 |
+
padding: 12px;
|
| 204 |
margin-bottom: 10px;
|
| 205 |
}
|
| 206 |
+
|
| 207 |
+
.addon-section h6 {
|
| 208 |
+
margin-bottom: 10px;
|
| 209 |
+
font-size: 1.1rem;
|
| 210 |
+
font-weight: bold;
|
| 211 |
+
color: #343a40;
|
| 212 |
}
|
| 213 |
+
|
| 214 |
+
.addon-section .form-check-input {
|
| 215 |
+
appearance: none;
|
| 216 |
+
width: 20px;
|
| 217 |
+
height: 20px;
|
| 218 |
+
border: 2px solid #343a40;
|
| 219 |
+
border-radius: 5px;
|
| 220 |
+
background-color: #f0f0f0;
|
| 221 |
margin-right: 10px;
|
| 222 |
}
|
| 223 |
+
|
| 224 |
+
.addon-section .form-check-input:checked {
|
| 225 |
+
background-color: #006400;
|
| 226 |
+
border-color: #006400;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
}
|
| 228 |
+
|
| 229 |
.modal-footer {
|
| 230 |
+
display: flex;
|
| 231 |
+
justify-content: space-between;
|
| 232 |
+
align-items: center;
|
| 233 |
}
|
| 234 |
+
|
| 235 |
+
.modal-footer .d-flex {
|
| 236 |
+
gap: 10px;
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
.modal-footer .form-control {
|
| 240 |
+
width: 50px;
|
| 241 |
+
height: 40px;
|
| 242 |
+
text-align: center;
|
| 243 |
}
|
| 244 |
+
|
| 245 |
+
.modal-footer .btn-primary {
|
| 246 |
+
background-color: #0FAA39;
|
| 247 |
+
border-color: #0FAA39;
|
| 248 |
+
padding: 10px 20px;
|
| 249 |
}
|
| 250 |
</style>
|
| 251 |
</head>
|
| 252 |
<body>
|
| 253 |
+
<div class="fixed-top-bar">
|
| 254 |
+
<div class="search-bar-container">
|
| 255 |
+
<input type="text" id="searchBar" class="form-control" placeholder="Search items or sections..." onkeyup="filterMenu()">
|
| 256 |
+
<i class="bi bi-search search-icon"></i>
|
| 257 |
+
</div>
|
| 258 |
+
<div class="avatar-dropdown-container">
|
| 259 |
+
<div class="avatar-icon">
|
| 260 |
+
<span>{{ first_letter }}</span>
|
| 261 |
+
</div>
|
| 262 |
+
<div class="dropdown-menu">
|
| 263 |
+
<a href="{{ url_for('customer_details') }}" class="dropdown-item">View Profile</a>
|
| 264 |
+
<a href="{{ url_for('order_history') }}" class="dropdown-item">Order History</a>
|
| 265 |
+
<a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
|
| 266 |
+
</div>
|
| 267 |
+
</div>
|
| 268 |
+
</div>
|
| 269 |
+
|
| 270 |
+
<div class="container">
|
| 271 |
+
<form method="get" action="/menu" class="text-center mb-4">
|
| 272 |
+
<label class="form-label fw-bold">Select a Category:</label>
|
| 273 |
+
<div>
|
| 274 |
+
{% for category in categories %}
|
| 275 |
+
<div class="form-check form-check-inline">
|
| 276 |
+
<input type="radio" id="category-{{ category }}" name="category" value="{{ category }}"
|
| 277 |
+
class="custom-radio" {% if selected_category == category %}checked{% endif %}
|
| 278 |
+
onchange="this.form.submit()">
|
| 279 |
+
<label class="form-check-label" for="category-{{ category }}">{{ category }}</label>
|
| 280 |
+
</div>
|
| 281 |
+
{% endfor %}
|
| 282 |
+
<div class="form-check form-check-inline">
|
| 283 |
+
<input type="radio" id="category-CustomizedDish" name="category" value="Customized Dish"
|
| 284 |
+
class="custom-radio" {% if selected_category == "Customized Dish" %}checked{% endif %}
|
| 285 |
+
onchange="this.form.submit()">
|
| 286 |
+
<label class="form-check-label" for="category-CustomizedDish">Customized Dish</label>
|
| 287 |
+
</div>
|
| 288 |
+
</div>
|
| 289 |
+
</form>
|
| 290 |
+
|
| 291 |
+
{% if selected_category == "Customized Dish" %}
|
| 292 |
+
<div id="custom-dish-form" class="mt-4">
|
| 293 |
+
<h3>Create Your Custom Dish</h3>
|
| 294 |
+
<form method="POST" action="/generate_custom_dish">
|
| 295 |
+
<div class="mb-3">
|
| 296 |
+
<label for="custom-dish-name" class="form-label">Dish Name</label>
|
| 297 |
+
<input type="text" class="form-control" id="custom-dish-name" name="name" required>
|
| 298 |
+
</div>
|
| 299 |
+
<div class="mb-3">
|
| 300 |
+
<label for="custom-dish-description" class="form-label">Dish Description</label>
|
| 301 |
+
<textarea class="form-control" id="custom-dish-description" name="description" required></textarea>
|
| 302 |
+
</div>
|
| 303 |
+
<button type="submit" class="btn btn-primary">Submit</button>
|
| 304 |
+
</form>
|
| 305 |
+
</div>
|
| 306 |
+
{% else %}
|
| 307 |
+
<h1 class="text-center mb-4">Menu</h1>
|
| 308 |
{% for section, items in ordered_menu.items() %}
|
| 309 |
+
<h3>{{ section }}</h3>
|
| 310 |
+
<div class="row">
|
| 311 |
+
{% for item in items %}
|
| 312 |
+
<div class="col-md-6 mb-4">
|
| 313 |
+
<div class="card menu-card">
|
| 314 |
+
<img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}"
|
| 315 |
+
onerror="this.src='/static/placeholder.jpg';">
|
| 316 |
+
<div class="card-body">
|
| 317 |
+
<h5 class="card-title">{{ item.Name }}</h5>
|
| 318 |
+
<p class="card-text">${{ item.Price__c }}</p>
|
| 319 |
+
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#itemModal"
|
| 320 |
+
onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}',
|
| 321 |
+
'{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
|
| 322 |
+
Add
|
| 323 |
+
</button>
|
|
|
|
|
|
|
|
|
|
| 324 |
</div>
|
| 325 |
+
</div>
|
| 326 |
</div>
|
| 327 |
+
{% endfor %}
|
| 328 |
+
</div>
|
| 329 |
{% endfor %}
|
| 330 |
+
{% endif %}
|
| 331 |
+
</div>
|
| 332 |
+
|
| 333 |
+
<div class="view-cart-container">
|
| 334 |
+
<a href="/cart" class="view-cart-button">View Cart</a>
|
| 335 |
</div>
|
| 336 |
|
|
|
|
| 337 |
<div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
|
| 338 |
+
<div class="modal-dialog modal-dialog-centered">
|
| 339 |
<div class="modal-content">
|
| 340 |
<div class="modal-header">
|
| 341 |
+
<h5 class="modal-title" id="itemModalLabel">Item Details</h5>
|
| 342 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
| 343 |
</div>
|
| 344 |
<div class="modal-body">
|
| 345 |
+
<img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image"
|
| 346 |
+
style="max-height: 200px; object-fit: cover;">
|
| 347 |
+
<h5 id="modal-name" class="fw-bold text-center"></h5>
|
| 348 |
+
<p id="modal-price" class="text-muted text-center"></p>
|
| 349 |
+
<p id="modal-description" class="text-secondary"></p>
|
| 350 |
+
<div id="modal-addons" class="mt-4">
|
| 351 |
+
<h6>Customization Options</h6>
|
| 352 |
+
<div id="addons-list" class="addons-container">Loading customization options...</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
</div>
|
| 354 |
+
<div class="mt-4">
|
| 355 |
+
<h6>Custom Request</h6>
|
| 356 |
+
<textarea id="modal-instructions" class="form-control"
|
| 357 |
+
placeholder="Enter any special instructions here..."></textarea>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 358 |
</div>
|
| 359 |
+
<span id="modal-section" data-section="" data-category="" style="display: none;"></span>
|
| 360 |
</div>
|
| 361 |
<div class="modal-footer">
|
| 362 |
+
<div class="d-flex align-items-center">
|
| 363 |
+
<button type="button" class="btn btn-outline-secondary" id="decreaseQuantity">-</button>
|
| 364 |
+
<input type="text" class="form-control" id="quantityInput" value="1" readonly>
|
| 365 |
+
<button type="button" class="btn btn-outline-secondary" id="increaseQuantity">+</button>
|
| 366 |
+
</div>
|
| 367 |
+
<button type="button" class="btn btn-primary" onclick="addToCartFromModal()">Add to Cart</button>
|
| 368 |
</div>
|
| 369 |
</div>
|
| 370 |
</div>
|
| 371 |
</div>
|
| 372 |
|
| 373 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 374 |
<script>
|
| 375 |
+
// Your JavaScript remains the same
|
| 376 |
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
| 377 |
document.getElementById('modal-name').innerText = name;
|
| 378 |
+
document.getElementById('modal-price').innerText = `$${price}`;
|
| 379 |
document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
|
| 380 |
document.getElementById('modal-description').innerText = description || 'No description available.';
|
| 381 |
+
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
|
| 382 |
+
document.getElementById('modal-instructions').value = '';
|
| 383 |
+
document.getElementById('quantityInput').value = 1;
|
| 384 |
+
|
| 385 |
+
const modalSectionEl = document.getElementById('modal-section');
|
| 386 |
+
modalSectionEl.setAttribute('data-section', section);
|
| 387 |
+
modalSectionEl.setAttribute('data-category', selectedCategory);
|
| 388 |
+
|
| 389 |
+
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
|
| 390 |
+
.then(response => response.json())
|
| 391 |
+
.then(data => {
|
| 392 |
+
const addonsList = document.getElementById('addons-list');
|
| 393 |
+
addonsList.innerHTML = '';
|
| 394 |
+
if (!data.success || !data.addons || data.addons.length === 0) {
|
| 395 |
+
addonsList.innerHTML = '<p>No customization options available.</p>';
|
| 396 |
+
return;
|
| 397 |
+
}
|
| 398 |
+
data.addons.forEach(addon => {
|
| 399 |
+
const sectionDiv = document.createElement('div');
|
| 400 |
+
sectionDiv.classList.add('addon-section');
|
| 401 |
+
const title = document.createElement('h6');
|
| 402 |
+
title.innerText = addon.name;
|
| 403 |
+
sectionDiv.appendChild(title);
|
| 404 |
+
const optionsContainer = document.createElement('div');
|
| 405 |
+
addon.options.forEach((option, index) => {
|
| 406 |
+
const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
|
| 407 |
+
const listItem = document.createElement('div');
|
| 408 |
+
listItem.classList.add('form-check');
|
| 409 |
+
listItem.innerHTML = `
|
| 410 |
+
<input type="checkbox" class="form-check-input addon-option" id="${optionId}"
|
| 411 |
+
value="${option}" data-name="${option}" data-group="${addon.name}"
|
| 412 |
+
data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
|
| 413 |
+
<label class="form-check-label" for="${optionId}">
|
| 414 |
+
${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}
|
| 415 |
+
</label>
|
| 416 |
+
`;
|
| 417 |
+
optionsContainer.appendChild(listItem);
|
| 418 |
+
});
|
| 419 |
+
sectionDiv.appendChild(optionsContainer);
|
| 420 |
+
addonsList.appendChild(sectionDiv);
|
| 421 |
+
});
|
| 422 |
+
})
|
| 423 |
+
.catch(err => {
|
| 424 |
+
console.error('Error fetching add-ons:', err);
|
| 425 |
+
document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
|
| 426 |
+
});
|
| 427 |
}
|
|
|
|
| 428 |
|
| 429 |
+
document.addEventListener('click', function(event) {
|
| 430 |
+
if (event.target.classList.contains('addon-option')) {
|
| 431 |
+
handleAddonClick(event.target);
|
| 432 |
+
}
|
| 433 |
+
});
|
| 434 |
+
|
| 435 |
+
function handleAddonClick(checkbox) {
|
| 436 |
+
const groupName = checkbox.getAttribute('data-group');
|
| 437 |
+
const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce",
|
| 438 |
+
"Extra Add-ons", "Make it a Combo"].includes(groupName);
|
| 439 |
+
|
| 440 |
+
if (!isMultiSelectGroup) {
|
| 441 |
+
const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
|
| 442 |
+
checkboxes.forEach(otherCheckbox => {
|
| 443 |
+
if (otherCheckbox !== checkbox) {
|
| 444 |
+
otherCheckbox.checked = false;
|
| 445 |
+
}
|
| 446 |
+
});
|
| 447 |
+
}
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
function filterMenu() {
|
| 451 |
+
let input = document.getElementById('searchBar').value.toLowerCase();
|
| 452 |
+
let sections = document.querySelectorAll('h3');
|
| 453 |
+
let items = document.querySelectorAll('.menu-card');
|
| 454 |
+
let matchedSections = new Set();
|
| 455 |
+
|
| 456 |
+
items.forEach(item => {
|
| 457 |
+
let itemName = item.querySelector('.card-title').innerText.toLowerCase();
|
| 458 |
+
let itemSection = item.closest('.row').previousElementSibling.innerText.toLowerCase();
|
| 459 |
+
|
| 460 |
+
if (itemName.includes(input) || (itemSection && itemSection.includes(input))) {
|
| 461 |
+
item.style.display = 'block';
|
| 462 |
+
matchedSections.add(item.closest('.row'));
|
| 463 |
+
} else {
|
| 464 |
+
item.style.display = 'none';
|
| 465 |
+
}
|
| 466 |
+
});
|
| 467 |
+
|
| 468 |
+
sections.forEach(section => {
|
| 469 |
+
let sectionRow = section.nextElementSibling;
|
| 470 |
+
if (matchedSections.has(sectionRow)) {
|
| 471 |
+
section.style.display = 'block';
|
| 472 |
+
sectionRow.style.display = 'flex';
|
| 473 |
+
} else {
|
| 474 |
+
section.style.display = 'none';
|
| 475 |
+
sectionRow.style.display = 'none';
|
| 476 |
+
}
|
| 477 |
+
});
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
function addToCartFromModal() {
|
| 481 |
+
const itemName = document.getElementById('modal-name').innerText;
|
| 482 |
+
let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));
|
| 483 |
+
const itemImage = document.getElementById('modal-img').src;
|
| 484 |
+
const modalSectionEl = document.getElementById('modal-section');
|
| 485 |
+
const section = modalSectionEl.getAttribute('data-section');
|
| 486 |
+
const selectedCategory = modalSectionEl.getAttribute('data-category');
|
| 487 |
+
const quantity = parseInt(document.getElementById('quantityInput').value) || 1;
|
| 488 |
+
const instructions = document.getElementById('modal-instructions').value;
|
| 489 |
+
|
| 490 |
+
if (isNaN(itemPrice)) {
|
| 491 |
+
alert('Invalid price for the item.');
|
| 492 |
+
return;
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
let selectedAddOns = Array.from(
|
| 496 |
+
document.querySelectorAll('#addons-list input[type="checkbox"]:checked')
|
| 497 |
+
).map(addon => ({
|
| 498 |
+
name: addon.getAttribute('data-name'),
|
| 499 |
+
price: parseFloat(addon.getAttribute('data-price') || 0)
|
| 500 |
+
}));
|
| 501 |
+
|
| 502 |
+
const cartPayload = {
|
| 503 |
+
itemName,
|
| 504 |
+
itemPrice,
|
| 505 |
+
itemImage,
|
| 506 |
+
section,
|
| 507 |
+
category: selectedCategory,
|
| 508 |
+
addons: selectedAddOns,
|
| 509 |
+
instructions,
|
| 510 |
+
quantity
|
| 511 |
+
};
|
| 512 |
+
|
| 513 |
+
fetch('/cart/add', {
|
| 514 |
+
method: 'POST',
|
| 515 |
+
headers: {
|
| 516 |
+
'Content-Type': 'application/json',
|
| 517 |
+
},
|
| 518 |
+
body: JSON.stringify(cartPayload)
|
| 519 |
+
})
|
| 520 |
+
.then(response => response.json())
|
| 521 |
+
.then(data => {
|
| 522 |
+
if (data.success) {
|
| 523 |
+
alert('Item added to cart successfully!');
|
| 524 |
+
const modal = bootstrap.Modal.getInstance(document.getElementById('itemModal'));
|
| 525 |
+
modal.hide();
|
| 526 |
+
} else {
|
| 527 |
+
alert(data.error || 'Failed to add item to cart.');
|
| 528 |
+
}
|
| 529 |
+
})
|
| 530 |
+
.catch(err => {
|
| 531 |
+
console.error('Error adding item to cart:', err);
|
| 532 |
+
alert('An error occurred while adding the item to the cart.');
|
| 533 |
+
});
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
document.addEventListener('DOMContentLoaded', function () {
|
| 537 |
+
const decreaseBtn = document.getElementById('decreaseQuantity');
|
| 538 |
+
const increaseBtn = document.getElementById('increaseQuantity');
|
| 539 |
+
const quantityInput = document.getElementById('quantityInput');
|
| 540 |
+
|
| 541 |
+
decreaseBtn.addEventListener('click', function () {
|
| 542 |
+
let currentQuantity = parseInt(quantityInput.value);
|
| 543 |
+
if (currentQuantity > 1) {
|
| 544 |
+
quantityInput.value = currentQuantity - 1;
|
| 545 |
+
}
|
| 546 |
+
});
|
| 547 |
+
|
| 548 |
+
increaseBtn.addEventListener('click', function () {
|
| 549 |
+
let currentQuantity = parseInt(quantityInput.value);
|
| 550 |
+
quantityInput.value = currentQuantity + 1;
|
| 551 |
+
});
|
| 552 |
+
});
|
| 553 |
+
</script>
|
| 554 |
</body>
|
| 555 |
</html>
|