Commit aaef5b5d2d7ccda76e171130105d706fe7f9d49e
Add tag page
Charles Lehner committed on 4/21/2016, 2:33:01 AMParent: bcc4c3555e43a5f9cb02b98de559a806dce9b933
Files changed
index.js | changed |
locale/en.json | changed |
locale/eo.json | changed |
package.json | changed |
index.js | ||
---|---|---|
@@ -1220,8 +1220,10 @@ | ||
1220 | 1220 | case 'commits': |
1221 | 1221 | return serveRepoCommits(req, repo, branch) |
1222 | 1222 | case 'commit': |
1223 | 1223 | return serveRepoCommit(req, repo, path[1]) |
1224 | + case 'tag': | |
1225 | + return serveRepoTag(req, repo, branch) | |
1224 | 1226 | case 'tree': |
1225 | 1227 | return serveRepoTree(req, repo, branch, filePath) |
1226 | 1228 | case 'blob': |
1227 | 1229 | return serveRepoBlob(req, repo, branch, filePath) |
@@ -1694,8 +1696,31 @@ | ||
1694 | 1696 | }) |
1695 | 1697 | ])) |
1696 | 1698 | } |
1697 | 1699 | |
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 | + | |
1698 | 1723 | /* Diff stat */ |
1699 | 1724 | |
1700 | 1725 | function renderDiffStat(req, repos, treeIds) { |
1701 | 1726 | if (treeIds.length == 0) treeIds = [null] |
locale/en.json | ||
---|---|---|
@@ -60,8 +60,9 @@ | ||
60 | 60 | "PushedObjects": "Pushed %{smart_count} object |||| Pushed %{smart_count} objects", |
61 | 61 | "DeletedBranch": "Deleted %{branch}", |
62 | 62 | "AuthoredOn": "%{name} authored on %{date}", |
63 | 63 | "CommittedOn": "%{name} committed on %{date}", |
64 | + "TaggedOn": "%{name} tagged on %{date}", | |
64 | 65 | "Branches": "Branches", |
65 | 66 | "Tags": "Tags", |
66 | 67 | "Go": "Go", |
67 | 68 | "Latest": "Latest", |
locale/eo.json | ||
---|---|---|
@@ -60,8 +60,9 @@ | ||
60 | 60 | "PushedObjects": "Puŝis %{smart_count} objektoj |||| Puŝis %{smart_count} objekto", |
61 | 61 | "DeletedBranch": "Forviis %{branch}", |
62 | 62 | "AuthoredOn": "%{name} aŭtoris je %{date}", |
63 | 63 | "CommittedOn": "%{name} enmetis je %{date}", |
64 | + "TaggedOn": "%{name} etikedis je %{date}", | |
64 | 65 | "Branches": "Branĉoj", |
65 | 66 | "Tags": "Etikedoj", |
66 | 67 | "Go": "Iri", |
67 | 68 | "Latest": "Aktuala", |
package.json | ||
---|---|---|
@@ -10,9 +10,9 @@ | ||
10 | 10 | "multicb": "^1.2.1", |
11 | 11 | "node-polyglot": "^1.0.0", |
12 | 12 | "pull-cat": "^1.1.8", |
13 | 13 | "pull-git-pack": "^0.2.0", |
14 | - "pull-git-repo": "^0.4.0", | |
14 | + "pull-git-repo": "^0.4.1", | |
15 | 15 | "pull-many": "^1.0.6", |
16 | 16 | "pull-paramap": "^1.1.2", |
17 | 17 | "pull-stream": "^3.1.0", |
18 | 18 | "ssb-client": "^3.0.1", |
Built with git-ssb-web