X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2FproblemSummary.js;h=5f0fd44bf36a371ff1c2ae3c51dccf152b34af87;hb=c5fa5762dc441fb1cb669908fae01d0d128e372d;hp=c0b409debc9bc8e1e2d8cb2ffd0b7d928ecdda5a;hpb=c794dbb87592782913af0a09784ed25e019e4d10;p=vchess.git diff --git a/public/javascripts/components/problemSummary.js b/public/javascripts/components/problemSummary.js index c0b409de..5f0fd44b 100644 --- a/public/javascripts/components/problemSummary.js +++ b/public/javascripts/components/problemSummary.js @@ -1,20 +1,29 @@ -// Show a problem summary on variant page +// Show a problem summary on variant page or new problem preview Vue.component('my-problem-summary', { - props: ['prob'], + props: ['prob','preview'], template: ` -
-
-
-
{{ timestamp2date(prob.added) }}
+
+
+
+
+

+

+

{{ timestamp2date(prob.added) }}

+ +
`, methods: { + translate: function(text) { + return translations[text]; + }, getDiagram: function(fen) { - const fenParts = fen.split(" "); + const fenParsed = V.ParseFen(fen); return getDiagram({ - position: fenParts[0], + position: fenParsed.position, + turn: fenParsed.turn, // No need for flags here - turn: fenParts[2], }); }, timestamp2date(ts) {