summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demo/components/moderation.js33
1 files changed, 28 insertions, 5 deletions
diff --git a/demo/components/moderation.js b/demo/components/moderation.js
index 8ba4e98..1a2b0fd 100644
--- a/demo/components/moderation.js
+++ b/demo/components/moderation.js
@@ -1,11 +1,13 @@
import Chat from './chat.js'
import LikeButton from './like-button.js'
+import { Name } from './name.js'
export default {
data: ()=> ({
likeThreshold: 0,
- channel: 'demo'
+ channel: 'demo',
+ admin: null
}),
methods: {
@@ -18,11 +20,12 @@ export default {
Chat Channel: <input v-model="channel"/>
</p>
- <p>
- Only show me objects with more than <input v-model.number="likeThreshold"/> likes.
- </p>
-
<graffiti-objects :tags="[channel]" v-slot="{objects}">
+
+ <p>
+ Only show me objects with more than <input v-model.number="likeThreshold"/> likes.
+ </p>
+
<ul v-for="object in messageObjects(objects)">
<graffiti-objects :tags="[object._id]" v-slot="{objects: responses}">
<li v-if="likeObjects(responses, object._id).length >= likeThreshold">
@@ -31,6 +34,26 @@ export default {
</li>
</graffiti-objects>
</ul>
+
+ <p>
+ Only show me objects that
+ <select v-model="admin">
+ <option v-for="id in objects.authors" :value="id">
+ <Name :of="id">
+ </option>
+ </select>
+ has liked.
+ </p>
+
+ <ul v-for="object in messageObjects(objects)">
+ <graffiti-objects :tags="[object._id]" v-slot="{objects: responses}">
+ <li v-if="likeObjects(responses, object._id).filter(o=> o._by=admin).length">
+ <em><Name :of="object._by"/></em>:
+ {{ object.message }}
+ </li>
+ </graffiti-objects>
+ </ul>
+
</graffiti-objects>`
}