-
Notifications
You must be signed in to change notification settings - Fork 2
/
page-dawgdash.php
568 lines (351 loc) · 14.7 KB
/
page-dawgdash.php
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
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
<?php
// Jump-in Single-Page Template
wp_enqueue_script('dd23map');
wp_enqueue_style('mapbox331');
get_header();
?>
<!-- Header - ACF field for side image, ACF field for header text content -->
<div class="dawgdash-container">
<?php if(isPostRace()) {?>
<div class="dawgdash-header post-race no-gutters">
<div class="image post-race">
<?php
$headerImage = get_field('header_image');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if( $headerImage ) {
echo wp_get_attachment_image( $headerImage, $size );
}
?>
</div>
<div class="text post-race">
<h1><?php the_field("post_race_header_title") ?></h1>
<p><?php the_field("post_race_header_copy") ?></p>
</div>
</div>
<?php } else {?>
<div class="dawgdash-header no-gutters">
<div class="image">
<?php
$headerImage = get_field('header_image');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if( $headerImage ) {
echo wp_get_attachment_image( $headerImage, $size );
}
function headerText() {
if( isRaceDay() ) {
return get_field("race_day_header_text");
}
return get_field('header_copy');
}
function headerTitle() {
if(isRaceDay()) {
return get_field("race_day_header_title");
}
return get_field('header_title');
}
?>
</div>
<div class="text">
<h1><?php echo html_entity_decode(headerTitle() ) ?></h1>
<p><?php echo html_entity_decode(headerText()) ?></p>
</div>
</div>
<?php } ?>
<?php
if(isPostRace()) {
$regBandText = get_field('post_race_cta_text');
$regBandLink = get_field('post_race_cta_button_text');
$regBandURL = get_field('post_race_cta_button_link');
} else {
$regBandText = (isRaceDay() ? get_field('race_day_cta_text') : get_field('register_bands_text') );
$regBandLink = (isRaceDay() ? get_field('race_day_cta_button_text') : get_field('register_bands_button_text') );
$regBandURL = (isRaceDay() ? get_field('race_day_cta_button_link') : get_field('getmeregistered_link') );
$regBandSubtext = (isRaceDay() ? "<p class=\"subtext\">" . get_field('race_day_cta_subtext') . "</p>" : "");
}
?>
<div class="register-row yellow-background">
<div class="register-row-content">
<div><p><?php echo $regBandText.$regBandSubtext?></div>
</p>
<a href="<?php echo $regBandURL; ?>" class="btn btn-primary btn-lg" tabindex="-1" role="button"><?php echo $regBandLink; ?></a>
</div>
</div>
<?php
$isBeforeTagboardLiveTime = $UWAA->Utilities->isCurrentTimeBefore("09/29/2022 00:00");
function isPreviewForAdminTrue($type){
if(!is_user_logged_in( )){
return false;
}
switch ($type) {
case 'tagboard':
if(get_field("tagboard_display_tagboard_preview")) {
return true;
}
break;
case 'race-day':
if(get_field("race_day_preview")) {
return true;
}
break;
case 'after-race':
break;
case 'post-race':
if(get_field("post_race_preview")) {
return true;
}
break;
default:
return false;
break;
}
}
// God... horrible... DRY
function isRaceDay(){
$date_now = date('Y-m-d H:i:s');
if($date_now > get_field("race_day_cutover_time")) {
return true;
}
if(!is_user_logged_in( )){
return false;
}
if(get_field("race_day_preview")) {
return true;
}
return false;
}
function isPostRace(){
$date_now = date('Y-m-d H:i:s');
$date_now = date('Y-m-d H:i:s');
$date_now = date('Y-m-d H:i:s');
if($date_now > get_field("race_day_race_end_time")) {
return true;
}
if(!is_user_logged_in( )){
return false;
}
if(get_field("post_race_preview")) {
return true;
}
return false;
}
if(!$isBeforeTagboardLiveTime or isPreviewForAdminTrue("tagboard") or get_field("display_tagboard_publically") == true)
{
?>
<!-- Leader of the pack -->
<div class="att-pack-leader-row light-purple-background">
<div class="att-pack-leader-content">
<div class="logo-headline">
<div class="att-logo">
<img src="<?php echo get_stylesheet_directory_uri( );?>/assets/dawgdash23/ATT_Logo.png" alt="AT&T Logo">
</div>
<h2>leaders of the pack</h2>
</div>
<?php $leaderCopy = (isPostRace()) ? "Take a look at the community members who helped us meet our goal in the AT&T #DawgDashCares event! Each person posting represents at least $100 for student scholarships." : "Share your Dawg Dash photo on Instagram or Twitter with #DawgDashCares and AT&T will donate $100 to the UWAA Scholarship Fund. Tag @ATT and your donation doubles!"; ?>
<div class="copy"><p><?php echo $leaderCopy ?></p></div>
</div>
</div>
<div class="tagboard row">
<div class="tagboard-embed" style="background-color: black" tgb-embed-id="7028"></div><script src="https://static.tagboard.com/embed/assets/js/embed.js"></script>
</div>
<?php }?>
<?php if (!isRaceDay()) { ?>
<div class="details-row black-background">
<div class="image">
<?php
$detailsImage = get_field('registration_details_image');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if( $detailsImage ) {
echo wp_get_attachment_image( $detailsImage, $size );
}
?>
</div>
<div class="copy">
<h2><?php html_entity_decode(the_field('registration_details_title') ) ?></h2>
<p><?php html_entity_decode(the_field('registration_details_copy') ) ?></p>
<ul>
<li><div><?php html_entity_decode(the_field('member_title') ) ?></div><div class="price">$<?php html_entity_decode(the_field('member_price') ) ?></div></li>
<li><div><?php html_entity_decode(the_field('general_public_title') ) ?></div><div class="price">$<?php html_entity_decode(the_field('general_public_price') ) ?></div></li>
<li><div><?php html_entity_decode(the_field('student_title') ) ?></div><div class="price">$<?php html_entity_decode(the_field('student_price') ) ?></div></li>
</ul>
</div>
</div>
<div class="membership-special-row light-purple-background">
<div class="subtitle"><?php html_entity_decode(the_field('membership_band_subtitle') ) ?></div>
<div class="price">$<?php html_entity_decode(the_field('member_special_price') ) ?></div>
<div class="copy"><?php html_entity_decode(the_field('membership_band_copy') ) ?></div>
</div>
<?php
if(get_field('registration_items_pups_image')){ ?>
<style type="text/css">
div.registration-item.pups {
background-image: url(<?php the_field('registration_items_pups_image'); ?>) !important;
}
</style>
<?php }?>
<?php
if(get_field('registration_items_dogs_image')){ ?>
<style type="text/css">
div.registration-item.dogs {
background-image: url(<?php the_field('registration_items_dogs_image'); ?>) ,url(<?php echo get_stylesheet_directory_uri( );?>/assets/dawgdash23/2023_Dawg-Dash-Dawgdanna-WSECU_250x38.png) !important;
}
</style>
<?php }?>
<?php
if(get_field('registration_items_virtual_image')){ ?>
<style type="text/css">
div.registration-item.virtual {
background-image: url(<?php the_field('registration_items_virtual_image'); ?>) !important;
}
</style>
<?php }
$regItemCutoverTime = "09/16/2022 23:59";
$columnSize = "col-sm-6";
if ($UWAA->Utilities->isCurrentTimeBefore($regItemCutoverTime)) {
$columnSize = "col-sm-4";
}
?>
<div class="registration-item-row black-background">
<div class="registration-item <?php echo $columnSize; ?> pups">
<h2><?php html_entity_decode(the_field('registration_items_pups_title') ) ?></h2>
<p class="subhead"><?php html_entity_decode(the_field('registration_items_pups_subhead') ) ?></p>
<p class="copy"><?php html_entity_decode(the_field('registration_items_pups_copy') ) ?></p>
<p class="price">$<?php html_entity_decode(the_field('registration_items_pups_price') ) ?></p>
</div>
<div class="registration-item <?php echo $columnSize; ?> dogs">
<h2><?php html_entity_decode(the_field('registration_items_dogs_title') ) ?></h2>
<p class="subhead"><?php html_entity_decode(the_field('registration_items_dogs_subhead') ) ?></p>
<p class="copy"><?php html_entity_decode(the_field('registration_items_dogs_copy') ) ?></p>
<p class="price">$<?php html_entity_decode(the_field('registration_items_dogs_price') ) ?></p>
</div>
<?php if ($UWAA->Utilities->isCurrentTimeBefore($regItemCutoverTime)) { ?>
<div class="registration-item <?php echo $columnSize; ?> virtual">
<h2><?php html_entity_decode(the_field('registration_items_virtual_title') ) ?></h2>
<p class="subhead"><?php html_entity_decode(the_field('registration_items_virtual_subhead') ) ?></p>
<p class="copy"><?php html_entity_decode(the_field('registration_items_virtual_copy') ) ?></p>
<p class="price">$<?php html_entity_decode(the_field('registration_items_virtual_price') ) ?></p>
</div>
<?php } ?>
</div>
<div class="black-background">
<div class="row no-gutters">
<div class="sponsor-block-row">
<div class="bonus-copy">
<div class="subtitle">Members Get More!</div>
<div class="copy">Complete your running look with a UWAA member-exclusive cherry blossom cooling buff.</div>
</div>
<div class="sponsor-block uwaa"></div>
</div>
</div>
</div>
<div class="register-row yellow-background">
<div class="register-row-content">
<p><?php the_field('register_bands_text') ?>
</p>
<a href="<?php echo get_field('getmeregistered_link') ?>" class="btn btn-primary btn-lg" tabindex="-1" role="button"><?php the_field('register_bands_button_text') ?></a>
</div>
</div>
<?php } //end race-day?>
<?php if (isPostRace() ) { ?>
<div class="sponsor-post-race-thanks-row black-background">
<div class="title">thank you to our partners</div>
</div>
<?php } ?>
<div class="black-background">
<div class="row no-gutters">
<div class="sponsor-block-row">
<a href="https://www.alaskaair.com/promo/as2216">
<div class="sponsor-block alaska"></div>
</a>
</div>
<?php if (!isRaceDay() ) { ?>
<div class="sponsor-block-row">
<a href="https://www.brooksrunning.com/en_us/blog/training-workouts/">
<div class="sponsor-block brooks half-size"></div>
</a>
<div class="sponsor-block att half-size"></div>
</div>
<?php } ?>
<?php if (isPostRace() ) { ?>
<div class="sponsor-block-row">
<a href="https://www.att.com/">
<div class="sponsor-block post-race att half-size"></div>
</a>
<a href="https://www.becu.org/">
<div class="sponsor-block post-race becu half-size"></div>
</a>
</div>
<div class="sponsor-block-row">
<a href="https://www.brooksrunning.com/">
<div class="sponsor-block post-race brooks half-size"></div>
</a>
<a href="https://www.ubookstore.com/">
<div class="sponsor-block post-race ubs half-size"></div>
</a>
</div>
<div class="sponsor-block-row">
<a href="https://www.uwmedicine.org/">
<div class="sponsor-block post-race uwmed half-size"></div>
</a>
<a href="https://wsecu.org/">
<div class="sponsor-block post-race wsecu half-size"></div>
</a>
</div>
<?php } ?>
</div>
</div>
<?php if(!isPostRace()) { ?>
<div class="map-container light-purple-background">
<div class="row no-gutters">
<div class="container">
<div class="course-map-title-row light-purple-background">
<div class="title">Course Map</div>
</div>
</div>
<div id='legend' style='display:none;'>
<img style="float: left;width:200px;" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2022/06/30130615/Dawg-Dash-Logo_504x446.png" alt="Alaska Airlines Dawg Dash 2022" />
<h1>COURSE ROUTES</h1>
<nav class='legend clearfix'>
<span style='background:#8d5dda;'> </span>
<strong>5K</strong>
<br />
<span style='background:#ecc813;'> </span><strong>10K</strong>
<br />
</div>
<div id='map'></div>
</div>
</div>
<div class="white-background">
<div class="faq-title-row light-purple-background">
<div class="title">Frequently Asked Questions</div>
</div>
<div class="row no-gutters">
<div class="faq-row white-background">
<div class="faq-content">
<?php the_field('faq') ?>
</div>
</div>
</div>
<?php } //end ifBeforeRaceTime ?>
<div class="white-background">
<div class="banner-row no-gutters">
<div class="banner banner-sm"></div>
<div class="banner banner-lg"></div>
<div class="banner-background"></div>
</div>
</div>
<div class="white-background">
<div class="row no-gutters">
<div class="faq-row white-background">
<div class="register-row-content">
<?php if(!isPostRace()) { ?><p style="text-align: center;"><em>Special thanks to our partners</em></p><?php } ?>
<p style="text-align: center;"><a href="http://alaskaair.com"><img class="aligncenter wp-image-22219" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2022/06/30230420/2023_Dawg-Dash-Partner-Alaska_800x270.png" alt="Alaska Airlines logo" width="204" height="90" /></a></p>
<p style="text-align: center;"><a href="https://uw.edu/alumni"><img class="aligncenter wp-image-XXXXX size-full" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2022/07/07171757/2023_Dawg-Dash-Partner-UWAA_186x70.png" alt="" width="186" height="70" /></a><a href="https://www.att.com/"><img class="aligncenter wp-image-21331 size-full" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2019/08/21115831/Logo_ATT_190x70.gif" alt="logo_01_BECU" width="131" height="48" /></a><a href="https://www.becu.org/everyday-banking/debit-card/uw-card"><img class="aligncenter wp-image-29659 size-full" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2015/06/10172428/Logo_BECU_190x70.gif" alt="" width="190" height="70" /></a></p>
<p style="text-align: center;"><a href="https://www.brooksrunning.com/"><img class="aligncenter wp-image-21340 size-full" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2017/05/10183156/logo_Brooks.jpg" alt="logo_Brooks" width="131" height="48" /></a> <a href="http://www.bookstore.washington.edu/home/home.taf?"><img class="aligncenter wp-image-21328 size-full" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2022/06/30230423/2023_Dawg-Dash-Partner-UBS_186x70-1.png" alt="logo_00_bookstore" width="131" height="48" /></a><a href="https://www.uwmedicine.org/"><img class="aligncenter wp-image-51338" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2022/07/06132640/UWM_ColorLogo.png" alt="" width="160" height="47" /></a><a href="https://wsecu.org/"><img class="aligncenter wp-image-21330 size-full" src="https://uw-s3-cdn.s3.us-west-2.amazonaws.com/wp-content/uploads/sites/94/2017/05/10183203/logo_05_WSECU.png" alt="logo_05_WSECU" width="131" height="48" /></a></p>
</div>
</div>
</div>
</div>
</div>
<!-- /jumpin-container -->
</div>
<?php get_footer(); ?>