From fef153df51fe60a5af4c5b2a05e0b1177187bf62 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Sun, 5 Apr 2020 14:37:04 +0200 Subject: [PATCH] Fix game download & upload for multi-moves variants --- client/src/components/BaseGame.vue | 6 +-- client/src/components/MoveList.vue | 4 +- client/src/components/UploadGame.vue | 59 +++++++++++++++++----------- client/src/views/MyGames.vue | 2 + 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index 1e1a2149..7156670c 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -277,10 +277,10 @@ export default { pgn += '[Black "' + this.game.players[1].name + '"]\n'; pgn += '[Fen "' + this.game.fenStart + '"]\n'; pgn += '[Result "' + this.game.score + '"]\n'; - if (!!this.game.id) { - pgn += '[Cadence "' + this.game.cadence + '"]\n'; + if (!!this.game.id) pgn += '[Url "' + params.serverUrl + '/game/' + this.game.id + '"]\n'; - } + if (!!this.game.cadence) + pgn += '[Cadence "' + this.game.cadence + '"]\n'; pgn += '\n'; for (let i = 0; i < this.moves.length; i += 2) { if (i > 0) pgn += " "; diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index a9fa9834..6c999755 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -45,7 +45,7 @@ div span.score-msg {{ st.tr[message] }} .moves-list(v-if="!['none','highlight'].includes(show)") .tr(v-for="moveIdx in evenNumbers") - .td {{ firstNum + moveIdx / 2 + 1 }} + .td {{ firstNum + moveIdx / 2 }} .td(v-if="moveIdx < moves.length-1 || show == 'all'" :class="{'highlight-lm': cursor == moveIdx}" @click="() => gotoMove(moveIdx)" @@ -56,7 +56,7 @@ div :class="{'highlight-lm': highlightBlackmove(moveIdx+1)}" @click="() => gotoMove(moveIdx+1)" ) - | {{ notation(moves[moveIdx+1]) }} + | {{ notation(moves[moveIdx + 1]) }}