projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Saving current state
[vchess.git]
/
client
/
src
/
components
/
ChallengeList.vue
diff --git
a/client/src/components/ChallengeList.vue
b/client/src/components/ChallengeList.vue
index
a52e0ca
..
8951226
100644
(file)
--- a/
client/src/components/ChallengeList.vue
+++ b/
client/src/components/ChallengeList.vue
@@
-1,34
+1,24
@@
<template lang="pug">
table
tr
<template lang="pug">
table
tr
- th
(v-if="showVariant")
Variant
+ th Variant
th From
th To
th Cadence
th From
th To
th Cadence
- th(v-if="showNbPlayers") Number of players
tr(v-for="c in challenges" @click="$emit('click-challenge',c)")
tr(v-for="c in challenges" @click="$emit('click-challenge',c)")
- td
(v-if="showVariant") {{ c.variant
}}
+ td
{{ c.vname
}}
td {{ c.from.name }}
td {{ c.from.name }}
- td
+ td
(v-if="c.to[0].id > 0")
span(v-for="p in c.to") {{ p.name }}
span(v-for="p in c.to") {{ p.name }}
-
td {{ c.mainTime }} + {{ c.increment
}}
-
td(v-if="showNbPlayers") {{ c.nbPlayers
}}
+
td(v-else) {{ c.nbPlayers - 1 }} player{{ c.nbPlayers >= 3 ? 's' : ''
}}
+
td {{ c.timeControl
}}
</template>
<script>
export default {
name: "my-challenge-list",
props: ["challenges"],
</template>
<script>
export default {
name: "my-challenge-list",
props: ["challenges"],
- computed: {
- showVariant: function() {
- this.challenges.length > 0 && !!this.challenges[0].variant;
- },
- showNbPlayers: function() {
- this.challenges.length > 0 && !!this.challenges[0].nbPlayers;
- },
- },
};
};
-// TODO: challenge format from/to ou uid/players ............
</script>
<style lang="sass">
</script>
<style lang="sass">