index.jsView |
---|
993 | 993 | } |
994 | 994 | |
995 | 995 | function serveUserRepos(req, feedId) { |
996 | 996 | return renderUserPage(req, feedId, 'repos', pull( |
997 | | - ssb.messagesByType({ |
998 | | - type: 'git-repo', |
999 | | - reverse: true |
1000 | | - }), |
| 997 | + cat([ |
| 998 | + ssb.messagesByType({ |
| 999 | + type: 'git-update', |
| 1000 | + reverse: true |
| 1001 | + }), |
| 1002 | + ssb.messagesByType({ |
| 1003 | + type: 'git-repo', |
| 1004 | + reverse: true |
| 1005 | + }) |
| 1006 | + ]), |
1001 | 1007 | pull.filter(function (msg) { |
1002 | 1008 | return msg.value.author == feedId |
1003 | 1009 | }), |
| 1010 | + pull.unique(function (msg) { |
| 1011 | + return msg.value.content.repo || msg.key |
| 1012 | + }), |
1004 | 1013 | pull.take(20), |
1005 | 1014 | paramap(function (msg, cb) { |
| 1015 | + var repoId = msg.value.content.repo || msg.key |
1006 | 1016 | var done = multicb({ pluck: 1, spread: true }) |
1007 | | - getRepoName(about, feedId, msg.key, done()) |
1008 | | - getVotes(msg.key, done()) |
| 1017 | + getRepoName(about, feedId, repoId, done()) |
| 1018 | + getVotes(repoId, done()) |
1009 | 1019 | done(function (err, repoName, votes) { |
1010 | 1020 | if (err) return cb(err) |
1011 | 1021 | cb(null, '<section class="collapse">' + |
1012 | 1022 | '<span class="right-bar">' + |
1013 | 1023 | '<i>✌</i> ' + |
1014 | | - link([msg.key, 'digs'], votes.upvotes, true, |
| 1024 | + link([repoId, 'digs'], votes.upvotes, true, |
1015 | 1025 | ' title="' + req._t('Digs') + '"') + |
1016 | 1026 | '</span>' + |
1017 | | - link([msg.key], repoName) + |
| 1027 | + '<strong>' + link([repoId], repoName) + '</strong>' + |
| 1028 | + '<div class="date-info">' + |
| 1029 | + req._t(msg.value.content.type == 'git-update' ? |
| 1030 | + 'UpdatedOnDate' : 'CreatedOnDate', |
| 1031 | + { |
| 1032 | + date: timestamp(msg.value.timestamp, req) |
| 1033 | + }) + '</div>' + |
1018 | 1034 | '</section>') |
1019 | 1035 | }) |
1020 | 1036 | }, 8) |
1021 | 1037 | )) |