diff options
author | theia | 2023-02-03 16:12:20 -0500 |
---|---|---|
committer | theia | 2023-02-03 16:12:20 -0500 |
commit | 486de89b002b996e2fc8e0538eb7e25df2d18541 (patch) | |
tree | 46ddef6d7c01017ad3b91a410508dcf842e2069d | |
parent | 655434fa06bc6fdaffd44bb62b532283aefa789a (diff) |
Added moderation
-rw-r--r-- | demo/components/moderation.js | 33 |
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>` } |