git ssb

0+

dangerousbeans / yap



forked from Dominic / yap

Commit d456c0de79e7e1d66780ef66785be84e540fc2b6

link to friends page of feed

Dominic Tarr committed on 12/16/2018, 11:13:43 AM
Parent: dfd28514cdfdb673129cae1de87928fad0befc39

Files changed

apis/friends.jschanged
apis/public.jschanged
apis/friends.jsView
@@ -1,6 +1,6 @@
1+var toUrl = require('../util').toUrl
12
2-
33 module.exports = function (opts) {
44 var sbot = this.sbot
55 var api = this.api
66 return function (cb) {
@@ -19,16 +19,15 @@
1919 delete follows[k]
2020 delete followers[k]
2121 }
2222 }
23- console.log('friends', friends)
2423 var limit = 25
2524 function group (label, list) {
2625 return [
2726 'div.'+label,
2827 ['h2', label],
2928 ].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})})
3130 })).concat(
3231 //TODO make this a link to a page showing friends.
3332 list.length > limit ? '...and '+(list.length-limit)+' more' : ''
3433 )
@@ -72,4 +71,5 @@
7271
7372
7473
7574
75+
apis/public.jsView
@@ -57,9 +57,15 @@
5757 nav_opts.author = opts.author
5858
5959 var nav = ['span',
6060 '<< ',
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+ }): '',
6268 ' ',
6369 ['a', {
6470 href: toUrl(type, Object.assign({}, nav_opts, {
6571 gt: max
@@ -85,4 +91,6 @@
8591 }
8692 )
8793 }
8894
95+
96+

Built with git-ssb-web