X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=a98b4c05e3629e55a5cb12b51e6dcb8c1820c1b3;hb=80b38d463c0d5dacac93bc2aeb666bbb19781e1e;hp=6ecc55270faa85982bab4f771506b087b49abf92;hpb=f9c36b2da005b596ad656f4b6cc4e09ef3c656f1;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 6ecc5527..a98b4c05 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -10,15 +10,20 @@ 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"] }} + .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 +34,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,8 +65,25 @@ 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" @@ -74,10 +96,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 +113,21 @@ 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="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 +137,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 @@ -144,26 +186,33 @@ main 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"] }}