git ssb

30+

cel / git-ssb-web



Commit ab6364c716e5a9bc4c49bafc0c42c0c8c2e4e40a

Linkify message dates in feeds

cel committed on 11/5/2016, 12:01:12 AM
Parent: 8acc1d1aa35122646294a41cd1ec6fa54f18baad

Files changed

index.jschanged
index.jsView
@@ -559,8 +559,9 @@
559559 G.renderFeedItem = function (req, msg, cb) {
560560 var self = this
561561 var c = msg.value.content
562562 var msgDate = moment(new Date(msg.value.timestamp)).fromNow()
563 + var msgDateLink = u.link([msg.key], msgDate, false, 'class="date"')
563564 var author = msg.value.author
564565 var authorLink = u.link([msg.value.author], msg.authorName)
565566 switch (c.type) {
566567 case 'git-repo':
@@ -575,9 +576,9 @@
575576 req._t('Forked', {
576577 name: authorLink,
577578 upstream: u.link([c.upstream], upstreamName),
578579 repo: u.link([msg.key], repoName)
579- }) + ' <span class="date">' + msgDate + '</span></section>')
580 + }) + ' ' + msgDateLink + '</section>')
580581 })
581582 })
582583 } else {
583584 return done(function (err, repoName) {
@@ -586,9 +587,9 @@
586587 cb(null, '<section class="collapse">' +
587588 req._t('CreatedRepo', {
588589 name: authorLink,
589590 repo: repoLink
590- }) + ' <span class="date">' + msgDate + '</span></section>')
591 + }) + ' ' + msgDateLink + '</section>')
591592 })
592593 }
593594 case 'git-update':
594595 return self.getRepoName(author, c.repo, function (err, repoName) {
@@ -597,9 +598,9 @@
597598 cb(null, '<section class="collapse">' +
598599 req._t('Pushed', {
599600 name: authorLink,
600601 repo: repoLink
601- }) + ' <span class="date">' + msgDate + '</span></section>')
602 + }) + ' ' + msgDateLink + '</section>')
602603 })
603604 case 'issue':
604605 case 'pull-request':
605606 var issueLink = u.link([msg.key], u.messageTitle(msg))
@@ -616,9 +617,9 @@
616617 type: req._t(c.type == 'pull-request' ?
617618 'pull request' : 'issue.'),
618619 title: issueLink,
619620 project: repoLink
620- }) + ' <span class="date">' + msgDate + '</span></section>')
621 + }) + ' ' + msgDateLink + '</section>')
621622 })
622623 })
623624 case 'about':
624625 return cb(null, '<section class="collapse">' +

Built with git-ssb-web