git ssb

30+

cel / git-ssb-web



Commit 331134d819b7f08faeca563b32328e8554cf98a6

Update user repos list

- Sort by time updated
- Show repo update/create time
Charles Lehner committed on 4/17/2016, 4:29:25 PM
Parent: efe6afd51c3ed335947c0590e4404318c83e0825

Files changed

index.jschanged
locale/en.jsonchanged
locale/eo.jsonchanged
static/styles.csschanged
index.jsView
@@ -993,29 +993,45 @@
993993 }
994994
995995 function serveUserRepos(req, feedId) {
996996 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+ ]),
10011007 pull.filter(function (msg) {
10021008 return msg.value.author == feedId
10031009 }),
1010+ pull.unique(function (msg) {
1011+ return msg.value.content.repo || msg.key
1012+ }),
10041013 pull.take(20),
10051014 paramap(function (msg, cb) {
1015+ var repoId = msg.value.content.repo || msg.key
10061016 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())
10091019 done(function (err, repoName, votes) {
10101020 if (err) return cb(err)
10111021 cb(null, '<section class="collapse">' +
10121022 '<span class="right-bar">' +
10131023 '<i>✌</i> ' +
1014- link([msg.key, 'digs'], votes.upvotes, true,
1024+ link([repoId, 'digs'], votes.upvotes, true,
10151025 ' title="' + req._t('Digs') + '"') +
10161026 '</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>' +
10181034 '</section>')
10191035 })
10201036 }, 8)
10211037 ))
locale/en.jsonView
@@ -29,8 +29,10 @@
2929 "OpenedIssue": "%{name} opened %{type} %{title} on %{project}",
3030 "Named": "%{author} named %{target} %{name}",
3131 "Activity": "Activity",
3232 "Repos": "Repos",
33+ "UpdatedOnDate": "Updated %{date}",
34+ "CreatedOnDate": "Created %{date}",
3335 "Dig": "Dig",
3436 "Undig": "Undig",
3537 "Fork": "Fork",
3638 "Forks": "Forks",
locale/eo.jsonView
@@ -29,8 +29,10 @@
2929 "OpenedIssue": "%{name} malfermiĝis %{type} %{title} sur %{project}",
3030 "Named": "%{author} nomis %{target} %{name}",
3131 "Activity": "Aktivaĵo",
3232 "Repos": "Deponejoj",
33+ "UpdatedOnDate": "Ĝisdatigis je %{date}",
34+ "CreatedOnDate": "Kreis je %{date}",
3335 "Dig": "Digi",
3436 "Undig": "Maldigi",
3537 "Fork": "Forki",
3638 "Forks": "Forkoj",
static/styles.cssView
@@ -410,9 +410,9 @@
410410 .compare-commits {
411411 width: 100%;
412412 }
413413
414-.compare-commits .date-info {
414+.date-info {
415415 font-weight: normal;
416416 text-align: left;
417417 color: #666;
418418 }

Built with git-ssb-web