Skip to content

Commit

Permalink
bugfix when there is no next race.
Browse files Browse the repository at this point in the history
  • Loading branch information
AhoyLemon committed Nov 29, 2023
1 parent 0a88c24 commit c6e491f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link href="css/site.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Stay on track anywhere you go with with The Next F1 Race, the ultimate destination for the Formula 1 racing schedule. It's the prettiest race schedule on the internet.">
<meta http-equiv="last-modified" content="2023-03-17@09:45:02">
<meta http-equiv="last-modified" content="2023-10-29@13:23:54">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
Expand Down Expand Up @@ -39,7 +39,8 @@
<header class="site-header">
<div class="inner">
<h1>The Next F1 Race</h1>
<div class="when"><span>is in </span><a class="next-race" @click="scrollTo(computedNextRace.raceNumber)">{{computedNextRace.raceTitle}}</a>
<div class="when" v-if="!computedNextRace.raceNumber"><span>will be in 2024. Check back then.</span></div>
<div class="when" v-else><span>is in </span><a class="next-race" @click="scrollTo(computedNextRace.raceNumber)">{{computedNextRace.raceTitle}}</a>
<template v-if="computedNextRace.daysUntil &gt; 1"><span>in </span><strong v-text="computedNextRace.daysUntil"></strong><span> days.</span></template>
<template v-else><span>this weekend.</span></template>
</div>
Expand Down Expand Up @@ -115,7 +116,7 @@ <h2 class="title" :letters="race.title.length" :start-width="getTitleWidths(race
<script src="js/libraries/moment.min.js"></script>
<script src="js/libraries/jquery.min.js"></script>
<script src="js/libraries/scrollmagic.min.js"></script>
<script src="js/min/site.min.js?updated2023-03-17@09:45:02"></script>
<script src="js/min/site.min.js?updated2023-10-29@13:23:54"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PDH43TV090"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion js/min/site.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/min/site.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions js/partials/_vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ var app = new Vue({
daysUntil = moment(race.startDate).diff(moment(),'days');
}
});
if (!raceTitle) {
return {
today: today,
raceNumber: null,
raceTitle:null,
daysUntil: null
}
}

return {
today: today,
Expand Down
5 changes: 3 additions & 2 deletions prepros.config
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"autoUpload": false,
"reuseConnection": true,
"connectionType": "ftp",
"exportHistory": true,
"history": []
},
"packages": {
Expand Down Expand Up @@ -854,12 +855,12 @@
"sourceMap": false,
"tasks": [
{
"task": "typescript",
"task": "copy",
"enable": true
},
{
"task": "babel",
"enable": false
"enable": true
},
{
"task": "bundle-js",
Expand Down
6 changes: 5 additions & 1 deletion pug/sections/_header.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
header.site-header
.inner
h1= siteTitle
.when

.when(v-if="!computedNextRace.raceNumber")
span will be in 2024. Check back then.

.when(v-else)
span is in
a.next-race(@click="scrollTo(computedNextRace.raceNumber)") {{computedNextRace.raceTitle}}
template(v-if="computedNextRace.daysUntil > 1")
Expand Down

0 comments on commit c6e491f

Please sign in to comment.