5f183da159db45b1773ca154a2880b04cb736c34
[vchess.git] / client / src / views / MyGames.vue
1 <template>
2 <div class="about">
3 <h1>This is an about page</h1>
4 </div>
5 </template>
6 // "My" games: tabs my archived local games, my correspondance games
7 // + my imported games (of any type).
8 // TODO: later, also add possibility to upload a game (parse PGN).
9 Vue.component("my-tab-games", {
10 props: ["settings"],
11 data: function() {
12 return {
13 display: "",
14 imported: [],
15 local: [],
16 corr: []
17 };
18 },
19 template: `
20 <div>
21 <div class="button-group">
22 <button @click="display='local'">Local games</button>
23 <button @click="display='corr'">Correspondance games</button>
24 <button @click="display='imported'">Imported games</button>
25 </div>
26 <my-game-list v-show="display=='local'" :games="local">
27 </my-game-list>
28 <my-game-list v-show="display=='corr'" :games="corr">
29 </my-game-list>
30 <my-game-list v-show="display=='imported'" :games="imported">
31 </my-game-list>
32 <button @click="update">Refresh</button>
33 </div>
34 `,
35 created: function() {
36 // TODO: fetch corr games, local and corr
37 // if any corr game where it's my turn, set display = "corr",
38 // else set display = "local" (if any) or imported (if any and no local)
39 },
40 methods: {
41 update: function() {
42 // TODO: scan local + imported games, if any new then add it
43 },
44 },
45 });