all repos — honk @ a55103472e02c2128453b618dc97014ad9f195ba

my fork of honk

display actual reaction for the button label
Ted Unangst tedu@tedunangst.com
Sun, 19 Apr 2020 20:10:40 -0400
commit

a55103472e02c2128453b618dc97014ad9f195ba

parent

b5243c281762e2ef53be439b7089c6a21528cde7

3 files changed, 6 insertions(+), 2 deletions(-)

jump to
M views/honk.htmlviews/honk.html

@@ -121,10 +121,12 @@ {{ else }}

<button onclick="return flogit(this, 'untag', '{{ .Honk.XID }}');">untag me</button> {{ end }} <button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button> +{{ if not (eq .Badonk "none") }} {{ if .Honk.IsReacted }} <button disabled>badonked</button> {{ else }} -<button onclick="return flogit(this, 'react', '{{ .Honk.XID }}');">badonk</button> +<button onclick="return flogit(this, 'react', '{{ .Honk.XID }}');">{{ .Badonk }}</button> +{{ end }} {{ end }} </div> </details>
M views/honkpage.htmlviews/honkpage.html

@@ -34,8 +34,9 @@ <div>

{{ $BonkCSRF := .HonkCSRF }} {{ $IsPreview := .IsPreview }} {{ $MapLink := .MapLink }} +{{ $Badonk := .User.Options.Reaction }} {{ range .Honks }} -{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview }} +{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview "Badonk" $Badonk }} {{ end }} </div> </div>
M web.goweb.go

@@ -1092,6 +1092,7 @@ func honkpage(w http.ResponseWriter, u *login.UserInfo, honks []*Honk, templinfo map[string]interface{}) {

var userid int64 = -1 if u != nil { userid = u.UserID + templinfo["User"], _ = butwhatabout(u.Username) } reverbolate(userid, honks) templinfo["Honks"] = honks