git ssb

30+

cel / git-ssb-web



Commit 26e05692a6d576fbcd9a6e5099e11a1bd9e19f94

Fix rendering new pack/index updates

Charles Lehner committed on 3/22/2016, 5:16:17 AM
Parent: d2a325d379d224a5e19659923b01482d3c72aa21

Files changed

index.jschanged
index.jsView
@@ -779,8 +779,19 @@
779779 }
780780
781781 function serveRepoUpdate(req, repo, id, msg, path) {
782782 var raw = String(req._u.query).split('&').indexOf('raw') > -1
783+
784+ // convert packs to old single-object style
785+ if (msg.content.indexes) {
786+ for (var i = 0; i < msg.content.indexes.length; i++) {
787+ msg.content.packs[i] = {
788+ pack: {link: msg.content.packs[i].link},
789+ idx: msg.content.indexes[i]
790+ }
791+ }
792+ }
793+
783794 return renderRepoPage(repo, null, pull.once(
784795 (raw ? '<a href="?" class="raw-link">Info</a>' :
785796 '<a href="?raw" class="raw-link">Data</a>') +
786797 '<h3>Update</h3>' +
@@ -800,10 +811,10 @@
800811 }
801812
802813 function renderPack(info) {
803814 return '<section class="collapse">' +
804- 'Pack: ' + link([info.pack.link]) + '<br>' +
805- 'Index: ' + link([info.idx.link]) + '</section>'
815+ (info.pack ? 'Pack: ' + link([info.pack.link]) + '<br>' : '') +
816+ (info.idx ? 'Index: ' + link([info.idx.link]) : '') + '</section>'
806817 }
807818
808819 /* Blob */
809820

Built with git-ssb-web