X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FProblems.vue;h=7621fe35a8b017898a7ee5f36c2478e842c86ae6;hb=7ba4a5bc5b64e19a1e7f26aa232d5c50770d07ad;hp=d3dfdfd2913c6a779616bec576054b393de3919c;hpb=2f258c37c19c5be20ec68695ddfaec2c21f7f0ae;p=vchess.git
diff --git a/client/src/views/Problems.vue b/client/src/views/Problems.vue
index d3dfdfd2..7621fe35 100644
--- a/client/src/views/Problems.vue
+++ b/client/src/views/Problems.vue
@@ -1,8 +1,14 @@
main
- input#modalNewprob.modal(type="checkbox" @change="infoMsg=''")
- div#newprobDiv(role="dialog" data-checkbox="modalNewprob")
- .card(@keyup.enter="sendProblem()")
+ input#modalNewprob.modal(
+ type="checkbox"
+ @change="fenFocusIfOpened($event)"
+ )
+ div#newprobDiv(
+ role="dialog"
+ data-checkbox="modalNewprob"
+ )
+ .card
label#closeNewprob.modal-close(for="modalNewprob")
fieldset
label(for="selectVariant") {{ st.tr["Variant"] }}
@@ -39,22 +45,19 @@ main
button(@click="sendProblem()") {{ st.tr["Send"] }}
#dialog.text-center {{ st.tr[infoMsg] }}
.row(v-if="showOne")
- .col-sm-12.col-md-10.col-md-offset-2
+ .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
#topPage
+ .button-group(v-if="st.user.id == curproblem.uid")
+ button(@click="editProblem(curproblem)") {{ st.tr["Edit"] }}
+ button(@click="deleteProblem(curproblem)") {{ st.tr["Delete"] }}
span.vname {{ curproblem.vname }}
- span.uname {{ "(" + curproblem.uname + ")" }}
+ span.uname ({{ curproblem.uname }})
button.marginleft(@click="backToList()") {{ st.tr["Back to list"] }}
- button.nomargin(
- v-if="st.user.id == curproblem.uid"
- @click="editProblem(curproblem)"
- )
- | {{ st.tr["Edit"] }}
- button.nomargin(
- v-if="st.user.id == curproblem.uid"
- @click="deleteProblem(curproblem)"
- )
- | {{ st.tr["Delete"] }}
- p.clickable(
+ button.nomargin(@click="gotoPrevNext($event,curproblem,1)")
+ | {{ st.tr["Previous"] }}
+ button.nomargin(@click="gotoPrevNext($event,curproblem,-1)")
+ | {{ st.tr["Next"] }}
+ p.oneInstructions.clickable(
v-html="parseHtml(curproblem.instruction)"
@click="curproblem.showSolution=!curproblem.showSolution"
)
@@ -66,7 +69,7 @@ main
.row(v-else)
.col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
#controls
- button#newProblem(onClick="doClick('modalNewprob')")
+ button#newProblem(@click="prepareNewProblem()")
| {{ st.tr["New problem"] }}
label(for="checkboxMine") {{ st.tr["My problems"] }}
input#checkboxMine(
@@ -80,7 +83,7 @@ main
:value="v.id"
)
| {{ v.name }}
- table
+ table#tProblems
tr
th {{ st.tr["Variant"] }}
th {{ st.tr["Instructions"] }}
@@ -93,7 +96,10 @@ main
td {{ p.vname }}
td {{ firstChars(p.instruction) }}
td {{ p.id }}
- BaseGame(v-if="showOne" :game="game" :vr="vr")
+ BaseGame(
+ v-if="showOne"
+ :game="game"
+ )
@@ -344,13 +363,20 @@ export default {
[type="checkbox"].modal+div .card
max-width: 767px
max-height: 100%
+
#inputFen
width: 100%
+
textarea
width: 100%
+
#diagram
margin: 0 auto
max-width: 400px
+
+table#tProblems
+ max-height: 100%
+
#controls
margin: 0
width: 100%
@@ -358,6 +384,11 @@ textarea
& > *
margin: 0
+p.oneInstructions
+ margin: 0
+ padding: 2px 5px
+ background-color: lightgreen
+
#topPage
span.vname
font-weight: bold
@@ -373,5 +404,4 @@ textarea
@media screen and (max-width: 767px)
#topPage
text-align: center
-