Include links to source trees on the release index page

For each release tag link to the gitiles tag object URL,
making it easy to view the tag metadata (tagger, date)
and browse the source tree for that release binary.

Change-Id: I1d6c973bef21ba93afd386cee4405dc1a399db30
This commit is contained in:
Shawn Pearce
2013-07-08 11:39:51 -07:00
parent 15307d7b1e
commit 429eed3ba9

View File

@@ -45,6 +45,7 @@ function(data) {
var frg = doc.createDocumentFragment();
var rx = /^gerrit(?:-full)?-([0-9.]+(?:-rc[0-9]+)?)[.]war/;
var rel = 'http://gerrit-documentation.googlecode.com/svn/ReleaseNotes/';
var src = 'https://gerrit.googlesource.com/gerrit/+/'
data.items.sort(function(a,b) {
var av = rx.exec(a.name);
@@ -100,6 +101,16 @@ function(data) {
td.appendChild(a);
tr.appendChild(td);
td = doc.createElement('td');
td.className = 'size';
if (f.size/(1024*1024) < 1) {
sizeText = Math.round(f.size/1024*10)/10 + ' KiB';
} else {
sizeText = Math.round(f.size/(1024*1024)*10)/10 + ' MiB';
}
td.appendChild(doc.createTextNode(sizeText));
tr.appendChild(td);
td = doc.createElement('td');
if (v && f.name.indexOf('-rc') < 0) {
a = doc.createElement('a');
@@ -110,13 +121,12 @@ function(data) {
tr.appendChild(td);
td = doc.createElement('td');
td.className = 'size';
if (f.size/(1024*1024) < 1) {
sizeText = Math.round(f.size/1024*10)/10 + ' KiB';
} else {
sizeText = Math.round(f.size/(1024*1024)*10)/10 + ' MiB';
if (v) {
a = doc.createElement('a');
a.href = src + 'v' + v[1];
a.appendChild(doc.createTextNode('src'));
td.appendChild(a);
}
td.appendChild(doc.createTextNode(sizeText));
tr.appendChild(td);
frg.appendChild(tr);
@@ -127,13 +137,13 @@ function(data) {
th.appendChild(doc.createTextNode('File'));
tr.appendChild(th);
th = doc.createElement('th');
tr.appendChild(th);
th = doc.createElement('th');
th.appendChild(doc.createTextNode('Size'));
tr.appendChild(th);
tr.appendChild(doc.createElement('th'));
tr.appendChild(doc.createElement('th'));
var table = doc.createElement('table');
table.appendChild(tr);
table.appendChild(frg);