Debugging problems page; TODO: hash navigation is wrong
[vchess.git] / public / javascripts / components / problemSummary.js
index d7f239e..3d57915 100644 (file)
@@ -1,6 +1,6 @@
 // Preview a problem on variant page
 Vue.component('my-problem-summary', {
-       props: ['prob','userid'],
+       props: ['prob','userid','preview'],
        template: `
                <div class="row problem">
                        <div class="col-sm-12 col-md-6 diagram"
@@ -10,7 +10,8 @@ Vue.component('my-problem-summary', {
                                <p v-html="prob.instructions"></p>
                                <p v-if="!!prob.preview" v-html="prob.solution"></p>
                                <p v-else class="problem-time">{{ timestamp2date(prob.added) }}</p>
-                               <div v-show="prob.uid==userid" class="button-group">
+                               <button @click="$emit('show-problem')">Show</button>
+                               <div v-show="prob.uid==userid && !preview" class="button-group">
                                        <button @click="$emit('edit-problem')">Edit</button>
                                        <button @click="$emit('delete-problem')">Delete</button>
                                </div>