dkforest

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

commit 4ec1a9b960b4a9b974e436cd786d1d4b43c41d96
parent f86a7833414091e74b560cd7ce9e72371ba55876
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat, 17 Jun 2023 14:57:30 -0700

improve analyze link

Diffstat:
Mpkg/web/handlers/chess.go | 7++++++-
Mpkg/web/handlers/interceptors/chess.go | 2+-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pkg/web/handlers/chess.go b/pkg/web/handlers/chess.go @@ -645,7 +645,12 @@ Loop: if game.Outcome() != chess.NoOutcome && !gameLoadedOver { send(`<style>#outcome:after { content: "` + game.Outcome().String() + `" }</style>`) send(`<style>.gameover { display: none !important; }</style>`) - send(`<textarea readonly style="position: absolute; width: 200px; left: calc(50% - 100px); bottom: 20px">` + game.String() + `</textarea>`) + send(`<div style="position: absolute; width: 200px; left: calc(50% - 100px); bottom: 20px">`) + send(`<textarea readonly>` + game.String() + `</textarea>`) + if authUser.CanUseChessAnalyze { + send(`<a style="color: #eee;" href="/chess/` + key + `/analyze">Analyse</a>`) + } + send(`</div>`) break } diff --git a/pkg/web/handlers/interceptors/chess.go b/pkg/web/handlers/interceptors/chess.go @@ -486,7 +486,7 @@ func (g *ChessGame) drawPlayerCard(moveIdx int, key string, isBlack, isSpectator <td colspan="2"> <div style="color: #eee; display: inline-block;">Outcome: <span id="outcome"></span></div> {{ if and .GameOver .CanUseChessAnalyze }} - <a style="color: #eee;" href="/chess/{{ .Key }}/analyze">Analyze</a> + <a style="color: #eee; margin-left: 20px;" href="/chess/{{ .Key }}/analyze">Analyze</a> {{ end }} </td> </tr>