X-Git-Url: https://git.auder.net/img/js/current/gitweb.css?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FChallengeList.vue;h=cf4565ad348e47e3cdfe6ee5418345320857fa8f;hb=3d9745ae10ba867e4c1ec6e848db29c5e293420b;hp=c7df2ddea7bae9214b594ab77c2384fa3772bfcf;hpb=e64c6f67185b45b3b1205069532362c1bf9680db;p=vchess.git
diff --git a/client/src/components/ChallengeList.vue b/client/src/components/ChallengeList.vue
index c7df2dde..cf4565ad 100644
--- a/client/src/components/ChallengeList.vue
+++ b/client/src/components/ChallengeList.vue
@@ -1,26 +1,93 @@
-table
- tr
- th Variant
- th From
- th To
- th Cadence
- tr(v-for="c in challenges" @click="$emit('click-challenge',c)")
- td {{ c.vname }}
- td {{ c.from.name }}
- td(v-if="!!c.to[0]")
- span(v-for="pname in c.to") {{ pname }}
- td(v-else) {{ c.to.length }} player{{ c.to.length >= 2 ? 's' : '' }}
- td {{ c.timeControl }}
+div
+ table(v-if="challenges.length > 0")
+ thead
+ tr
+ th {{ st.tr["Variant"] }}
+ th {{ st.tr["With"] }}
+ th {{ st.tr["Cadence"] }}
+ th {{ st.tr["Options"] }}
+ tbody
+ tr(
+ v-for="c in sortedChallenges"
+ :class="{toyou:c.priority==1,fromyou:c.priority==2}"
+ @click="$emit('click-challenge',c)"
+ )
+ td {{ c.vname }}
+ td {{ withWho(c) }}
+ td {{ c.cadence }}
+ td(:class="getRandomnessClass(c)") {{ c.options.abridged || '' }}
+ p(v-else)
+ | {{ st.tr["No challenges found :( Click on 'New game'!"] }}
-