Commit d456c0de79e7e1d66780ef66785be84e540fc2b6
link to friends page of feed
Dominic Tarr committed on 12/16/2018, 11:13:43 AMParent: dfd28514cdfdb673129cae1de87928fad0befc39
Files changed
apis/friends.js | changed |
apis/public.js | changed |
apis/friends.js | ||
---|---|---|
@@ -1,6 +1,6 @@ | ||
1 | +var toUrl = require('../util').toUrl | |
1 | 2 | |
2 | - | |
3 | 3 | module.exports = function (opts) { |
4 | 4 | var sbot = this.sbot |
5 | 5 | var api = this.api |
6 | 6 | return function (cb) { |
@@ -19,16 +19,15 @@ | ||
19 | 19 | delete follows[k] |
20 | 20 | delete followers[k] |
21 | 21 | } |
22 | 22 | } |
23 | - console.log('friends', friends) | |
24 | 23 | var limit = 25 |
25 | 24 | function group (label, list) { |
26 | 25 | return [ |
27 | 26 | 'div.'+label, |
28 | 27 | ['h2', label], |
29 | 28 | ].concat(list.slice(0, limit).map(function (e) { |
30 | - return api(['avatar'], {id: e, image: true, name: false}) | |
29 | + return api(['avatar'], {id: e, image: true, name: false, href: toUrl('friends', {id: e})}) | |
31 | 30 | })).concat( |
32 | 31 | //TODO make this a link to a page showing friends. |
33 | 32 | list.length > limit ? '...and '+(list.length-limit)+' more' : '' |
34 | 33 | ) |
@@ -72,4 +71,5 @@ | ||
72 | 71 | |
73 | 72 | |
74 | 73 | |
75 | 74 | |
75 | + |
apis/public.js | ||
---|---|---|
@@ -57,9 +57,15 @@ | ||
57 | 57 | nav_opts.author = opts.author |
58 | 58 | |
59 | 59 | var nav = ['span', |
60 | 60 | '<< ', |
61 | - opts.author ? api(['avatar'], {id: opts.author, name: true, image: false}) : '', | |
61 | + opts.author ? | |
62 | + api(['avatar'], { | |
63 | + id: opts.author, | |
64 | + name: true, | |
65 | + image: false, | |
66 | + href: toUrl('friends', {id: opts.author}) | |
67 | + }): '', | |
62 | 68 | ' ', |
63 | 69 | ['a', { |
64 | 70 | href: toUrl(type, Object.assign({}, nav_opts, { |
65 | 71 | gt: max |
@@ -85,4 +91,6 @@ | ||
85 | 91 | } |
86 | 92 | ) |
87 | 93 | } |
88 | 94 | |
95 | + | |
96 | + |
Built with git-ssb-web