-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdonate-availabilityB.html
More file actions
467 lines (419 loc) · 17.4 KB
/
Copy pathdonate-availabilityB.html
File metadata and controls
467 lines (419 loc) · 17.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>FoodFerry - Donate</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Bootstrap and Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet" />
<!-- Font Awesome -->
<script src="https://kit.fontawesome.com/f20ebef500.js" crossorigin="anonymous"></script>
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/donate.css" rel="stylesheet" />
<link href="css/home-nav.css" rel="stylesheet" />
<!-- full calendar -->
<link rel="stylesheet" href="fullcalendar/main.css" />
<script src="fullcalendar/main.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
initialView: 'dayGridMonth',
selectable: true,
themeSystem: 'standard',
showNonCurrentDates: false,
contentHeight: 450,
events: [{
title: 'orange donation, 5kg',
start: '2021-10-04',
end: '2021-10-07',
display: 'block',
color: 'red'
}],
dateClick: function (info) {
// alert('Clicked on: ' + info.dateStr);
// alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
// alert('Current view: ' + info.view.type);
// change the day's background color just for fun
info.dayEl.style.backgroundColor = 'red';
}
});
calendar.render();
});
</script>
</head>
<!-- Responsive navbar and header-->
<header>
<nav class="navbar navbar-expand-md navbar-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand px-3 fw-bolder fs-2" href="./index.html" style="color:#7ED7D3">FoodFerry</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse"
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse fs-5 fw-bold px-3" id="navbarCollapse">
<ul class="navbar-nav me-auto mb-2 mb-md-0">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="./dashboard.html">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="donate-details.html">Donate</a>
</li>
<li class="nav-item">
<a class="nav-link" href="history.html">History</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./partners.html">Our Partners</a>
</li>
</ul>
<ul class="navbar-nav mb-2 mb-md-0">
<!-- Notifications-->
<li>
<!-- Notifications button -->
<button id="notifDropdownBtn" class="btn dropdown-toggle navIcon" type="button"
data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-bell-fill fs-4"></i>
</button>
<!-- Notification dropdown -->
<ul class="dropdown-menu" id="notifDropdownList">
<li class="navDropdownListItem border-bottom"><a href="./dashboard.html"
class="navDropdownItem">
<p class="mb-0 mx-3 my-0 text-left">Notification 1</p>
<p class="text-end mx-3 my-0 notifTime"><small>Time</small></p>
</a></li>
<li class="navDropdownListItem border-bottom"><a href="./dashboard.html"
class="navDropdownItem">
<p class="mb-0 mx-3 my-0 text-left">Notification 2</p>
<p class="text-end mx-3 my-0 notifTime"><small>Time</small></p>
</a></li>
<li class="navDropdownListItem border-bottom"><a href="./dashboard.html"
class="navDropdownItem">
<p class="mb-0 mx-3 my-0 text-left">Notification 3</p>
<p class="text-end mx-3 my-0 notifTime"><small>Time</small></p>
</a></li>
<li class="navDropdownListItem border-bottom"><a href="./dashboard.html"
class="navDropdownItem">
<p class="mb-0 mx-3 my-0 text-left">Notification 4</p>
<p class="text-end mx-3 my-0 notifTime"><small>Time</small></p>
</a></li>
<li class="navDropdownListItem border-bottom"><a href="./dashboard.html"
class="navDropdownItem">
<p class="mb-0 mx-3 my-0 text-left">Notification 5</p>
<p class="text-end mx-3 my-0 notifTime"><small>Time</small></p>
</a></li>
<li class="navDropdownListItem border-bottom"><a href="./dashboard.html"
class="navDropdownItem">
<p class="mb-0 mx-3 my-0 text-left">Notification 6</p>
<p class="text-end mx-3 my-0 notifTime"><small>Time</small></p>
</a></li>
<li class="navDropdownListItem border-bottom"><a href="./dashboard.html"
class="navDropdownItem">
<p class="mb-0 mx-3 my-0 text-left">Notification 7</p>
<p class="text-end mx-3 my-0 notifTime"><small>Time</small></p>
</a></li>
<li class="navDropdownListItem border-bottom"><a href="./dashboard.html"
class="navDropdownItem">
<p class="mb-0 mx-3 my-0 text-left">Notification 8</p>
<p class="text-mx-3 my-0 text-end notifTime"><small>Time</small></p>
</a></li>
</ul>
</li>
<!-- User settings -->
<li>
<!-- User button-->
<button id="userDropdownBtn" class="btn dropdown-toggle navIcon" type="button"
data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-person-fill fs-4"></i>
</button>
<!-- User dropdown -->
<ul class="dropdown-menu" id="userDropdownList">
<li class="navDropdownListItem"><a href="./profile.html" class="navDropdownItem">
User Profile</a></li>
<li class="navDropdownListItem"><a href="./settings.html" class="navDropdownItem">
Settings</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li class="navDropdownListItem"><a href="./index.html" class="navDropdownItem">
Log Out</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</header>
<body>
<div class="container-md mt-5">
<div class="row ">
<!-- Form page 1 food category selection -->
<div class="col-sm-12 text-center p-0 mt-3 mb-2">
<div class="card px-0 pt-4 pb-0 my-3">
<!-- Form Title [remain constant] -->
<h2 class="mb-4 fs-1"><strong>Donate Food Waste</strong></h2>
<div class="row">
<div class="col-md-12">
<form class="needs-validation" id="pickUpForm" novalidate>
<!-- Progress Bar -->
<ul id="progressbar" class='p-0'>
<li class="active" id="food-details">
<strong>Donation Details</strong>
</li>
<li class="active" id="pick-up">
<strong>Pick Up</strong>
</li>
<li class="active" id="type">
<strong>Donation Type</strong>
</li>
<li class="active" id="availability">
<strong>Availability</strong>
</li>
<li id="confirmation">
<strong>Confirmation</strong>
</li>
</ul>
<!-- Pick Up Availability -->
<fieldset class="step step3">
<div class="row mx-2 mb-3 justify-content-center">
<div class="col-lg-5">
<div class="card mb-3">
<h1 class="card-header fs-3">
<strong>Availability Form</strong>
</h1>
<div class="card-body">
<form class="needs validate" novalidate>
<div class="row row-cols-2">
<div class="col-12 text-start mb-2">
<h6>Availability Type</h6>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio"
name="availOptions" id="singledate"
value="sd" checked>
<label class="form-check-label"
for="singledate">Single Day</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio"
name="availOptions" id="multidate"
value="ad">
<label class="form-check-label"
for="multidate">Multiple Days</label>
</div>
<!-- old select dropdown -->
<!-- <div class="form-floating mb-3 d-none">
<select class="form-select" id="availabilityType"
aria-label="Account Type">
<option value="" selected disabled>Choose
</option>
<option value="ad">Multiple days</option>
<option value="sd">Specific day</option>
</select>
<label for="accountType">Availability</label>
</div> -->
</div>
<div id="date-from" class="col-lg-6 d-none">
<div class="form-floating mb-3">
<input class="form-control" id="pickUpDateFrom"
type="date" placeholder="dd/mm/yyyy"
data-date-format="dd-mm-yyyy" required />
<label for="pickUpDateFrom">Pick Up Date To </label>
<div class="invalid-feedback">
Pick up date is required.
</div>
</div>
</div>
<div id="date-to" class="col-lg-6 d-none">
<div class="form-floating mb-3">
<input class="form-control" id="pickUpDateTo"
type="date" placeholder="dd/mm/yyyy"
data-date-format="dd-mm-yyyy" required />
<label for="pickUpDateTo">Pick Up Date To </label>
<div class="invalid-feedback">
Pick up date is required.
</div>
</div>
</div>
<div id="date-specific" class="col-12">
<div class="form-floating mb-3">
<input class="form-control" id="pickUpDate"
type="date" placeholder="dd/mm/yyyy"
data-date-format="dd-mm-yyyy" required />
<label for="pickUpDate">Pick Up Date </label>
<div class="invalid-feedback">
Pick up date is required.
</div>
</div>
</div>
<div id="av-time-from" class="col-6">
<div class="form-floating mb-3">
<input class="form-control" id="pickUpTimeFrom"
type="time" placeholder="Date" required />
<label for="pickUpTimeFrom">Available Time
from</label>
<div class="invalid-feedback">
Time is required.
</div>
</div>
</div>
<div id="av-time-to" class="col-6">
<div class="form-floating mb-3">
<input class="form-control" id="pickUpTimeTo"
type="time" placeholder="Date" required />
<label for="pickUpTimeTo">Available Time To</label>
<div class="invalid-feedback">
Time is required.
</div>
</div>
</div>
<div id="remarks" class="col-12">
<div class="form-floating mb-3">
<textarea class="form-control" id="remark"
type="text"
placeholder="Enter your message here..."
style="height: 10rem"
data-sb-validations="required"></textarea>
<label for="remark">Remarks (optional)</label>
<div class="invalid-feedback">A message is required.
</div>
</div>
</div>
<div class="col-12 d-grid">
<button id='add-availability'
class="btn btn-success">Add
Availability</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="col-lg-7">
<div class="card mb-3">
<h1 class="card-header fs-3">
<strong>Calendar Overview</strong><span class="mx-2 fs-6">
<i class="bi bi-info-circle-fill text-primary"
data-bs-toggle="tooltip" data-bs-placement="top"
title="Calendar overview shows your current schedule and availability based on your listing activities"></i></span>
</h1>
<div class="card-body">
<div id='calendar'>
</div>
</div>
</div>
</div>
</div>
<!-- buttons -->
<div class="row mx-2 mb-4 justify-content-center">
<div class="col-lg-6 col-sm-12 d-grid mb-2">
<button onclick="prevBtn()" type="button"
class="btn btn-light btn-lg prev-btn border-success">
Previous
</button>
</div>
<div class="col-lg-6 col-sm-12 d-grid mb-2">
<button type="submit" class="btn btn-success btn-lg next-btn"
id="submitBtn">
Next
</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<!-- loop 11 -->
<script src="//cdn.loop11.com/embed.js" type="text/javascript" async="async"></script>
<!-- Bootstrap and Propper core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous">
</script>
<!-- Popovers and core theme [MUST INCLUDE FOR POPOVERS/TOOLTIPS] -->
<script src="js/scripts.js"></script>
</body>
<script>
//get contact details from session
console.log(sessionStorage.getItem('pickUpDetails'));
//Previous button
function prevBtn() {
window.location.href = "donate-type.html"
}
function nextBtn() {
window.location.href = "donate-type.html"
}
var availRadio = document.getElementsByName("availOptions");
console.log(availRadio);
// check availability type
for (i in availRadio){
availRadio[i].onclick = function() {
if (this.value == "ad"){
document.getElementById("date-specific").classList.add("d-none");
document.getElementById("date-from").classList.remove("d-none");
document.getElementById("date-to").classList.remove("d-none");
document.getElementById("av-time-from").classList.remove("d-none");
document.getElementById("av-time-to").classList.remove("d-none");
document.getElementById("remarks").classList.remove("d-none");
document.getElementById("add-availability").classList.remove("disabled");
} else if (this.value == "sd") {
document.getElementById("date-from").classList.add("d-none");
document.getElementById("date-to").classList.add("d-none");
document.getElementById("date-specific").classList.remove("d-none");
document.getElementById("av-time-from").classList.remove("d-none");
document.getElementById("av-time-to").classList.remove("d-none");
document.getElementById("remarks").classList.remove("d-none");
document.getElementById("add-availability").classList.remove("disabled");
}
}
}
// old method on version A
// document.getElementById("availabilityType").addEventListener('change', function (e) {
// console.log(this.value);
// if (this.value == "ad") {
// document.getElementById("date-specific").classList.add("d-none");
// document.getElementById("date-from").classList.remove("d-none");
// document.getElementById("date-to").classList.remove("d-none");
// document.getElementById("av-time-from").classList.remove("d-none");
// document.getElementById("av-time-to").classList.remove("d-none");
// document.getElementById("remarks").classList.remove("d-none");
// document.getElementById("add-availability").classList.remove("disabled");
// } else if (this.value == "sd") {
// document.getElementById("date-from").classList.add("d-none");
// document.getElementById("date-to").classList.add("d-none");
// document.getElementById("date-specific").classList.remove("d-none");
// document.getElementById("av-time-from").classList.remove("d-none");
// document.getElementById("av-time-to").classList.remove("d-none");
// document.getElementById("remarks").classList.remove("d-none");
// document.getElementById("add-availability").classList.remove("disabled");
// }
// })
</script>
</body>
</html>