Mercurial > hg-stable
changeset 7408:f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
author | Benoit Allard <benoit@aeteurope.nl> |
---|---|
date | Tue, 25 Nov 2008 22:32:11 +0100 |
parents | 7b2a77b20964 |
children | 0fa3b6677027 |
files | templates/coal/graph.tmpl templates/monoblue/graph.tmpl templates/static/style-coal.css templates/static/style-paper.css |
diffstat | 4 files changed, 50 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/templates/coal/graph.tmpl Tue Nov 25 22:51:10 2008 +0100 +++ b/templates/coal/graph.tmpl Tue Nov 25 22:32:11 2008 +0100 @@ -70,8 +70,7 @@ var revlink = '<li style="_STYLE"><span class="desc">'; revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>'; -revlink += '</span><span class="tag">_TAGS</span>'; -revlink += '<span class="info">_DATE ago, by _USER</span></li>'; +revlink += '</span>_TAGS<span class="info">_DATE ago, by _USER</span></li>'; graph.vertex = function(x, y, color, parity, cur) { @@ -90,8 +89,27 @@ item = item.replace(/_DESC/, cur[3]); item = item.replace(/_USER/, cur[4]); item = item.replace(/_DATE/, cur[5]); - item = item.replace(/_TAGS/, cur[7].join(' ')); + + var tagspan = ''; + if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) { + tagspan = '<span class="logtags">'; + if (cur[6][1]) { + tagspan += '<span class="branchhead" title="' + cur[6][0] + '">'; + tagspan += cur[6][0] + '</span> '; + } else if (!cur[6][1] && cur[6][0] != 'default') { + tagspan += '<span class="branchname" title="' + cur[6][0] + '">'; + tagspan += cur[6][0] + '</span> '; + } + if (cur[7].length) { + for (var t in cur[7]) { + var tag = cur[7][t]; + tagspan += '<span class="tag">' + tag + '</span> '; + } + } + tagspan += '</span>'; + } + item = item.replace(/_TAGS/, tagspan); return [bg, item]; }
--- a/templates/monoblue/graph.tmpl Tue Nov 25 22:51:10 2008 +0100 +++ b/templates/monoblue/graph.tmpl Tue Nov 25 22:32:11 2008 +0100 @@ -59,7 +59,7 @@ var revlink = '<li style="_STYLE"><span class="desc">'; revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>'; - revlink += '</span><span class="info">_DATE ago, by _USER</span></li>'; + revlink += '</span>_TAGS<span class="info">_DATE ago, by _USER</span></li>'; graph.vertex = function(x, y, color, parity, cur) { @@ -79,6 +79,26 @@ item = item.replace(/_USER/, cur[4]); item = item.replace(/_DATE/, cur[5]); + var tagspan = ''; + if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) { + tagspan = '<span class="logtags">'; + if (cur[6][1]) { + tagspan += '<span class="branchtag" title="' + cur[6][0] + '">'; + tagspan += cur[6][0] + '</span> '; + } else if (!cur[6][1] && cur[6][0] != 'default') { + tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">'; + tagspan += cur[6][0] + '</span> '; + } + if (cur[7].length) { + for (var t in cur[7]) { + var tag = cur[7][t]; + tagspan += '<span class="tagtag">' + tag + '</span> '; + } + } + tagspan += '</span>'; + } + + item = item.replace(/_TAGS/, tagspan); return [bg, item]; }