X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=b9262d12b339246ce91688e0781164e6ed1d0e11;hp=8d8b311aec49988cbda7837515c5c1ae84255536;hb=0234201fb338fc239d6f613c677fa932c7c3697c;hpb=e33e50fa2122c1df2aa9d4d15a2f9d75341b0d70 diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 8d8b311a..b9262d12 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,21 @@ 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") + option(value="") + option( + v-for="p in Object.values(people)" + :value="p.name" + ) + | {{ p.name }} input#selectPlayers( type="text" v-model="newchallenge.to" @@ -74,7 +92,7 @@ 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()" @@ -89,7 +107,7 @@ main #players p( v-for="sid in Object.keys(people)" - v-if="people[sid].name" + v-if="!!people[sid].name" ) span {{ people[sid].name }} button.player-action( @@ -98,7 +116,7 @@ main ) | {{ 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"] }} @@ -115,8 +133,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 @@ -147,12 +185,17 @@ main :showBoth="true" @show-game="showGame" ) - GameList( - v-show="gdisplay=='corr'" - :games="filterGames('corr')" - :showBoth="true" - @show-game="showGame" - ) + div(v-show="gdisplay=='corr'") + GameList( + :games="filterGames('corr')" + :showBoth="true" + @show-game="showGame" + ) + button#loadMoreBtn( + v-if="hasMore" + @click="loadMore()" + ) + | {{ st.tr["Load more"] }}