Commit 9ee51f2b87423b4fe12401dc8ecb9f21a5965aea
add user posts to their profile page gold star
Gwen committed on 9/3/2016, 5:17:00 AMParent: e0a6ca5dfb54b357d64d5b3e6aa2ca7a4dcc61b3
Files changed
index.js | changed |
layouts/profile.jade | changed |
index.js | ||
---|---|---|
@@ -30,8 +30,15 @@ | ||
30 | 30 … | if (err) { |
31 | 31 … | throw err; |
32 | 32 … | } |
33 | 33 … | key = req.params.key; |
34 … | + pull( | |
35 … | + sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'post'}}}}], limit: 1, reverse: true}), | |
36 … | + pull.drain(function (data) { | |
37 … | + post = data; | |
38 … | + console.log(data) | |
39 … | + }) | |
40 … | + ) | |
34 | 41 … | res.render('profile', {avatar, bloburl, key}); |
35 | 42 … | }) |
36 | 43 … | }) |
37 | 44 … | }); |
layouts/profile.jade | ||
---|---|---|
@@ -3,4 +3,5 @@ | ||
3 | 3 … | block content |
4 | 4 … | div.message |
5 | 5 … | a(href='/#{key}'): img(src='http://localhost:8989/blobs/get/#{avatar.image}' style='width: 5em; float: left; margin-right: 1em;' class='profile') |
6 | 6 … | p <strong>Name:</strong> <a href='/#{key}'>@#{avatar.name}</a><br /><strong>Pubkey:</strong> #{key} |
7 … | + p= post.value.content.text |
Built with git-ssb-web