Start server implementation for correspondance play (early debug stage)
[vchess.git] / public / javascripts / components / gameList.js
index 9eb1f7d..9b66982 100644 (file)
@@ -1,18 +1,23 @@
 Vue.component("my-game-list", {
        props: ["games"],
        computed: {
+               showVariant: function() {
+                       return this.games.length > 0 && !!this.games[0].vname;
+               },
                showResult: function() {
-                       this.games.length > 0 && this.games[0].score != "*";
+                       return this.games.length > 0 && this.games[0].score != "*";
                },
        },
        template: `
                <table>
                        <tr>
+                               <th v-if="showVariant">Variant</th>
                                <th>Players names</th>
                                <th>Cadence</th>
                                <th v-if="showResult">Result</th>
                        </tr>
                        <tr v-for="g in games" @click="$emit('show-game',g)">
+                               <td v-if="showVariant">{{ g.vname }}</td>
                                <td>
                                        <span v-for="p in g.players">{{ p.name }}</span>
                                </td>