Commit | Line | Data |
---|---|---|
85e5b5c1 BA |
1 | <template lang="pug"> |
2 | table | |
3 | tr | |
9d58ef95 | 4 | th Variant |
42c15a75 BA |
5 | th White |
6 | th Black | |
7 | th Time control | |
85e5b5c1 | 8 | th(v-if="showResult") Result |
41cb9b94 | 9 | // TODO: show my games first (st.user.id or sid) |
85e5b5c1 | 10 | tr(v-for="g in games" @click="$emit('show-game',g)") |
9d58ef95 | 11 | td {{ g.vname }} |
afd3240d BA |
12 | td {{ g.players[0].name || "@nonymous" }} |
13 | td {{ g.players[1].name || "@nonymous" }} | |
42c15a75 | 14 | td {{ g.timeControl }} |
85e5b5c1 BA |
15 | td(v-if="showResult") {{ g.score }} |
16 | </template> | |
17 | ||
18 | <script> | |
19 | export default { | |
20 | name: "my-game-list", | |
21 | props: ["games"], | |
22 | computed: { | |
85e5b5c1 | 23 | showResult: function() { |
afd3240d | 24 | return this.games.some(g => g.score != "*"); |
85e5b5c1 BA |
25 | }, |
26 | }, | |
27 | }; | |
28 | </script> |