+ {{ curProb.instructions }} +
++ {{ translations["Show solution"] }} +
++ {{ curProb.solution }} +
+X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=cf2cd074cf7446220618576d69e4727440ef6f12;hb=4608eed94432356bd2df8c144d7d233913c6483c;hp=7c588b240b860408537824589875b08278ba7728;hpb=d289b0439d795580a6fcdc4b73521f246cd81450;p=vchess.git diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index 7c588b24..cf2cd074 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -1,129 +1,317 @@ Vue.component('my-problems', { data: function () { return { - problems: problemArray, //initial value - newProblem: { + userId: user.id, + problems: [], //oldest first + myProblems: [], //same, but only mine + singletons: [], //requested problems (using #num) + display: "others", //or "mine" + curProb: null, //(reference to) current displayed problem (if any) + showSolution: false, + pbNum: 0, //to navigate directly to some problem + // New problem (to upload), or existing problem to edit: + modalProb: { + id: 0, //defined if it's an edit fen: "", instructions: "", solution: "", - stage: "nothing", //or "preview" after new problem is filled + preview: false, }, }; }, template: `
+ {{ curProb.instructions }} +
++ {{ curProb.solution }} +
+