also submit emoji url

This commit is contained in:
fungal 2023-12-18 12:56:51 +01:00
parent a9048f05bc
commit 3c029c9563
2 changed files with 11 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import (
type EmojiDetails struct {
Label string
Url string
}
//go:embed templates
@ -24,9 +25,11 @@ func handleForm(w http.ResponseWriter, r *http.Request) {
details := EmojiDetails{
Label: r.FormValue("label"),
Url: r.FormValue("url"),
}
log.Print(details.Label)
log.Print(details.Url)
tmpl.Execute(w, struct{ Success bool }{true})
}

View File

@ -20,10 +20,14 @@
{{end}}
<h1>Request An Emoji</h1>
<form method="POST">
<span>
<label for="emojiLabel">Emoji label</label>
<input type="text" id="emojiLabel" name="label" placeholder="blobcatNotLikeThis">
</span>
<div>
<label for="label">Emoji label</label>
<input type="text" id="label" name="label" placeholder="blobcatNotLikeThis">
</div>
<div>
<label for="url">Emoji URL</label>
<input type="text" id="url" name="url" placeholder="https://...">
</div>
<input type="submit">
</form>
</body>