Show HMS banner
This commit is contained in:
parent
b5dac2f4d8
commit
968e859dde
|
@ -11,25 +11,37 @@ import (
|
||||||
"git.handmade.network/hmn/hmn/src/utils"
|
"git.handmade.network/hmn/hmn/src/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Event struct {
|
||||||
|
StartTime, EndTime time.Time
|
||||||
|
}
|
||||||
|
|
||||||
type Jam struct {
|
type Jam struct {
|
||||||
Name string
|
Event
|
||||||
Slug string
|
Name string
|
||||||
StartTime time.Time
|
Slug string
|
||||||
EndTime time.Time
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var WRJ2021 = Jam{
|
var WRJ2021 = Jam{
|
||||||
Name: "Wheel Reinvention Jam 2021",
|
Event: Event{
|
||||||
Slug: "WRJ2021",
|
StartTime: time.Date(2021, 9, 27, 0, 0, 0, 0, time.UTC),
|
||||||
StartTime: time.Date(2021, 9, 27, 0, 0, 0, 0, time.UTC),
|
EndTime: time.Date(2021, 10, 4, 0, 0, 0, 0, time.UTC),
|
||||||
EndTime: time.Date(2021, 10, 4, 0, 0, 0, 0, time.UTC),
|
},
|
||||||
|
Name: "Wheel Reinvention Jam 2021",
|
||||||
|
Slug: "WRJ2021",
|
||||||
}
|
}
|
||||||
|
|
||||||
var WRJ2022 = Jam{
|
var WRJ2022 = Jam{
|
||||||
Name: "Wheel Reinvention Jam 2022",
|
Event: Event{
|
||||||
Slug: "WRJ2022",
|
StartTime: time.Date(2022, 8, 15, 0, 0, 0, 0, utils.Must1(time.LoadLocation("America/Los_Angeles"))),
|
||||||
StartTime: time.Date(2022, 8, 15, 0, 0, 0, 0, utils.Must1(time.LoadLocation("America/Los_Angeles"))),
|
EndTime: time.Date(2022, 8, 22, 8, 0, 0, 0, utils.Must1(time.LoadLocation("America/Los_Angeles"))),
|
||||||
EndTime: time.Date(2022, 8, 22, 8, 0, 0, 0, utils.Must1(time.LoadLocation("America/Los_Angeles"))),
|
},
|
||||||
|
Name: "Wheel Reinvention Jam 2022",
|
||||||
|
Slug: "WRJ2022",
|
||||||
|
}
|
||||||
|
|
||||||
|
var HMS2022 = Event{
|
||||||
|
StartTime: time.Date(2022, 11, 16, 0, 0, 0, 0, time.UTC),
|
||||||
|
EndTime: time.Date(2022, 11, 18, 0, 0, 0, 0, time.UTC),
|
||||||
}
|
}
|
||||||
|
|
||||||
var AllJams = []Jam{WRJ2021, WRJ2022}
|
var AllJams = []Jam{WRJ2021, WRJ2022}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "content" }}
|
{{ define "content" }}
|
||||||
{{/*
|
|
||||||
<div class="mb3 ph3 ph0-ns">
|
<div class="mb3 ph3 ph0-ns">
|
||||||
<style>
|
<style>
|
||||||
#hms-banner {
|
#hms-banner {
|
||||||
|
@ -91,17 +90,25 @@
|
||||||
<a id="hms-banner" class="pv3 ph3 ph4-l br3 flex flex-column flex-row-ns items-center" href="https://handmade-seattle.com/" target="_blank">
|
<a id="hms-banner" class="pv3 ph3 ph4-l br3 flex flex-column flex-row-ns items-center" href="https://handmade-seattle.com/" target="_blank">
|
||||||
<div id="hms-title-container" class="flex flex-column pl3-m pl4-l pv3 pv0-ns z-1">
|
<div id="hms-title-container" class="flex flex-column pl3-m pl4-l pv3 pv0-ns z-1">
|
||||||
<h3 id="hms-title">Handmade Seattle</h3>
|
<h3 id="hms-title">Handmade Seattle</h3>
|
||||||
<div id="hms-details">November 11 - 12. In person and online.</div>
|
<div id="hms-details">November 16 - 18. In person and online.</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-grow-1"></div>
|
<div class="flex-grow-1"></div>
|
||||||
<div id="hms-learn-more" class="z-1">
|
<div id="hms-learn-more" class="z-1">
|
||||||
Catch up
|
{{ if gt .HMSDaysUntilEnd 0 }}
|
||||||
|
{{ if eq .HMSDaysUntilStart 0 }}
|
||||||
|
Watch live
|
||||||
|
{{ else }}
|
||||||
|
Get tickets
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
Catch up
|
||||||
|
{{ end }}
|
||||||
<div class="dib svgicon">{{ svg "chevron-right" }}</div>
|
<div class="dib svgicon">{{ svg "chevron-right" }}</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
*/}}
|
|
||||||
|
|
||||||
|
{{/*
|
||||||
<div class="mb3 ph3 ph0-ns">
|
<div class="mb3 ph3 ph0-ns">
|
||||||
<style>
|
<style>
|
||||||
#jam-banner {
|
#jam-banner {
|
||||||
|
@ -168,6 +175,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{ if not .User }}
|
{{ if not .User }}
|
||||||
<div class="mb3 ph3 ph0-ns">
|
<div class="mb3 ph3 ph0-ns">
|
||||||
|
|
|
@ -31,6 +31,8 @@ type LandingTemplateData struct {
|
||||||
|
|
||||||
JamUrl string
|
JamUrl string
|
||||||
JamDaysUntilStart, JamDaysUntilEnd int
|
JamDaysUntilStart, JamDaysUntilEnd int
|
||||||
|
|
||||||
|
HMSDaysUntilStart, HMSDaysUntilEnd int
|
||||||
}
|
}
|
||||||
|
|
||||||
func Index(c *RequestContext) ResponseData {
|
func Index(c *RequestContext) ResponseData {
|
||||||
|
@ -153,6 +155,9 @@ func Index(c *RequestContext) ResponseData {
|
||||||
JamUrl: hmnurl.BuildJamIndex(),
|
JamUrl: hmnurl.BuildJamIndex(),
|
||||||
JamDaysUntilStart: daysUntil(hmndata.WRJ2022.StartTime),
|
JamDaysUntilStart: daysUntil(hmndata.WRJ2022.StartTime),
|
||||||
JamDaysUntilEnd: daysUntil(hmndata.WRJ2022.EndTime),
|
JamDaysUntilEnd: daysUntil(hmndata.WRJ2022.EndTime),
|
||||||
|
|
||||||
|
HMSDaysUntilStart: daysUntil(hmndata.HMS2022.StartTime),
|
||||||
|
HMSDaysUntilEnd: daysUntil(hmndata.HMS2022.EndTime),
|
||||||
}, c.Perf)
|
}, c.Perf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to render landing page template"))
|
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to render landing page template"))
|
||||||
|
|
Loading…
Reference in New Issue