Skip to content

Commit 58b083c

Browse files
committed
Ticket editing and thank you page
1 parent 2f9553b commit 58b083c

13 files changed

Lines changed: 234 additions & 44 deletions

src/hmnurl/urls.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func BuildExpo(urlSlug string, status string) string {
130130
return Url(fmt.Sprintf("/expo/%s", urlSlug), q)
131131
}
132132

133-
var RegexExpoTicketPurchaseSuccess = regexp.MustCompile("^/expo/(?P<urlslug>[^/]+)$")
133+
var RegexExpoTicketPurchaseSuccess = regexp.MustCompile("^/expo/(?P<urlslug>[^/]+)/success$")
134134

135135
func BuildExpoTicketPurchaseSuccess(urlSlug string) string {
136136
defer CatchPanic()
@@ -172,6 +172,13 @@ func BuildTicketQRCode(id string) string {
172172
return Url(fmt.Sprintf("/tickets/%s.png", id), nil)
173173
}
174174

175+
var RegexTicketEdit = regexp.MustCompile("^/tickets/(?P<id>[^/]+)/edit$")
176+
177+
func BuildTicketEdit(id string) string {
178+
defer CatchPanic()
179+
return Url(fmt.Sprintf("/tickets/%s/edit", id), nil)
180+
}
181+
175182
var RegexTicketScanned = regexp.MustCompile("^/tickets/(?P<id>[^/]+)/scanned$")
176183

177184
func BuildTicketScanned(id string) string {

src/templates/mapping.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,14 @@ func JamToBannerEvent(jam hmndata.Jam) BannerEvent {
539539
}
540540
}
541541

542+
func TicketToTemplate(t *models.Ticket) Ticket {
543+
return Ticket{
544+
ID: t.ID.String(),
545+
OwnerName: t.OwnerName,
546+
OwnerEmail: t.OwnerEmail,
547+
}
548+
}
549+
542550
func maybeString(s *string) string {
543551
if s == nil {
544552
return ""

src/templates/src/email_ticket_purchase.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<li><b>Name:</b> {{ .Name }}</li>
99
<li><b>Email:</b> {{ .Email }}</li>
1010
</ul>
11+
<p>Stay tuned for more information as the event approaches.</p>
1112

1213
<img src="{{ .CodeURL }}">
1314

src/templates/src/expo_2026_index.html

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
{{ define "extrahead" }}
44
<style>
5-
#cover {
6-
background: linear-gradient(to bottom, #5B0559B8, #04002DB5);
7-
}
8-
9-
#titles {
10-
text-shadow: #30152f 0 0 15px;
11-
}
12-
135
@media screen and (min-width: 35em) {
146
#pizza-bio {
157
max-width: 400px;
@@ -18,27 +10,28 @@
1810
</style>
1911
{{ end }}
2012

21-
{{ define "content" }}
22-
<div class="h6-ns cover bg-center relative flex flex-column" style="background-image: url(/public/expos/skyline-1920.jpg)">
23-
<div id="cover" class="absolute absolute--fill"></div>
24-
<div class="ph3 pv5 flex-grow-1 flex flex-column g3 justify-center items-center relative z-1">
25-
<div id="titles" class="flex flex-column g2 tc">
26-
<h1 class="f2 f1-ns" style="line-height: 1.1">Handmade Network Expo</h1>
27-
<p>One day of demos, brainstorming, and socializing in Vancouver, BC. June 6, 2026.</p>
28-
</div>
29-
<div class="flex g3">
30-
{{ if .ViewTicketUrl }}
31-
<a class="btn btn-primary" href="{{ .ViewTicketUrl }}">View your ticket</a>
32-
{{ else if .ContinuePurchaseUrl }}
33-
<a class="btn btn-primary" href="{{ .ContinuePurchaseUrl }}">Continue your purchase</a>
34-
{{ else if .SoldOut }}
35-
<div class="btn btn-primary disabled">Sold out!</div>
36-
{{ else }}
37-
<a class="btn btn-primary" href="{{ .BuyTicketUrl }}">Get your ticket</a>
38-
{{ end }}
39-
</div>
13+
{{ define "expo-2026-header-content" }}
14+
<div class="ph3 pv5 flex-grow-1 flex flex-column g3 justify-center items-center relative z-1">
15+
<div id="titles" class="flex flex-column g2 tc">
16+
<h1 class="f2 f1-ns" style="line-height: 1.1">Handmade Network Expo</h1>
17+
<p>One day of demos, brainstorming, and socializing in Vancouver, BC. June 6, 2026.</p>
18+
</div>
19+
<div class="flex g3">
20+
{{ if .ViewTicketUrl }}
21+
<a class="btn btn-primary" href="{{ .ViewTicketUrl }}">View your ticket</a>
22+
{{ else if .ContinuePurchaseUrl }}
23+
<a class="btn btn-primary" href="{{ .ContinuePurchaseUrl }}">Continue your purchase</a>
24+
{{ else if .SoldOut }}
25+
<div class="btn btn-primary disabled">Sold out!</div>
26+
{{ else }}
27+
<a class="btn btn-primary" href="{{ .BuyTicketUrl }}">Get your ticket</a>
28+
{{ end }}
4029
</div>
4130
</div>
31+
{{ end }}
32+
33+
{{ define "content" }}
34+
{{ template "expo-2026-header" . }}
4235
<div class="flex justify-center">
4336
<div class="ph3 pv4 w-100 mw-site post-content">
4437
<h3>It's time to meet up again.</h3>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{ template "base-2024.html" . }}
2+
3+
{{ define "expo-2026-header-content" }}
4+
<div class="ph3 pv5 flex-grow-1 flex flex-column g3 justify-center items-center relative z-1">
5+
<div id="titles" class="flex flex-column g3 tc">
6+
<h1 class="f2 f1-ns" style="line-height: 1.1">Thank you!</h1>
7+
<div>Your ticket wil be sent to your email address.</div>
8+
<div class="flex justify-center">
9+
<a class="ph5 btn btn-primary" href="{{ .ExpoURL }}">Back</a>
10+
</div>
11+
</div>
12+
</div>
13+
{{ end }}
14+
15+
{{ define "content" }}
16+
{{ template "expo-2026-header" . }}
17+
{{ end }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{ define "expo-2026-header" }}
2+
<style>
3+
#cover {
4+
background: linear-gradient(to bottom, #5B0559B8, #04002DB5);
5+
}
6+
#titles {
7+
text-shadow: #30152f 0 0 15px;
8+
}
9+
</style>
10+
<div class="h6-ns cover bg-center relative flex flex-column" style="background-image: url(/public/expos/skyline-1920.jpg)">
11+
<div id="cover" class="absolute absolute--fill"></div>
12+
{{ block "expo-2026-header-content" . }}{{ end }}
13+
</div>
14+
{{ end }}

src/templates/src/layouts/email-2026.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157

158158
<!-- Header -->
159159
<tr>
160-
<td class="bg3 pa3 f3 b">
160+
<td class="bg3 pa3 f3 b bb">
161161
Handmade Network
162162
</td>
163163
</tr>
Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
{{ template "base-2024.html" . }}
22

33
{{ define "content" }}
4-
<div class="flex justify-center post-content">
5-
<div class="w-100 mw-site pa3 tc">
6-
<h2>{{ .EventName }}</h2>
7-
<p>{{ .EventDescription }}</p>
8-
<img src="{{ .TicketCodeURL }}">
9-
<p class="c--dim f7 i">Please present this code at the venue.</p>
4+
<div class="flex justify-center">
5+
<div class="w-100 mw-site-narrow pa3">
6+
<div class="flex flex-column flex-row-ns g3">
7+
<div class="flex-shrink-0 flex flex-column g2 items-center">
8+
<img
9+
style="width: 256px"
10+
src="{{ .TicketCodeURL }}"
11+
srcset="{{ .TicketCodeURL }}?scale=2 2x, {{ .TicketCodeURL }}?scale=3 3x"
12+
>
13+
<div class="c--dim f7 i">Please present this code at the venue.</div>
14+
</div>
15+
<div class="post-content">
16+
<h2>{{ .EventName }}</h2>
17+
<p>{{ .EventDescription }}</p>
18+
<p class="b">Ticket details (<a href="{{ .TicketEditURL }}">edit</a>):</p>
19+
<ul>
20+
<li><b>Name:</b> {{ .Ticket.OwnerName }}</li>
21+
<li><b>Email:</b> {{ .Ticket.OwnerEmail }}</li>
22+
</ul>
23+
</div>
24+
</div>
1025
</div>
1126
</div>
1227
{{ end }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{ template "base-2024.html" . }}
2+
3+
{{ define "content" }}
4+
<div class="flex justify-center">
5+
<div class="pv3 ph3 ph0-ns mw-site flex flex-column g3">
6+
<form class="hmn-form" method="POST" action="{{ .SubmitURL }}" autocomplete="off">
7+
{{ csrftoken .Session }}
8+
9+
<div class="fieldset">
10+
<legend>Ticket details</legend>
11+
12+
<div class="pa3 flex flex-column g3">
13+
<div class="input-group">
14+
<label>Your name</label>
15+
<input
16+
required
17+
type="text"
18+
name="name"
19+
value="{{ .Ticket.OwnerName }}"
20+
>
21+
</div>
22+
<div class="input-group">
23+
<label>Email</label>
24+
<input
25+
required
26+
type="email"
27+
name="email"
28+
value="{{ .Ticket.OwnerEmail }}"
29+
>
30+
</div>
31+
<input type="submit" class="btn btn-primary" value="Save">
32+
</div>
33+
</div>
34+
</form>
35+
</div>
36+
</div>
37+
38+
{{ end }}

src/templates/types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,3 +512,9 @@ type CalendarEvent struct {
512512
EndTime time.Time
513513
CalName string
514514
}
515+
516+
type Ticket struct {
517+
ID string
518+
OwnerName string
519+
OwnerEmail string
520+
}

0 commit comments

Comments
 (0)