-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
290 lines (253 loc) · 15.2 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Time Organiser</title>
<link rel="stylesheet" href="css/style.css">
<!-- Bootstrap 5.3.2 CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<body id="body" data-bs-theme="light">
<!-- Navbar -->
<nav class="navbar navbar-expand-lg bg-dark border-bottom" data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand">Time Organiser</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item">
<a href="#" class="nav-link logged-in" data-bs-target="#new-reminder-modal" data-bs-toggle="modal">New</a>
</li>
<!-- <li class="nav-item dropdown">
<button class="nav-link dropdown-toggle logged-in" type="button" data-bs-toggle="dropdown" aria-expanded="false">Edit</button>
<ul class="dropdown-menu">
<li class="dropdown-item">
<a href="#" class="dropdown-item">Edit</a>
</li>
<li class="dropdown-item">
<a href="#" class="dropdown-item">Delete</a>
</li>
</ul>
</li> -->
</ul>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a href="#" class="nav-link logged-in" onclick="calendar_data.previous_week();">Prev Week</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link logged-in" onclick="calendar_data.this_week();">This Week</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link logged-in" onclick="calendar_data.next_week();">Next Week</a>
</li>
</ul>
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a href="#" class="nav-link" onclick="toggle_theme();">Toggle theme</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link active" id="log-in-button" data-bs-target="#log-in-modal" data-bs-toggle="modal">Log in</a>
<a href="#" class="nav-link" id="log-out-button" onclick="logout();">Log out</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Calendar table -->
<div id="calendar">
<table class="table table-bordered table-responsive" id="table">
<thead>
<tr>
<th scope="col" class="centre-table table-data">Monday</th>
<th scope="col" class="centre-table table-data">Tuesday</th>
<th scope="col" class="centre-table table-data">Wednesday</th>
<th scope="col" class="centre-table table-data">Thursday</th>
<th scope="col" class="centre-table table-data">Friday</th>
<th scope="col" class="centre-table table-data">Saturday</th>
<th scope="col" class="centre-table table-data">Sunday</th>
</tr>
</thead>
<tbody>
<tr class="dates">
<td class="centre-table table-data" id="date1"></td>
<td class="centre-table table-data" id="date2"></td>
<td class="centre-table table-data" id="date3"></td>
<td class="centre-table table-data" id="date4"></td>
<td class="centre-table table-data" id="date5"></td>
<td class="centre-table table-data" id="date6"></td>
<td class="centre-table table-data" id="date7"></td>
</tr>
<tr>
<td class="table-data" id="cal1">
</td>
<td class="table-data" id="cal2"></td>
<td class="table-data" id="cal3"></td>
<td class="table-data" id="cal4"></td>
<td class="table-data" id="cal5"></td>
<td class="table-data" id="cal6"></td>
<td class="table-data" id="cal7"></td>
</tr>
<tr class="dates">
<td class="centre-table table-data" id="date8"></td>
<td class="centre-table table-data" id="date9"></td>
<td class="centre-table table-data" id="date10"></td>
<td class="centre-table table-data" id="date11"></td>
<td class="centre-table table-data" id="date12"></td>
<td class="centre-table table-data" id="date13"></td>
<td class="centre-table table-data" id="date14"></td>
</tr>
<tr>
<td class="table-data" id="cal8"></td>
<td class="table-data" id="cal9"></td>
<td class="table-data" id="cal10"></td>
<td class="table-data" id="cal11"></td>
<td class="table-data" id="cal12"></td>
<td class="table-data" id="cal13"></td>
<td class="table-data" id="cal14"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal fade" id="new-reminder-modal" tabindex="-1" aria-labelledby="new-register-modal-label" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="new-register-modal-label">New Reminder</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!-- Reminder needs a description, due date -->
<form class="needs-validation was-validated" novalidate="" id="new-reminder-form">
<div class="form-floating mb-3">
<input type="text" class="form-control" id="new-reminder-title" placeholder="Title" required>
<label for="new-reminder-title">Title</label>
</div>
<div class="form-floating mb-3">
<input type="date" class="form-control" id="new-reminder-due-date" required>
<label for="new-reminder-due-date">Due date</label>
</div>
<!-- Another input using text-area -->
<div class="form-floating mb-3">
<textarea class="form-control" id="new-reminder-description" placeholder="Description" rows="3" maxlength="500" required></textarea>
<label for="new-reminder-notes">Description</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" onclick="newReminder();">Add</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="edit-reminder-modal" tabindex="-1" aria-labelledby="edit-register-modal-label" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="edit-register-modal-label">Edit Reminder</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!-- Reminder needs a description, due date -->
<form class="needs-validation was-validated" novalidate="" id="edit-reminder-form">
<div class="form-floating mb-3">
<input type="text" class="form-control" id="edit-reminder-title" placeholder="Title" required>
<label for="edit-reminder-title">Title</label>
</div>
<div class="form-floating mb-3">
<input type="date" class="form-control" id="edit-reminder-due-date" required>
<label for="edit-reminder-due-date">Due date</label>
</div>
<!-- Another input using text-area -->
<div class="form-floating mb-3">
<textarea class="form-control" id="edit-reminder-description" placeholder="Description" rows="3" maxlength="500" required></textarea>
<label for="edit-reminder-notes">Description</label>
</div>
<input type="hidden" id="edit-reminder-id" value="">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" onclick="editReminderSubmit();">Edit</button>
</div>
</div>
</div>
</div>
<!-- Login form -->
<div class="modal fade" id="log-in-modal" tabindex="-1" aria-labelledby="log-in-modal-label" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="log-in-modal-label">Log In</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!-- Log in form -->
<form class="needs-validation was-validated" novalidate="" id="login-form">
<div class="form-floating mb-3">
<input type="username" class="form-control" id="username" placeholder="Username" required>
<label for="username">Username</label>
<!-- <div class="invalid-feedback">Please enter a username</div> -->
</div>
<div class="form-floating mb-3">
<input type="password" class="form-control" id="password" placeholder="Password" required>
<label for="password">Password</label>
</div>
</form>
Don't have an account? <a href="#" data-bs-target="#register-modal" data-bs-toggle="modal" data-bs-dismiss="modal">Click here</a> to register
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" onclick="login();">Log In</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="register-modal" tabindex="-1" aria-labelledby="register-modal-label" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="register-modal-label">Sign up</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!-- Sign up form -->
<form class="needs-validation was-validated" novalidate="" id="register-form">
<div class="form-floating mb-3">
<input type="name" class="form-control" id="namereg" placeholder="Name" required>
<label for="name">Name</label>
<!-- <div class="invalid-feedback">Please enter a username</div> -->
</div>
<div class="form-floating mb-3">
<input type="username" class="form-control" id="usernamereg" placeholder="Username" required>
<label for="username">Username</label>
<!-- <div class="invalid-feedback">Please enter a username</div> -->
</div>
<div class="form-floating mb-3">
<input type="password" class="form-control" id="passwordreg" placeholder="Password" required>
<label for="password">Password</label>
</div>
<div class="form-floating mb-3">
<input type="password" class="form-control" id="passwordreg2" placeholder="Retype password" required>
<label for="password2">Retype password</label>
</div>
</form>
Already have an account? <a href="#" data-bs-target="#log-in-modal" data-bs-toggle="modal" data-bs-dismiss="modal">Click here</a> to log in
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" onclick="register();">Sign up</button>
</div>
</div>
</div>
</div>
<!-- Log in success notification -->
<div class="alert alert-success d-flex align-items-center" class="alerts" id="log-in-alert" role="alert" onclick="hide_log_in_alert();">Log in successful!</div>
<div class="alert alert-danger d-flex align-items-center" class="alerts" id="log-in-failed-alert" role="alert" onclick="hide_log_in_failed_alert();">Incorrect username or password!</div>
<div class="alert d-flex align-items-center" class="alerts" id="alert" role="alert" onclick="hide_alert();">This is an alert!</div>
<script src="js/script.js"></script>
</body>
</html>