1 // Show a problem summary on variant page
2 Vue
.component('my-problem-summary', {
5 <div class="problem col-sm-12" @click="showProblem()">
6 <div class="diagram" v-html="getDiagram(prob.fen)"></div>
7 <div class="problem-instructions" v-html="prob.instructions.substr(0,32)"></div>
8 <div class="problem-time">{{ timestamp2datetime(prob.added) }}</div>
12 getDiagram: function(fen
) {
13 const fenParts
= fen
.split(" ");
15 position: fenParts
[0],
16 // No need for flags here
20 timestamp2datetime(ts
) {
24 showProblem: function() {
25 alert("show problem");
27 //TODO: send event with object prob.fen, prob.instructions, prob.solution
28 //Event should propagate to game, which set mode=="problem" + other variables
29 //click on a problem ==> land on variant page with mode==friend, FEN prefilled... ok
30 // click on problem ==> masque problems, affiche game tab, launch new game Friend with
31 // FEN + turn + flags + rappel instructions / solution on click sous l'échiquier