Commit 7475f9c7cb7c134efe5596d67813ecae136bf9a9
Put profile icons on user pages
Charles Lehner committed on 5/21/2016, 3:32:37 AMParent: fbf41c49a722b764d89e7c44d5baef86a9e6c157
Files changed
lib/users.js | changed |
lib/users.js | ||
---|---|---|
@@ -29,15 +29,19 @@ | ||
29 | 29 | |
30 | 30 | U.renderUserPage = function (req, feedId, page, titleTemplate, body) { |
31 | 31 | var self = this |
32 | 32 | return u.readNext(function (cb) { |
33 | - self.web.about.getName(feedId, function (err, name) { | |
33 | + self.web.about(feedId, function (err, about) { | |
34 | 34 | if (err) return cb(err) |
35 | 35 | 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) | |
38 | 38 | 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) + | |
40 | 44 | '<code class="user-id">' + feedId + '</code></h2>' + |
41 | 45 | u.nav([ |
42 | 46 | [[feedId], req._t('Activity'), 'activity'], |
43 | 47 | [[feedId, 'repos'], req._t('Repos'), 'repos'], |
Built with git-ssb-web