X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=ebb4675368f90060e17155bd96af56fcfde805ff;hb=4a2093139089632727de4f510127ef186cab528e;hp=6ecc55270faa85982bab4f771506b087b49abf92;hpb=f9c36b2da005b596ad656f4b6cc4e09ef3c656f1;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 6ecc5527..ebb46753 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -10,15 +10,22 @@ main p(v-html="infoMessage") input#modalAccept.modal(type="checkbox") div#acceptDiv(role="dialog") - .card.text-center - p + .card + p.text-center span.variantName {{ curChallToAccept.vname }} span {{ curChallToAccept.cadence }} span {{ st.tr["with"] + " " + curChallToAccept.from.name }} - .diagram(v-html="tchallDiag") - .button-group#buttonsTchall - button.acceptBtn(@click="decisionChallenge(true)") {{ st.tr["Accept challenge?"] }} - button.refuseBtn(@click="decisionChallenge(false)") {{ st.tr["Refuse"] }} + p.text-center(v-if="!!curChallToAccept.color") + | {{ st.tr["Your color:"] + " " + invColor(curChallToAccept.color) }} + .diagram( + v-if="!!curChallToAccept.fen" + v-html="tchallDiag" + ) + .button-group#buttonsTchall(:style="tchallButtonsMargin()") + button.acceptBtn(@click="decisionChallenge(true)") + span {{ st.tr["Accept challenge?"] }} + button.refuseBtn(@click="decisionChallenge(false)") + span {{ st.tr["Refuse"] }} input#modalNewgame.modal( type="checkbox" @change="cadenceFocusIfOpened($event)" @@ -29,7 +36,7 @@ main ) .card label#closeNewgame.modal-close(for="modalNewgame") - div(@keyup.enter="newChallenge()") + div(@keyup.enter="issueNewChallenge()") fieldset label(for="selectVariant") {{ st.tr["Variant"] }} * select#selectVariant( @@ -60,13 +67,36 @@ main 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( + type="checkbox" + v-model="newchallenge.memorize" + ) fieldset(v-if="st.user.id > 0") - label(for="selectPlayers") {{ st.tr["Play with?"] }} + label(for="selectPlayers") {{ st.tr["Play with"] }} + 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 }} input#selectPlayers( 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()" @@ -74,10 +104,10 @@ main v-model="newchallenge.fen" ) .diagram(v-html="newchallenge.diag") - button(@click="newChallenge()") {{ st.tr["Send challenge"] }} + button(@click="issueNewChallenge()") {{ st.tr["Send challenge"] }} input#modalPeople.modal( type="checkbox" - @click="resetSocialColor()" + @click="toggleSocialColor()" ) div#peopleWrap( role="dialog" @@ -91,21 +121,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="st.user.id > 0 && sid != st.user.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="[]" ) @@ -115,8 +146,28 @@ main .button-group button#peopleBtn(onClick="window.doClick('modalPeople')") | {{ st.tr["Who's there?"] }} - button(onClick="window.doClick('modalNewgame')") + button(@click="showNewchallengeForm()") | {{ st.tr["New game"] }} + .row(v-if="presetChalls.length > 0") + .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 + h4.text-center {{ st.tr["Preset challenges"] }} + table + thead + tr + th {{ st.tr["Variant"] }} + th {{ st.tr["Cadence"] }} + th {{ st.tr["Random?"] }} + th + tbody + tr( + v-for="pc in presetChalls" + @click="newChallFromPreset(pc)" + ) + td {{ pc.vname }} + td {{ pc.cadence }} + td(:class="getRandomnessClass(pc)") + td.remove-preset(@click="removePresetChall($event, pc)") + img(src="/images/icons/delete.svg") .row .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 div#div2 @@ -124,7 +175,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')" @@ -140,30 +191,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"] }}