X-Git-Url: https://git.auder.net/assets/current/git-favicon.png?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FGameList.vue;h=a83eb85a4daa24b868916fb17df20289602e1242;hb=a68362420a3a92099dfaacea10f6cbd579161183;hp=bf9c8ffc3125169b31436479c6139795703cef71;hpb=41cb9b940084d6f56351a772f0340ebf0bc8d1bc;p=vchess.git
diff --git a/client/src/components/GameList.vue b/client/src/components/GameList.vue
index bf9c8ffc..a83eb85a 100644
--- a/client/src/components/GameList.vue
+++ b/client/src/components/GameList.vue
@@ -1,28 +1,179 @@
-table
- tr
- th Variant
- th White
- th Black
- th Time control
- th(v-if="showResult") Result
- // TODO: show my games first (st.user.id or sid)
- tr(v-for="g in games" @click="$emit('show-game',g)")
- td {{ g.vname }}
- td {{ g.players[0].name || "@nonymous" }}
- td {{ g.players[1].name || "@nonymous" }}
- td {{ g.timeControl }}
- td(v-if="showResult") {{ g.score }}
+div
+ table.game-list(v-if="games.length > 0")
+ thead
+ tr
+ th {{ st.tr["Variant"] }}
+ th {{ st.tr[showBoth ? "Players" : "Versus"] }}
+ th(v-if="showCadence") {{ st.tr["Cadence"] }}
+ th {{ st.tr["Result"] }}
+ tbody
+ tr(
+ v-for="g in sortedGames()"
+ @click="$emit('show-game',g)"
+ :class="{'my-turn': !!g.myTurn}"
+ )
+ td {{ g.vname }}
+ td {{ player_s(g) }}
+ td(v-if="showCadence") {{ g.cadence }}
+ td(
+ :class="scoreClass(g)"
+ @click="deleteGame(g,$event)"
+ )
+ | {{ g.score }}
+ p(v-else)
+ | {{ st.tr["No games found :( Send a challenge!"] }}
+
+