X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=94a7bbad1d9f59f3288c5d0c775a393d68699384;hp=608c5d53ad780efdc068ae909de6203f3c4526ba;hb=bae751bc6bc548791772c3ff5883a03deeb77264;hpb=4222cf78d2c3cf1461f3c775e4e55a30938032bc diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 608c5d53..94a7bbad 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -12,9 +12,13 @@ main div#acceptDiv(role="dialog") .card p.text-center - span.variantName {{ curChallToAccept.vname }} + span.variantName + | {{ curChallToAccept.vname }} + | {{ curChallToAccept.options.abridged || '' }} span {{ curChallToAccept.cadence }} span {{ st.tr["with"] + " " + curChallToAccept.from.name }} + p.text-center(v-if="!!curChallToAccept.color") + | {{ st.tr["Your color:"] + " " + invColor(curChallToAccept.color) }} .diagram( v-if="!!curChallToAccept.fen" v-html="tchallDiag" @@ -46,7 +50,24 @@ main :value="v.id" :selected="newchallenge.vid==v.id" ) - | {{ v.name }} + | {{ v.display }} + // Variant-specific options (often at least randomness) + fieldset(v-if="!!newchallenge.V && newchallenge.V.Options") + div(v-for="select of newchallenge.V.Options.select || []") + label(:for="select.variable + '_opt'") {{ st.tr[select.label] }} * + select(:id="select.variable + '_opt'") + option( + v-for="o of select.options" + :value="o.value" + :selected="o.value == select.defaut" + ) + | {{ st.tr[o.label] }} + div(v-for="check of newchallenge.V.Options.check || []") + label(:for="check.variable + '_opt'") {{ st.tr[check.label] }} * + input( + :id="check.variable + '_opt'" + type="checkbox" + :checked="check.defaut") fieldset label(for="cadence") {{ st.tr["Cadence"] }} * div#predefinedCadences @@ -59,12 +80,6 @@ main v-model="newchallenge.cadence" placeholder="5+0, 1h+30s, 5d ..." ) - fieldset - label(for="selectRandomLevel") {{ st.tr["Randomness"] }} * - select#selectRandomLevel(v-model="newchallenge.randomness") - option(value="0") {{ st.tr["Deterministic"] }} - option(value="1") {{ st.tr["Symmetric random"] }} - option(value="2") {{ st.tr["Asymmetric random"] }} fieldset label(for="memorizeChall") {{ st.tr["Memorize"] }} input#memorizeChall( @@ -73,10 +88,14 @@ main ) fieldset(v-if="st.user.id > 0") label(for="selectPlayers") {{ st.tr["Play with"] }} - select#selectPlayersInList(v-model="newchallenge.to") + select#selectPlayersInList( + v-model="newchallenge.to" + @change="changeChallTarget()" + ) option(value="") option( v-for="p in Object.values(people)" + v-if="!!p.name" :value="p.name" ) | {{ p.name }} @@ -84,7 +103,13 @@ main type="text" v-model="newchallenge.to" ) - fieldset(v-if="st.user.id > 0 && newchallenge.to.length > 0") + fieldset(v-show="st.user.id > 0 && newchallenge.to.length > 0") + label(for="selectColor") {{ st.tr["Color"] }} + select#selectColor(v-model="newchallenge.color") + option(value='') + option(value='w') {{ st.tr["White"] }} + option(value='b') {{ st.tr["Black"] }} + br input#inputFen( placeholder="FEN" @input="trySetNewchallDiag()" @@ -95,7 +120,7 @@ main button(@click="issueNewChallenge()") {{ st.tr["Send challenge"] }} input#modalPeople.modal( type="checkbox" - @click="resetSocialColor()" + @click="toggleSocialColor()" ) div#peopleWrap( role="dialog" @@ -109,21 +134,22 @@ main v-for="sid in Object.keys(people)" v-if="!!people[sid].name" ) - span {{ people[sid].name }} + UserBio.user-bio(:uid="people[sid].id" :uname="people[sid].name") button.player-action( v-if="isGamer(sid)" @click="watchGame(sid)" ) | {{ st.tr["Observe"] }} button.player-action( - v-else-if="isFocusedOnHall(sid)" + v-else-if="st.user.sid != sid" + :class="{focused: isFocusedOnHall(sid)}" @click="challenge(sid)" ) | {{ st.tr["Challenge"] }} - p.anonymous @nonymous ({{ anonymousCount }}) + p.anonymous @nonymous ({{ anonymousCount() }}) #chat Chat( - :newChat="newChat" + ref="chatcomp" @mychat="processChat" :pastChats="[]" ) @@ -143,16 +169,18 @@ main tr th {{ st.tr["Variant"] }} th {{ st.tr["Cadence"] }} - th {{ st.tr["Random?"] }} + th {{ st.tr["Options"] }} th tbody + // TODO: remove the check !!pc.options tr( v-for="pc in presetChalls" @click="newChallFromPreset(pc)" + v-if="!!pc.options" ) td {{ pc.vname }} td {{ pc.cadence }} - td(:class="getRandomnessClass(pc)") + td(:class="getRandomnessClass(pc)") {{ pc.options.abridged || '' }} td.remove-preset(@click="removePresetChall($event, pc)") img(src="/images/icons/delete.svg") .row @@ -162,7 +190,7 @@ main button.tabbtn#btnClive(@click="setDisplay('c','live',$event)") | {{ st.tr["Live challenges"] }} button.tabbtn#btnCcorr(@click="setDisplay('c','corr',$event)") - | {{ st.tr["Correspondance challenges"] }} + | {{ st.tr["Correspondence challenges"] }} ChallengeList( v-show="cdisplay=='live'" :challenges="filterChallenges('live')" @@ -178,30 +206,37 @@ main button.tabbtn#btnGlive(@click="setDisplay('g','live',$event)") | {{ st.tr["Live games"] }} button.tabbtn#btnGcorr(@click="setDisplay('g','corr',$event)") - | {{ st.tr["Correspondance games"] }} + | {{ st.tr["Correspondence games"] }} GameList( v-show="gdisplay=='live'" :games="filterGames('live')" - :showBoth="true" - @show-game="showGame" - ) - GameList( - v-show="gdisplay=='corr'" - :games="filterGames('corr')" - :showBoth="true" + :show-both="true" @show-game="showGame" ) + div(v-show="gdisplay=='corr'") + GameList( + :games="filterGames('corr')" + :show-both="true" + @show-game="showGame" + ) + button#loadMoreBtn( + v-if="hasMore" + @click="loadMoreCorr()" + ) + | {{ st.tr["Load more"] }}