projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Step toward a one-page application
[vchess.git]
/
public
/
javascripts
/
components
/
problemSummary.js
diff --git
a/public/javascripts/components/problemSummary.js
b/public/javascripts/components/problemSummary.js
index
08109ef
..
54602e0
100644
(file)
--- a/
public/javascripts/components/problemSummary.js
+++ b/
public/javascripts/components/problemSummary.js
@@
-1,6
+1,6
@@
// Preview a problem on variant page
// Preview a problem on variant page
-Vue.component('my-problem-
preview
', {
- props: ['prob','userid'],
+Vue.component('my-problem-
summary
', {
+ props: ['prob','userid'
,'preview'
],
template: `
<div class="row problem">
<div class="col-sm-12 col-md-6 diagram"
template: `
<div class="row problem">
<div class="col-sm-12 col-md-6 diagram"
@@
-10,7
+10,8
@@
Vue.component('my-problem-preview', {
<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>
<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 v-show="!preview" @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>
<button @click="$emit('edit-problem')">Edit</button>
<button @click="$emit('delete-problem')">Delete</button>
</div>