X-Git-Url: https://git.auder.net/js/rpsls.js?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2FproblemSummary.js;h=d7f239ee73f61e4e66faf5a019a7e8599649f3d4;hb=60d9063fdfcd4b7628fbc0e0fc594f083bda8761;hp=6003f08516db83417f9883cf620d207236b1e40a;hpb=da06a6eb0237123ce43fdb01cb06246b8b57f5e5;p=vchess.git diff --git a/public/javascripts/components/problemSummary.js b/public/javascripts/components/problemSummary.js index 6003f085..d7f239ee 100644 --- a/public/javascripts/components/problemSummary.js +++ b/public/javascripts/components/problemSummary.js @@ -1,17 +1,33 @@ -// Show a problem summary on variant page +// Preview a problem on variant page Vue.component('my-problem-summary', { - props: ['prob'], + props: ['prob','userid'], template: ` -
-
- {{ getDiagram(prob.fen) }} +
+
-
- {{ prob.instructions.substr(0,32) }} -
-
- {{ prob.added }} +
+

+

+

{{ timestamp2date(prob.added) }}

+
+ + +
`, + methods: { + getDiagram: function(fen) { + const fenParsed = V.ParseFen(fen); + return getDiagram({ + position: fenParsed.position, + turn: fenParsed.turn, + // No need for flags here + }); + }, + timestamp2date(ts) { + return getDate(new Date(ts)); + }, + }, })