Commit ffa2c61fc246f99bb8e6115e732fbce4bfdd80d4
Indicate forked repo
Charles Lehner committed on 4/4/2016, 9:59:59 PMParent: 5b9b6c8d3576eb860e4d8fb8387f6d31f5467a21
Files changed
index.js | changed |
static/styles.css | changed |
index.js | ||
---|---|---|
@@ -1019,12 +1019,20 @@ | ||
1019 | 1019 | getRepoName(about, repo.feed, repo.id, done()) |
1020 | 1020 | about.getName(repo.feed, done()) |
1021 | 1021 | getVotes(repo.id, done()) |
1022 | 1022 | |
1023 | + if (repo.upstream) { | |
1024 | + getRepoName(about, repo.upstream.feed, repo.upstream.id, done()) | |
1025 | + about.getName(repo.upstream.feed, done()) | |
1026 | + } | |
1027 | + | |
1023 | 1028 | return readNext(function (cb) { |
1024 | - done(function (err, repoName, authorName, votes) { | |
1029 | + done(function (err, repoName, authorName, votes, | |
1030 | + upstreamName, upstreamAuthorName) { | |
1025 | 1031 | if (err) return cb(null, serveError(err)) |
1026 | 1032 | var upvoted = votes.upvoters[myId] > 0 |
1033 | + var upstreamLink = !repo.upstream ? '' : | |
1034 | + link([repo.upstream]) | |
1027 | 1035 | cb(null, serveTemplate(repo.id)(cat([ |
1028 | 1036 | pull.once( |
1029 | 1037 | '<div class="repo-title">' + |
1030 | 1038 | '<form class="right-bar" action="" method="post">' + |
@@ -1043,8 +1051,13 @@ | ||
1043 | 1051 | 'Rename the repo', |
1044 | 1052 | '<h2>' + link([repo.feed], authorName) + ' / ' + |
1045 | 1053 | link([repo.id], repoName) + '</h2>') + |
1046 | 1054 | '</div>' + |
1055 | + (repo.upstream ? | |
1056 | + '<small>forked from ' + | |
1057 | + link([repo.upstream.feed], upstreamAuthorName) + '\'s ' + | |
1058 | + link([repo.upstream.id], upstreamName) + | |
1059 | + '</small>' : '') + | |
1047 | 1060 | nav([ |
1048 | 1061 | [[repo.id], 'Code', 'code'], |
1049 | 1062 | [[repo.id, 'activity'], 'Activity', 'activity'], |
1050 | 1063 | [[repo.id, 'commits', branch || ''], 'Commits', 'commits'], |
Built with git-ssb-web