git ssb

3+

ev / sdash



Commit 6456cf14629c2ebd1c37ca63e36a9b800951a77a

make posts not show up if the poster hasn't posted with the post type

Ev Bogue committed on 9/7/2016, 5:14:25 PM
Parent: 2b371bcb39de8ceb47b4c6c5ebc566bed524e040

Files changed

index.jschanged
layouts/index.jadechanged
layouts/profile.jadechanged
index.jsView
@@ -31,14 +31,32 @@
3131 pull(
3232 sbot.query.read({query: [{$filter: { value: { author: key, content: {type: 'post'}}}}], limit: 1, reverse: true}),
3333 pull.drain(function (data) {
3434 post = data;
35- gotPost()
3635 })
3736 )
38- function gotPost() {
39- res.render('profile', {avatar, bloburl, key, markdown, moment});
40- }
37 + pull(
38 + sbot.query.read({query: [{$filter: { value: { author: key, content: {type: 'tagline'}}}}], limit: 1, reverse: true}),
39 + pull.drain(function (data) {
40 + tagline = data;
41 + console.log(tagline)
42 + })
43 + )
44 + pull(
45 + sbot.query.read({query: [{$filter: { value: { author: key, content: {type: 'location'}}}}], limit: 1, reverse: true}),
46 + pull.drain(function (data) {
47 + loc = data;
48 + console.log(loc)
49 + })
50 + )
51 + pull(
52 + sbot.query.read({query: [{$filter: { value: { author: key, content: {type: 'website'}}}}], limit: 1, reverse: true}),
53 + pull.drain(function (data) {
54 + website = data;
55 + console.log(website)
56 + })
57 + )
58 + res.render('profile', {avatar, bloburl, key, markdown, moment});
4159 })
4260 })
4361 });
4462
@@ -83,9 +101,8 @@
83101 if (err) {
84102 throw err;
85103 }
86104 reauthor = avatar;
87- gotPost();
88105 })
89106 redo = reblog;
90107 })
91108 )
@@ -97,10 +114,8 @@
97114 gits = data;
98115 })
99116 )
100117 });
101- function gotPost() {
102- res.render('index', { title: 'Evbogue.com', markdown, moment, bloburl});
103- }
118 + res.render('index', { title: 'Sdash', markdown, moment, bloburl});
104119 });
105120
106121 app.listen('7000');
layouts/index.jadeView
@@ -1,35 +1,40 @@
11 extends layout
22
33 block content
4 + if pinned
5 + div.message
6 + p.small.ri: strong pinned #{pinned.value.content.type}
7 + img(src='#{bloburl}#{image}' class='avatar')
8 + p <a href='#{encodeURIComponent(pinned.value.author)}' target='_parent'>@#{name}</a>
9 + != markdown(pinned.value.content.text)
10 + span.date #{moment(pinned.value.timestamp).fromNow()}
11 + if (pinned.value.content.channel)
12 + span in ##{pinned.value.content.channel}
413 div.message
5- p.small.ri: strong pinned #{pinned.value.content.type}
6- img(src='#{bloburl}#{image}' class='avatar')
7- p <a href='#{encodeURIComponent(pinned.value.author)}' target='_parent'>@#{name}</a>
8- != markdown(pinned.value.content.text)
9- span.date #{moment(pinned.value.timestamp).fromNow()}
10- if (pinned.value.content.channel)
11- span in ##{pinned.value.content.channel}
14 + if post
15 + p.small.ri: strong #{post.value.content.type}
16 + img(src='#{bloburl}#{image}' class='avatar')
17 + p <a href='#{encodeURIComponent(post.value.author)}' target='_parent'>@#{name}</a>
18 + != markdown(post.value.content.text)
19 + span.date #{moment(post.value.timestamp).fromNow()}
1220 div.message
13- p.small.ri: strong #{post.value.content.type}
14- img(src='#{bloburl}#{image}' class='avatar')
15- p <a href='#{encodeURIComponent(post.value.author)}' target='_parent'>@#{name}</a>
16- != markdown(post.value.content.text)
17- span.date #{moment(post.value.timestamp).fromNow()}
21 + if vote
22 + p.small.ri: strong #{vote.value.content.type}
23 + img(src='#{bloburl}#{image}' class='avatar')
24 + p <a href='#{encodeURIComponent(vote.value.author)}' target='_parent'>@#{name}</a> dug #{vote.value.content.vote.link}
25 + span.date #{moment(vote.value.timestamp).fromNow()}
26 + if redo.value.type === post
27 + div.message
28 + p.small.ri: strong #{redo.value.content.type}
29 + img(src='#{bloburl}#{reauthor.image}' class='avatar')
30 + p @<a href='#{encodeURIComponent(redo.value.author)}'>#{reauthor.name}</a>
31 + != markdown(redo.value.content.text)
32 + span.date #{moment(redo.value.timestamp).fromNow()}
1833 div.message
19- p.small.ri: strong #{vote.value.content.type}
20- img(src='#{bloburl}#{image}' class='avatar')
21- p <a href='#{encodeURIComponent(vote.value.author)}' target='_parent'>@#{name}</a> dug #{vote.value.content.vote.link}
22- span.date #{moment(vote.value.timestamp).fromNow()}
23- div.message
24- p.small.ri: strong #{redo.value.content.type}
25- img(src='#{bloburl}#{reauthor.image}' class='avatar')
26- p @<a href='#{encodeURIComponent(redo.value.author)}'>#{reauthor.name}</a>
27- != markdown(redo.value.content.text)
28- span.date #{moment(redo.value.timestamp).fromNow()}
29- div.message
30- p.small.ri: strong #{gits.value.content.type}
31- img(src='#{bloburl}#{image}' class='avatar')
32- p <a href='#{encodeURIComponent(gits.value.author)}' target='_parent'>@#{name}</a> pushed a git commit to #{gits.value.content.repo}<br />
33- span.date #{moment(gits.value.timestamp).fromNow()}
34 + if gits
35 + p.small.ri: strong #{gits.value.content.type}
36 + img(src='#{bloburl}#{image}' class='avatar')
37 + p <a href='#{encodeURIComponent(gits.value.author)}' target='_parent'>@#{name}</a> pushed a git commit to #{gits.value.content.repo}<br />
38 + span.date #{moment(gits.value.timestamp).fromNow()}
3439 hr
3540 p This is <a href='http://gitmx.com/%25qrU04j9vfUJKfq1rGZrQ5ihtSfA4ilfY3wLy7xFv0xk%3D.sha256/'>sdash</a>
layouts/profile.jadeView
@@ -3,8 +3,15 @@
33 block content
44 div.message
55 a(href='/#{key}'): img(src='http://localhost:8989/blobs/get/#{avatar.image}' style='width: 5em; float: left; margin-right: 1em;' class='profile')
66 p <strong>Name:</strong> <a href='/#{key}'>@#{avatar.name}</a><br /><strong>Pubkey:</strong> #{key}
7 + if tagline
8 + span <br /><strong>Tagline:</strong> #{tagline.value.content.tagline}</a>
9 + if loc
10 + span <br /><strong>Location:</strong> #{loc.value.content.location}</a>
11 + if website
12 + span <br /><strong>Website:</strong> <a href='#{website.value.content.text}'>#{website.value.content.website}</a>
13 +
714 div.message
815 p.small.ri: strong last #{post.value.content.type}
916 img(src='#{bloburl}#{avatar.image}' class='avatar')
1017 p <a href='#{post.value.key}' target='_parent'>@#{avatar.name}</a>

Built with git-ssb-web