From 578e9c93511d281e1419e041f90c2829282a86f9 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 19 Apr 2020 20:10:40 -0400 Subject: [PATCH] display actual reaction for the button label --- views/honk.html | 4 +++- views/honkpage.html | 3 ++- web.go | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/views/honk.html b/views/honk.html index 6d84f78..aa3ceae 100644 --- a/views/honk.html +++ b/views/honk.html @@ -121,10 +121,12 @@ in reply to: {{ .RID }} {{ end }} +{{ if not (eq .Badonk "none") }} {{ if .Honk.IsReacted }} {{ else }} - + +{{ end }} {{ end }} diff --git a/views/honkpage.html b/views/honkpage.html index 6823144..6d53c57 100644 --- a/views/honkpage.html +++ b/views/honkpage.html @@ -34,8 +34,9 @@ servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}" {{ $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 }} diff --git a/web.go b/web.go index 567479a..6843941 100644 --- a/web.go +++ b/web.go @@ -1092,6 +1092,7 @@ func honkpage(w http.ResponseWriter, u *login.UserInfo, honks []*Honk, templinfo var userid int64 = -1 if u != nil { userid = u.UserID + templinfo["User"], _ = butwhatabout(u.Username) } reverbolate(userid, honks) templinfo["Honks"] = honks