dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit d8718b9df56b6a0ce3f0ad0f0d8c9f06bed9f63d
parent eab88545c065a713ba11d87ead7a62e045819aa9
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Wed, 14 Jun 2023 15:53:53 -0700

cleanup

Diffstat:
Mpkg/web/handlers/interceptors/chess.go | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pkg/web/handlers/interceptors/chess.go b/pkg/web/handlers/interceptors/chess.go @@ -449,7 +449,7 @@ func (g *ChessGame) drawPlayerCard(moveIdx int, key string, isBlack, isSpectator <tr> {{ range $idx, $el := .Stats.Scores }} <td title="{{ $idx | fmtMove }} {{ $el.Move }} | Advantage: {{ if not $el.Mate }}{{ $el.CP | cp }}{{ else }}#{{ $el.Mate }}{{ end }}"> - <input type="hidden" value="{{ $el.BestMove }}" /> + {{ $el.BestMove | commentHTML }} <a class="column-wrapper-wrapper" href="/chess/{{ $.Key }}?m={{ $idx | plus }}"> <div class="column-wrapper"> {{ if ge .CP 0 }} @@ -521,6 +521,9 @@ func (g *ChessGame) drawPlayerCard(moveIdx int, key string, isBlack, isSpectator } fns := template.FuncMap{ + "commentHTML": func(s string) template.HTML { + return template.HTML(fmt.Sprintf("<!-- Best move: %s -->", s)) + }, "attr": func(s string) template.HTMLAttr { return template.HTMLAttr(s) },