-
Notifications
You must be signed in to change notification settings - Fork 2
/
player_dashboard.pug
365 lines (330 loc) · 12.8 KB
/
player_dashboard.pug
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
doctype html
head
title= `${title}`
// Import Google Icon Font
link(href='https://fonts.googleapis.com/icon?family=Material+Icons', rel='stylesheet')
// Import materialize.css
link(type='text/css', rel='stylesheet', href='css/materialize.min.css', media='screen,projection')
// Import index.css
link(type='text/css', rel='stylesheet', href='css/index.css')
// Let browser know website is optimized for mobile
meta(name='viewport', content='width=device-width, initial-scale=1.0, viewport-fit=cover')
// Let browser know website use utf-8 coding
meta(http-equiv='content-type', content='text/html; charset=utf-8')
header.header
// My Bookings Dropdown Structure
ul#dropdown_mybookings.dropdown-content
li
a#bookTrainingBtn.modal-trigger(href='#book_training_modal') Book Training
li
a#cancelBookingBtn.modal-trigger(href='#cancel_training_modal') Cancel Booking
// My Bookings Dropdown Structure Mobile
ul#dropdown_mybookings_mobile.dropdown-content
li
a#bookTrainingMobileBtn.modal-trigger(href='#book_training_modal') Book Training
li
a#cancelBookingMobileBtn.modal-trigger(href='#cancel_training_modal') Cancel Booking
// My Data Dropdown Structure
ul#dropdown_mydata.dropdown-content
li
a#updateMyDataBtn.modal-trigger(href='#update_mydata_modal') Update My Data
li
a#changeMyEmailBtn.modal-trigger(href='#change_email_modal') Change Email
li
a#changeMyPasswordBtn.modal-trigger(href='#change_password_modal') Change Password
// My Data Dropdown Structure Mobile
ul#dropdown_mydata_mobile.dropdown-content
li
a#updateMyDataMobileBtn.modal-trigger(href='#update_mydata_modal') Update My Data
li
a#changeMyEmailMobileBtn.modal-trigger(href='#change_email_modal') Change Email
li
a#changeMyPasswordMobileBtn.modal-trigger(href='#change_password_modal') Change Password
// Main Navigation
nav.nav
.nav-wrapper
a.brand-logo#navtext Welcome #{name} #{lastname}
a.sidenav-trigger(href='#', data-target='mobile-sidenav')
i.material-icons menu
ul.right.hide-on-med-and-down
// Dropdown Trigger
li
a.dropdown-trigger(href='#!', data-target='dropdown_mybookings')
| My Bookings Management
i.material-icons.right arrow_drop_down
li
a.dropdown-trigger(href='#!', data-target='dropdown_mydata')
| My Data Management
i.material-icons.right arrow_drop_down
// logout
li
a(href='/logout') Logout
// Mobile Navigation
ul#mobile-sidenav.sidenav
li
a.sidenav-close(href='#')
i.material-icons close
// Dropdown Trigger
li
a.dropdown-trigger(href='#!', data-target='dropdown_mybookings_mobile')
| My Bookings Management
i.material-icons.right arrow_drop_down
li
a.dropdown-trigger(href='#!', data-target='dropdown_mydata_mobile')
| My Data Management
i.material-icons.right arrow_drop_down
// logout
li
a(href='/logout') Logout
main.main
.row
.card
#gradient.card-content
h6#h6 Player Dashboard
.card-tabs
ul.tabs.tabs-fixed-width
li.tab
a.active(href='#trainings') Available Trainings
li.tab
a(href='#bookings') My Bookings
li.tab
a(href='#invoices') My Invoices
li.tab
a(href='#mydata') My Data
.card-content
#trainings
table#playerTrainingTable.highlight.responsive-table
thead
tr
th Check
th Training ID
th Type
th Location
th Date
th Time Start
th Time End
th Price Youth
th Price Adult
tbody
each training in data_availabletrainings
tr
td
p
label
input.checkboxes(type='checkbox')
span
td= training._id
td= training.type
td= training.location
- var dd = (training.date.getDate() < 10 ? '0' : '') +training.date.getDate();
- var mm = ((training.date.getMonth()+1) < 10 ? '0' : '') +(training.date.getMonth()+1)
- var yyyy = training.date.getFullYear()
- var trainingDate = dd +'.' +mm +'.' +yyyy
td= trainingDate
td= training.timestart
td= training.timeend
td= training.priceyouth
td= training.priceadult
#bookings
table#playerBookingTable.highlight.responsive-table
thead
tr
th Check
th Booking ID
th Type
th Location
th Date
th Time Start
th Time End
th Price
th Status
tbody
each booking in data_bookings
tr
td
p
label
input.checkboxes(type='checkbox')
span
td= booking._id
td= booking._booktrainingtype
td= booking._booktraininglocation
- var dd = (booking._booktrainingdate.getDate() < 10 ? '0' : '') +booking._booktrainingdate.getDate();
- var mm = ((booking._booktrainingdate.getMonth()+1) < 10 ? '0' : '') +(booking._booktrainingdate.getMonth()+1)
- var yyyy = booking._booktrainingdate.getFullYear()
- var bookingDate = dd +'.' +mm +'.' +yyyy
td= bookingDate
td= booking._booktrainingtimestart
td= booking._booktrainingtimeend
td= booking._booktrainingprice
td= booking._bookparticipation
#invoices
table.highlight.responsive-table
thead
tr
th Invoice No.
th Date
th Amount
th Paid
th Balance
th Status
tbody
each invoice in data_myinvoices
tr
td= invoice.invoicenumber
- var dd = (invoice.invoicedate.getDate() < 10 ? '0' : '') +invoice.invoicedate.getDate();
- var mm = ((invoice.invoicedate.getMonth()+1) < 10 ? '0' : '') +(invoice.invoicedate.getMonth()+1)
- var yyyy = invoice.invoicedate.getFullYear()
- var invoiceDate = dd +'.' +mm +'.' +yyyy
td= invoiceDate
td= invoice.invoicesum
td= invoice.invoicepaid
td= invoice.invoicebalance
td= invoice.invoicestatus
#mydata
table#playerMyDataTable.highlight.responsive-table
thead
tr
th Name
th Lastname
th Street
th Postal Code
th City
th Email
th Birthdate
th Role
th Age
th Category
th Status
th Balance
tbody
tr
td= data_myuser.name
td= data_myuser.lastname
td= data_myuser.street
td= data_myuser.plz
td= data_myuser.city
td#myDataEmail= data_myuser.email
- var dd = (data_myuser.birthdate.getDate() < 10 ? '0' : '') +data_myuser.birthdate.getDate();
- var mm = ((data_myuser.birthdate.getMonth()+1) < 10 ? '0' : '') +(data_myuser.birthdate.getMonth()+1)
- var yyyy = data_myuser.birthdate.getFullYear()
- var birthDate = dd +'.' +mm +'.' +yyyy
td= birthDate
td= data_myuser.role
- var yearInMs = 3.15576e+10;
- var currentDate = new Date();
- var currentDateInMs = currentDate.getTime();
- var birthDateInMs = data_myuser.birthdate.getTime();
- var age = Math.floor((currentDateInMs - birthDateInMs) / yearInMs).toFixed(0);
td= age
- if (age < 18) {var cat = 'youth'} else {var cat = 'adult'};
td= cat
td= data_myuser._status
td= data_myuser._balance
// class="page-footer"
footer.footer
nav.nav
div#footerdiv
p#footertext VFR Angerlohe Training Booking Tool
// Modal Structure Book Training
#book_training_modal.modal.modal-fixed-footer
.modal-content
h4 Book Training
.row
form#bookTrainingForm.col.s12(method='post', action='/callbooktrainings')
.row
.input-field.col.s8
input#idInputBookTraining.readonly(type='text', name='id', value='null', readonly)
label(for='id') Training ID
.input-field.col.s8
input#locationInputBookTraining.readonly(type='text', name='name', value='null', readonly)
label(for='name') Location Name
.input-field.col.s8
input#dateInputBookTraining.readonly(type='text', name='date', value='null', readonly)
label(for='date') Date
.modal-footer
a.modal-close.waves-effect.waves-green.btn-flat(href='#!') Close
button.btn.waves-effect.waves-light(type='submit', form='bookTrainingForm')
| Submit
i.material-icons.right send
// Modal Structure Cancel Booking
#cancel_training_modal.modal.modal-fixed-footer
.modal-content
h4 Cancel Booking
.row
form#cancelTrainingForm.col.s12(method='post', action='/callcancelbookings')
.row
.input-field.col.s8
input#idInputCancelBooking.readonly(type='text', name='id', value='null', readonly)
label(for='id') Booking ID
.input-field.col.s8
input#locationInputCancelBooking.readonly(type='text', name='name', value='null', readonly)
label(for='name') Location Name
.input-field.col.s8
input#dateInputCancelBooking.readonly(type='text', name='date', value='null', readonly)
label(for='date') Date
.modal-footer
a.modal-close.waves-effect.waves-green.btn-flat(href='#!') Close
button.btn.waves-effect.waves-light(type='submit', form='cancelTrainingForm')
| Submit
i.material-icons.right send
// Modal Structure Update my Data
#update_mydata_modal.modal.modal-fixed-footer
.modal-content
h4 Update my Data
.row
form#updateMyDataForm.col.s12(method='post', action='/callupdatemyuserdata')
.row
.input-field.col.s8
input#emailInputUpdateMyEmail.readonly(type='text', name='email', value='null', readonly)
label(for='email') My Email
.modal-footer
a.modal-close.waves-effect.waves-green.btn-flat(href='#!') Close
button.btn.waves-effect.waves-light(type='submit', form='updateMyDataForm')
| Submit
i.material-icons.right send
// Modal Structure Change Email
#change_email_modal.modal.modal-fixed-footer
.modal-content
h4 Change my Email
.row
form#changeEmailForm.col.s12(method='post', action='/updateuseremail')
.row
.input-field.col.s8
input#emailInputChangeMyEmail.readonly(type='text', name='email', value='null', readonly)
label(for='email') Current Email
.row
.input-field.col.s8
input.validate(type='email', name='newEmail')
label(for='newEmail') New Email
.modal-footer
a.modal-close.waves-effect.waves-green.btn-flat(href='#!') Close
button.btn.waves-effect.waves-light(type='submit', form='changeEmailForm')
| Submit
i.material-icons.right send
// Modal Structure Change Password
#change_password_modal.modal.modal-fixed-footer
.modal-content
h4 Set New User Password
.row
form#changePasswordForm.col.s12(method='post', action='/setnewuserpassword')
.row
.input-field.col.s8
input.validate(type='password', name='currentpassword')
label(for='currentpassword') Current Password
.row
.input-field.col.s8
input.validate(type='password', name='password', minlength='7', required)
label(for='password') New Password
.row
.input-field.col.s8
input.validate(type='password', name='passwordrepeat')
label(for='passwordrepeat') Repeat New Password
.modal-footer
a.modal-close.waves-effect.waves-green.btn-flat(href='#!') Close
button.btn.waves-effect.waves-light(type='submit', form='changePasswordForm')
| Submit
i.material-icons.right send
// JavaScript at end of body for optimized loading
script(type='text/javascript', src='js/materialize.min.js')
script(type='text/javascript', src='js/auth_player.js')