offer a selection of possible reactions

This commit is contained in:
Ted Unangst 2020-01-23 23:34:38 -05:00
parent b7e7576f4e
commit f18df7fcea
2 changed files with 13 additions and 0 deletions

View File

@ -14,9 +14,21 @@
<input tabindex=1 type="checkbox" id="omitimages" name="omitimages" value="omitimages" {{ if .User.Options.OmitImages }}checked{{ end }}><span></span> <input tabindex=1 type="checkbox" id="omitimages" name="omitimages" value="omitimages" {{ if .User.Options.OmitImages }}checked{{ end }}><span></span>
<p><label class="button" for="maps">apple map links:</label> <p><label class="button" for="maps">apple map links:</label>
<input tabindex=1 type="checkbox" id="maps" name="maps" value="apple" {{ if eq "apple" .User.Options.MapLink }}checked{{ end }}><span></span> <input tabindex=1 type="checkbox" id="maps" name="maps" value="apple" {{ if eq "apple" .User.Options.MapLink }}checked{{ end }}><span></span>
<p><label class="button" for="reaction">reaction:</label>
<select tabindex=1 name="reaction">
<option {{ and (eq .User.Options.Reaction "😞") "selected" }}>😞</option>
<option {{ and (eq .User.Options.Reaction "\U0001F937") "selected" }}>{{ "\U0001F937" }}</option>
<option {{ and (eq .User.Options.Reaction "🙈") "selected" }}>🙈</option>
<option {{ and (eq .User.Options.Reaction "🍆") "selected" }}>🍆</option>
<option {{ and (eq .User.Options.Reaction "\U0001F32E") "selected" }}>{{ "\U0001F32E" }}</option>
<option {{ and (eq .User.Options.Reaction "🗿") "selected" }}>🗿</option>
<option {{ and (eq .User.Options.Reaction "\U0001FA93") "selected" }}>{{ "\U0001FA93" }}</option>
<option {{ and (eq .User.Options.Reaction "\U0001F9BE") "selected" }}>{{ "\U0001F9BE" }}</option>
</select>
<p><button>update settings</button> <p><button>update settings</button>
</form> </form>
</div> </div>
<hr>
<div> <div>
<form action="/chpass" method="POST"> <form action="/chpass" method="POST">
<input type="hidden" name="CSRF" value="{{ .LogoutCSRF }}"> <input type="hidden" name="CSRF" value="{{ .LogoutCSRF }}">

1
web.go
View File

@ -1132,6 +1132,7 @@ func saveuser(w http.ResponseWriter, r *http.Request) {
} else { } else {
options.MapLink = "" options.MapLink = ""
} }
options.Reaction = r.FormValue("reaction")
if ava := re_avatar.FindString(whatabout); ava != "" { if ava := re_avatar.FindString(whatabout); ava != "" {
whatabout = re_avatar.ReplaceAllString(whatabout, "") whatabout = re_avatar.ReplaceAllString(whatabout, "")
ava = ava[7:] ava = ava[7:]