display actual reaction for the button label

Ted Unangst 4 years ago
parent 8d2b2de827
commit e631084a62

@ -121,10 +121,12 @@ in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
<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>

@ -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 }}
</div>
</div>

@ -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

Loading…
Cancel
Save