X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FVariants.vue;h=d6cbda9343f6ef3bdd1b9c14a5ce6865c70c92f7;hb=7c165b3a63d7f18bc7046766a8a2090a492d3b18;hp=8e28e50024aeee273ee1441621be9fbadf804c79;hpb=a57faf48c575029ecbba41de0f87bfe11d8c4e4b;p=vchess.git diff --git a/client/src/views/Variants.vue b/client/src/views/Variants.vue index 8e28e500..d6cbda93 100644 --- a/client/src/views/Variants.vue +++ b/client/src/views/Variants.vue @@ -10,13 +10,13 @@ main a(href="https://www.chessvariants.com/why.html") | {{ st.tr["Why play chess variants?"] }} p - a(href="/#/variants/Chess") Chess - | {{ st.tr["chess_v"] }} + a(href="/#/variants/Chess960") Chess960 + | {{ st.tr["chess960_v"] }} div(v-for="g of sortedGroups") h3 {{ st.tr["vt" + g] }} p {{ st.tr["vg" + g] }} ul - li(v-for="v of variantGroup.get(g)") + li(v-for="v of sortVariants(variantGroup.get(g))") a(:href="getLink(v)") {{ v.display }} |  –  | {{ st.tr[v.description] }} @@ -35,7 +35,7 @@ export default { }, created: function() { ajax( - "/variants", + "/allvarslist", "GET", { success: (res) => { @@ -59,6 +59,9 @@ export default { } }, methods: { + sortVariants: function(group) { + return group.sort( (v1, v2) => v1.name.localeCompare(v2.name) ); + }, // oninput listener, required for smartphones: setCurPrefix: function(e) { this.curPrefix = e.target.value;