git ssb

30+

cel / git-ssb-web



Commit 7475f9c7cb7c134efe5596d67813ecae136bf9a9

Put profile icons on user pages

Charles Lehner committed on 5/21/2016, 3:32:37 AM
Parent: fbf41c49a722b764d89e7c44d5baef86a9e6c157

Files changed

lib/users.jschanged
lib/users.jsView
@@ -29,15 +29,19 @@
2929
3030 U.renderUserPage = function (req, feedId, page, titleTemplate, body) {
3131 var self = this
3232 return u.readNext(function (cb) {
33- self.web.about.getName(feedId, function (err, name) {
33+ self.web.about(feedId, function (err, about) {
3434 if (err) return cb(err)
3535 var title = titleTemplate ? titleTemplate
36- .replace(/\%{name\}/g, u.escape(name))
37- : u.escape(name)
36+ .replace(/\%{name\}/g, u.escape(about.name))
37+ : u.escape(about.name)
3838 cb(null, self.web.serveTemplate(req, title)(cat([
39- pull.once('<h2>' + u.link([feedId], name) +
39+ pull.once('<h2>' + u.link([feedId], (about.image ?
40+ '<img class="profile-icon"' +
41+ ' src="/' + encodeURIComponent(about.image) + '"' +
42+ ' alt="' + u.escape(about.name) + '"> ' : '') +
43+ u.escape(about.name), true) +
4044 '<code class="user-id">' + feedId + '</code></h2>' +
4145 u.nav([
4246 [[feedId], req._t('Activity'), 'activity'],
4347 [[feedId, 'repos'], req._t('Repos'), 'repos'],

Built with git-ssb-web