projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better display on main Hall when no challenges or games found
[vchess.git]
/
client
/
src
/
components
/
GameList.vue
diff --git
a/client/src/components/GameList.vue
b/client/src/components/GameList.vue
index
39ad9bf
..
aa361fb
100644
(file)
--- a/
client/src/components/GameList.vue
+++ b/
client/src/components/GameList.vue
@@
-1,6
+1,6
@@
<template lang="pug">
div
<template lang="pug">
div
- table.game-list
+ table.game-list
(v-if="games.length > 0")
thead
tr
th {{ st.tr["Variant"] }}
thead
tr
th {{ st.tr["Variant"] }}
@@
-21,6
+21,8
@@
div
@click="deleteGame(g,$event)"
)
| {{ g.score }}
@click="deleteGame(g,$event)"
)
| {{ g.score }}
+ p(v-else)
+ | {{ st.tr["No games found :( Send a challenge!"] }}
</template>
<script>
</template>
<script>
@@
-134,7
+136,13
@@
export default {
return res;
},
deleteGame: function(game, e) {
return res;
},
deleteGame: function(game, e) {
- if (game.score != "*") {
+ if (
+ game.score != "*" &&
+ game.players.some(p =>
+ p.sid == this.st.user.sid ||
+ p.uid == this.st.user.id
+ )
+ ) {
if (confirm(this.st.tr["Remove game?"])) {
GameStorage.remove(
game.id,
if (confirm(this.st.tr["Remove game?"])) {
GameStorage.remove(
game.id,
@@
-151,6
+159,10
@@
export default {
</script>
<style lang="sass" scoped>
</script>
<style lang="sass" scoped>
+p
+ text-align: center
+ font-weight: bold
+
// NOTE: the style applied to <tr> element doesn't work
tr.my-turn > td
background-color: #fcd785
// NOTE: the style applied to <tr> element doesn't work
tr.my-turn > td
background-color: #fcd785