Skip to content

Commit

Permalink
add hints for keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Mar 9, 2024
1 parent 3c06627 commit 5bec8f9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions syzygy_tables_info/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def spare(color: ColorName) -> Frag:
spare("white"),
h("div", id="board-toolbar", role="toolbar")(
h("div", klass="btn-group")(
h("button", id="btn-flip-board", klass="btn btn-default", title="Flip board")(
h("button", id="btn-flip-board", klass="btn btn-default", title="Flip board (f)")(
h("span", klass="icon icon-rotate")(),
),
),
Expand Down Expand Up @@ -165,8 +165,13 @@ def spare(color: ColorName) -> Frag:


def xhr_probe(render: Render) -> Frag:
first_move = True

def move(m: RenderMove) -> Frag:
return h("a", klass="li", href=fen_url(m["fen"]), data_uci=m["uci"])(
nonlocal first_move
title = "Play best move (space)" if first_move else None
first_move = False
return h("a", klass="li", href=fen_url(m["fen"]), data_uci=m["uci"], title=title)(
m["san"],
" ",
h("span", klass="badge")(f"DTM {m['dtm']}") if m["dtm"] else None,
Expand Down

0 comments on commit 5bec8f9

Please sign in to comment.