+ {{ curProb.instructions }} +
++ {{ translations["Show solution"] }} +
++ {{ curProb.solution }} +
+X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=53077049d12dc61bd071fa2160e38c67c86cba08;hp=dbd8340c96236d023f1d88b27ef2b38676ae7e9e;hb=fd08ab2c5b8931bb8c95cf7e9f2f95122647f991;hpb=7931e479adf93c87771ded1892a0873af72ae46d diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index dbd8340c..53077049 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -1,97 +1,316 @@ Vue.component('my-problems', { data: function () { return { - problems: problemArray //initial value + 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: "", + preview: false, + }, }; }, template: ` -
+ {{ curProb.instructions }} +
++ {{ curProb.solution }} +
+