X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2FproblemSummary.js;h=e7e1db7c60377faa7417db3438571365f70e3853;hp=c0b409debc9bc8e1e2d8cb2ffd0b7d928ecdda5a;hb=b5fb8e693dc82037eec2617a7dc49d838a9a8441;hpb=86c9843cd04717d61f373ebaf3a1fdf21fd5a60f diff --git a/public/javascripts/components/problemSummary.js b/public/javascripts/components/problemSummary.js index c0b409de..e7e1db7c 100644 --- a/public/javascripts/components/problemSummary.js +++ b/public/javascripts/components/problemSummary.js @@ -1,20 +1,25 @@ -// 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: { 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) {