git ssb

30+

cel / git-ssb-web



Commit 5d337c4159aafea99132ed379d8507ff68f8f024

Render updates in old schema the same as current

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

Files changed

index.jschanged
locale/en.jsonchanged
locale/eo.jsonchanged
index.jsView
@@ -1464,9 +1464,8 @@
14641464
14651465 var dateStr = new Date(msg.value.timestamp).toLocaleString(req._locale)
14661466 return '<section class="collapse">' +
14671467 link([msg.key], dateStr) + '<br>' +
1468- (numObjects ? req._t('PushedObjects', numObjects) + '<br/>': '') +
14691468 refs.map(function (update) {
14701469 var name = escapeHTML(update.name)
14711470 if (!update.value) {
14721471 return req._t('DeletedBranch', {branch: name})
@@ -1862,66 +1861,54 @@
18621861 }
18631862 }
18641863 }
18651864
1865+ var commits = cat([
1866+ msg.content.objects && pull(
1867+ pull.values(msg.content.objects),
1868+ pull.filter(function (obj) { return obj.type == 'commit' }),
1869+ paramap(function (obj, cb) {
1870+ getBlob(req, obj.link || obj.key, function (err, readObject) {
1871+ if (err) return cb(err)
1872+ Repo.getCommitParsed({read: readObject}, cb)
1873+ })
1874+ }, 8)
1875+ ),
1876+ msg.content.packs && pull(
1877+ pull.values(msg.content.packs),
1878+ paramap(function (pack, cb) {
1879+ var done = multicb({ pluck: 1, spread: true })
1880+ getBlob(req, pack.pack.link, done())
1881+ getBlob(req, pack.idx.link, done())
1882+ done(function (err, readPack, readIdx) {
1883+ if (err) return cb(renderError(err))
1884+ cb(null, gitPack.decodeWithIndex(repo, readPack, readIdx))
1885+ })
1886+ }, 4),
1887+ pull.flatten(),
1888+ pull.asyncMap(function (obj, cb) {
1889+ if (obj.type == 'commit')
1890+ Repo.getCommitParsed(obj, cb)
1891+ else
1892+ pull(obj.read, pull.drain(null, cb))
1893+ }),
1894+ pull.filter()
1895+ )
1896+ ])
1897+
18661898 return renderRepoPage(req, repo, 'activity', null, cat([
1867- pull.values([
1868- '<a href="?raw" class="raw-link header-align">' +
1869- req._t('Data') + '</a>',
1870- '<h3>' + req._t('Update') + '</h3>',
1871- renderRepoUpdate(req, repo, {key: id, value: msg}, true)
1872- ].concat(msg.content.objects ?
1873- ['<h3>' + req._t('Objects') + '</h3>'].concat(
1874- objsArr(msg.content.objects).map(renderObject.bind(null, req)))
1875- : [],
1876- msg.content.packs ? [
1877- '<h3>' + req._t('Packs') + '</h3>'
1878- ].concat(msg.content.packs.map(renderPack.bind(null, req)))
1879- : [])),
1880- msg.content.packs && cat([
1899+ pull.once('<a href="?raw" class="raw-link header-align">' +
1900+ req._t('Data') + '</a>' +
1901+ '<h3>' + req._t('Update') + '</h3>' +
1902+ renderRepoUpdate(req, repo, {key: id, value: msg}, true)),
1903+ (msg.content.objects || msg.content.packs) &&
18811904 pull.once('<h3>' + req._t('Commits') + '</h3>'),
1882- pull(
1883- pull.values(msg.content.packs),
1884- pull.asyncMap(function (pack, cb) {
1885- var done = multicb({ pluck: 1, spread: true })
1886- getBlob(req, pack.pack.link, done())
1887- getBlob(req, pack.idx.link, done())
1888- done(function (err, readPack, readIdx) {
1889- if (err) return cb(renderError(err))
1890- cb(null, gitPack.decodeWithIndex(repo, readPack, readIdx))
1891- })
1892- }),
1893- pull.flatten(),
1894- pull.asyncMap(function (obj, cb) {
1895- if (obj.type == 'commit')
1896- Repo.getCommitParsed(obj, cb)
1897- else
1898- pull(obj.read, pull.drain(null, cb))
1899- }),
1900- pull.filter(),
1901- pull.map(function (commit) {
1902- return renderCommit(req, repo, commit)
1903- })
1904- )
1905- ])
1905+ pull(commits, pull.map(function (commit) {
1906+ return renderCommit(req, repo, commit)
1907+ }))
19061908 ]))
19071909 }
19081910
1909- function renderObject(req, obj) {
1910- return '<section class="collapse">' +
1911- obj.type + ' ' + link([obj.link], obj.sha1) + '<br>' +
1912- req._t('NumBytes', obj.length) +
1913- '</section>'
1914- }
1915-
1916- function renderPack(req, info) {
1917- return '<section class="collapse">' +
1918- (info.pack ? req._t('Pack') + ': ' +
1919- link([info.pack.link]) + '<br>' : '') +
1920- (info.idx ? req._t('Index') + ': ' +
1921- link([info.idx.link]) : '') + '</section>'
1922- }
1923-
19241911 /* Blob */
19251912
19261913 function serveRepoBlob(req, repo, rev, path) {
19271914 return readNext(function (cb) {
locale/en.jsonView
@@ -82,9 +82,8 @@
8282 "View": "View",
8383 "Info": "Info",
8484 "Update": "Update",
8585 "Data": "Data",
86- "Objects": "Objects",
8786 "NumBytes": "%{smart_count} byte |||| %{smart_count} bytes",
8887 "Pack": "Pack",
8988 "Packs": "Packs",
9089 "Index": "Index",
locale/eo.jsonView
@@ -82,9 +82,8 @@
8282 "View": "Vidu",
8383 "Info": "Informo",
8484 "Update": "Ĝisdatigo",
8585 "Data": "Datumo",
86- "Objects": "objektoj",
8786 "NumBytes": "%{smart_count} bajto |||| %{smart_count} bajtojn",
8887 "Pack": "Pako",
8988 "Packs": "Pakoj",
9089 "Index": "Indekso",

Built with git-ssb-web