git ssb

30+

cel / git-ssb-web



Commit aaef5b5d2d7ccda76e171130105d706fe7f9d49e

Add tag page

Charles Lehner committed on 4/21/2016, 2:33:01 AM
Parent: bcc4c3555e43a5f9cb02b98de559a806dce9b933

Files changed

index.jschanged
locale/en.jsonchanged
locale/eo.jsonchanged
package.jsonchanged
index.jsView
@@ -1220,8 +1220,10 @@
12201220 case 'commits':
12211221 return serveRepoCommits(req, repo, branch)
12221222 case 'commit':
12231223 return serveRepoCommit(req, repo, path[1])
1224+ case 'tag':
1225+ return serveRepoTag(req, repo, branch)
12241226 case 'tree':
12251227 return serveRepoTree(req, repo, branch, filePath)
12261228 case 'blob':
12271229 return serveRepoBlob(req, repo, branch, filePath)
@@ -1694,8 +1696,31 @@
16941696 })
16951697 ]))
16961698 }
16971699
1700+ /* Repo tag */
1701+
1702+ function serveRepoTag(req, repo, rev) {
1703+ return renderRepoPage(req, repo, 'tags', rev, readNext(function (cb) {
1704+ repo.getTagParsed(rev, function (err, tag) {
1705+ if (err) return cb(err)
1706+ var body = (tag.title + '\n\n' +
1707+ tag.body.replace(/-----BEGIN PGP SIGNATURE-----\n[^.]*?\n-----END PGP SIGNATURE-----\s*$/, '')).trim()
1708+ cb(null, pull.once(
1709+ '<section class="collapse">' +
1710+ '<h3>' + link([repo.id, 'tag', rev], tag.tag) + '</h3>' +
1711+ req._t('TaggedOn', {
1712+ name: escapeHTML(tag.tagger.name),
1713+ date: tag.tagger.date.toLocaleString(req._locale)
1714+ }) + '<br/>' +
1715+ link([repo.id, tag.type, tag.object]) +
1716+ linkify(pre(body)) +
1717+ '</section>'))
1718+ })
1719+ }))
1720+ }
1721+
1722+
16981723 /* Diff stat */
16991724
17001725 function renderDiffStat(req, repos, treeIds) {
17011726 if (treeIds.length == 0) treeIds = [null]
locale/en.jsonView
@@ -60,8 +60,9 @@
6060 "PushedObjects": "Pushed %{smart_count} object |||| Pushed %{smart_count} objects",
6161 "DeletedBranch": "Deleted %{branch}",
6262 "AuthoredOn": "%{name} authored on %{date}",
6363 "CommittedOn": "%{name} committed on %{date}",
64+ "TaggedOn": "%{name} tagged on %{date}",
6465 "Branches": "Branches",
6566 "Tags": "Tags",
6667 "Go": "Go",
6768 "Latest": "Latest",
locale/eo.jsonView
@@ -60,8 +60,9 @@
6060 "PushedObjects": "Puŝis %{smart_count} objektoj |||| Puŝis %{smart_count} objekto",
6161 "DeletedBranch": "Forviis %{branch}",
6262 "AuthoredOn": "%{name} aŭtoris je %{date}",
6363 "CommittedOn": "%{name} enmetis je %{date}",
64+ "TaggedOn": "%{name} etikedis je %{date}",
6465 "Branches": "Branĉoj",
6566 "Tags": "Etikedoj",
6667 "Go": "Iri",
6768 "Latest": "Aktuala",
package.jsonView
@@ -10,9 +10,9 @@
1010 "multicb": "^1.2.1",
1111 "node-polyglot": "^1.0.0",
1212 "pull-cat": "^1.1.8",
1313 "pull-git-pack": "^0.2.0",
14- "pull-git-repo": "^0.4.0",
14+ "pull-git-repo": "^0.4.1",
1515 "pull-many": "^1.0.6",
1616 "pull-paramap": "^1.1.2",
1717 "pull-stream": "^3.1.0",
1818 "ssb-client": "^3.0.1",

Built with git-ssb-web