git ssb

1+

punkmonk.termux / mvd



forked from ev / mvd

Commit 15fad1b5904057929eb70d9931b1b2f3339cc87c

render repo names with ssb-avatar

Ev Bogue committed on 10/11/2018, 6:34:01 PM
Parent: 8e2236d6be260051ebef7762adbc9a84db03a913

Files changed

render.jschanged
render.jsView
@@ -8,8 +8,9 @@
88
99 var config = require('./config')()
1010 var id = require('./keys').id
1111 var avatar = require('./avatar')
12+var ssbAvatar = require('ssb-avatar')
1213
1314 var diff = require('diff')
1415
1516 function hash () {
@@ -102,9 +103,8 @@
102103 var cloneurl = h('pre', 'git clone ssb://' + msg.value.content.repo)
103104
104105 message.appendChild(reponame)
105106
106- var ssbAvatar = require('ssb-avatar')
107107
108108 ssbAvatar(sbot, id, msg.value.content.repo, function (err, data) {
109109 if (data)
110110 var actualname = h('p', 'pushed to ', h('a', {href: '#' + msg.value.content.repo}, '%' + data.name))
@@ -128,16 +128,21 @@
128128
129129 }
130130 else if (msg.value.content.type == 'git-repo') {
131131 message.appendChild(tools.header(msg))
132- if (msg.value.content.name) {
133- message.appendChild(h('p', h('a', {href: '#' + msg.key}, '%' + msg.value.content.name)))
134- } else {
135- message.appendChild(h('p', h('a', {href: '#' + msg.key}, msg.key)))
136- }
132+
133+ var reponame = h('p', 'git-ssb repo ', h('a', {href: '#' + msg.key}, msg.key))
134+
135+ message.appendChild(reponame)
136+
137+ ssbAvatar(sbot, id, msg.key, function (err, data) {
138+ if (data)
139+ var actualname = h('p', 'git-ssb repo ', h('a', {href: '#' + msg.key}, '%' + data.name))
140+ reponame.parentNode.replaceChild(actualname, reponame)
141+ })
142+
137143 var cloneurl = h('pre', 'git clone ssb://' + msg.key)
138144 message.appendChild(cloneurl)
139- //message.appendChild(h('pre', tools.rawJSON(msg.value.content)))
140145 return message
141146 }
142147
143148 else if (msg.value.content.type == 'wiki') {

Built with git-ssb-web