On the way to problems: saving state [not functional yet]
[vchess.git] / public / javascripts / components / problemSummary.js
diff --git a/public/javascripts/components/problemSummary.js b/public/javascripts/components/problemSummary.js
new file mode 100644 (file)
index 0000000..6003f08
--- /dev/null
@@ -0,0 +1,17 @@
+// Show a problem summary on variant page
+Vue.component('my-problem-summary', {
+       props: ['prob'],
+       template: `
+               <div class="problem col-sm-12">
+                       <div class="diagram">
+                               {{ getDiagram(prob.fen) }}
+                       </div>
+                       <div class="problem-instructions">
+                               {{ prob.instructions.substr(0,32) }}
+                       </div>
+                       <div class="problem-time">
+                               {{ prob.added }}
+                       </div>
+               </div>
+       `,
+})