lib/repos/index.jsView |
---|
37 | 37 … | u.readObjectString(obj, cb) |
38 | 38 … | }) |
39 | 39 … | } |
40 | 40 … | |
41 | | -function ul(props) { |
42 | | - return function (read) { |
43 | | - return cat([ |
44 | | - pull.once('<ul' + (props ? ' ' + props : '') + '>'), |
45 | | - pull(read, pull.map(function (li) { return '<li>' + li + '</li>' })), |
46 | | - pull.once('</ul>') |
47 | | - ]) |
48 | | - } |
49 | | -} |
50 | | - |
51 | 41 … | |
52 | 42 … | |
53 | 43 … | R.serveRepoPage = function (req, repo, path) { |
54 | 44 … | var self = this |
495 | 485 … | ': ' + linkPath([repo.id, 'tree'], [rev].concat(path)) |
496 | 486 … | |
497 | 487 … | var location = once('') |
498 | 488 … | if (path.length !== 0) { |
499 | | - var link = linkPath([repo.id, 'tree'], [rev].concat(path)) |
| 489 … | + var link = linkPath([repo.id, 'tree'], [rev].concat(path)) |
500 | 490 … | location = h('div', {class: 'fileLocation'}, `${req._t('Files')}: ${link}`) |
501 | 491 … | } |
502 | 492 … | |
503 | 493 … | return cat([ |
905 | 895 … | } |
906 | 896 … | |
907 | 897 … | |
908 | 898 … | |
909 | | -R.serveRepoDigs = function (req, repo) { |
| 899 … | +R.serveRepoDigs = function serveRepoDigs (req, repo) { |
910 | 900 … | var self = this |
911 | | - return u.readNext(function (cb) { |
912 | | - var title = req._t('Digs') + ' · %{author}/%{repo}' |
913 | | - self.web.getVotes(repo.id, function (err, votes) { |
914 | | - cb(null, self.renderRepoPage(req, repo, null, null, title, cat([ |
915 | | - pull.once('<section><h3>' + req._t('Digs') + '</h3>' + |
916 | | - '<div>' + req._t('Total') + ': ' + votes.upvotes + '</div>'), |
917 | | - pull( |
918 | | - pull.values(Object.keys(votes.upvoters)), |
919 | | - paramap(function (feedId, cb) { |
920 | | - self.web.about.getName(feedId, function (err, name) { |
921 | | - if (err) return cb(err) |
922 | | - cb(null, u.link([feedId], name)) |
| 901 … | + return u.readNext(cb => { |
| 902 … | + var title = req._t('Digs') + ' · %{author}/%{repo}' |
| 903 … | + self.web.getVotes(repo.id, (err, votes) => { |
| 904 … | + cb(null, self.renderRepoPage(req, repo, null, null, title, |
| 905 … | + h('section', [ |
| 906 … | + h('h3', req._t('Digs')), |
| 907 … | + h('div', `${req._t('Total')}: ${votes.upvotes}`), |
| 908 … | + h('ul', u.paraSourceMap(Object.keys(votes.upvoters), (feedId, cb) => { |
| 909 … | + self.web.about.getName(feedId, (err, name) => { |
| 910 … | + cb(null, h('li', u.link([feedId], name))) |
923 | 911 … | }) |
924 | | - }, 8), |
925 | | - ul() |
926 | | - ), |
927 | | - pull.once('</section>') |
928 | | - ]))) |
| 912 … | + })) |
| 913 … | + ]) |
| 914 … | + )) |
929 | 915 … | }) |
930 | 916 … | }) |
931 | 917 … | } |
932 | 918 … | |