hgweb: add bookmark labels to gitweb theme (based on
270f57d35525)
--- a/mercurial/templates/gitweb/changelogentry.tmpl Sun Apr 03 23:42:05 2011 +0900
+++ b/mercurial/templates/gitweb/changelogentry.tmpl Sun Apr 03 23:44:28 2011 +0900
@@ -1,5 +1,5 @@
<div>
-<a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}"><span class="age">{date|age}</span>{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
+<a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}"><span class="age">{date|age}</span>{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a>
</div>
<div class="title_text">
<div class="log_link">
--- a/mercurial/templates/gitweb/changeset.tmpl Sun Apr 03 23:42:05 2011 +0900
+++ b/mercurial/templates/gitweb/changeset.tmpl Sun Apr 03 23:44:28 2011 +0900
@@ -26,7 +26,7 @@
</div>
<div>
-<a class="title" href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
+<a class="title" href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a>
</div>
<div class="title_text">
<table cellspacing="0">
--- a/mercurial/templates/gitweb/graph.tmpl Sun Apr 03 23:42:05 2011 +0900
+++ b/mercurial/templates/gitweb/graph.tmpl Sun Apr 03 23:44:28 2011 +0900
@@ -85,7 +85,7 @@
item = item.replace(/_DATE/, cur[5]);
var tagspan = '';
- if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) \{
+ if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) \{
tagspan = '<span class="logtags">';
if (cur[6][1]) \{
tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
@@ -100,6 +100,12 @@
tagspan += '<span class="tagtag">' + tag + '</span> ';
}
}
+ if (cur[8].length) \{
+ for (var t in cur[8]) \{
+ var bookmark = cur[8][t];
+ tagspan += '<span class="bookmarktag">' + bookmark + '</span> ';
+ }
+ }
tagspan += '</span>';
}
--- a/mercurial/templates/gitweb/manifest.tmpl Sun Apr 03 23:42:05 2011 +0900
+++ b/mercurial/templates/gitweb/manifest.tmpl Sun Apr 03 23:44:28 2011 +0900
@@ -24,7 +24,7 @@
<br/>
</div>
-<div class="title">{path|escape} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></div>
+<div class="title">{path|escape} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></div>
<table cellspacing="0">
<tr class="parity{upparity}">
<td style="font-family:monospace">drwxr-xr-x</td>
--- a/mercurial/templates/gitweb/map Sun Apr 03 23:42:05 2011 +0900
+++ b/mercurial/templates/gitweb/map Sun Apr 03 23:44:28 2011 +0900
@@ -214,6 +214,7 @@
tagtag = '<span class="tagtag" title="{name}">{name}</span> '
branchtag = '<span class="branchtag" title="{name}">{name}</span> '
inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> '
+bookmarktag = '<span class="bookmarktag" title="{name}">{name}</span> '
shortlogentry = '
<tr class="parity{parity}">
<td class="age"><i>{date|age}</i></td>
@@ -221,7 +222,7 @@
<td>
<a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">
<b>{desc|strip|firstline|escape|nonempty}</b>
- <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span>
+ <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span>
</a>
</td>
<td class="link" nowrap>
--- a/mercurial/templates/static/style-gitweb.css Sun Apr 03 23:42:05 2011 +0900
+++ b/mercurial/templates/static/style-gitweb.css Sun Apr 03 23:44:28 2011 +0900
@@ -80,6 +80,10 @@
background-color: #d5dde6;
border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4;
}
+span.logtags span.bookmarktag {
+ background-color: #afdffa;
+ border-color: #ccecff #46ace6 #46ace6 #ccecff;
+}
/* Graph */
div#wrapper {
--- a/tests/test-hgweb-commands.t Sun Apr 03 23:42:05 2011 +0900
+++ b/tests/test-hgweb-commands.t Sun Apr 03 23:44:28 2011 +0900
@@ -662,7 +662,7 @@
<td>
<a class="list" href="/rev/1d22e65f027e?style=gitweb">
<b>branch</b>
- <span class="logtags"><span class="branchtag" title="stable">stable</span> <span class="tagtag" title="tip">tip</span> </span>
+ <span class="logtags"><span class="branchtag" title="stable">stable</span> <span class="tagtag" title="tip">tip</span> <span class="bookmarktag" title="something">something</span> </span>
</a>
</td>
<td class="link" nowrap>
@@ -853,7 +853,7 @@
item = item.replace(/_DATE/, cur[5]);
var tagspan = '';
- if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
+ if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) {
tagspan = '<span class="logtags">';
if (cur[6][1]) {
tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
@@ -868,6 +868,12 @@
tagspan += '<span class="tagtag">' + tag + '</span> ';
}
}
+ if (cur[8].length) {
+ for (var t in cur[8]) {
+ var bookmark = cur[8][t];
+ tagspan += '<span class="bookmarktag">' + bookmark + '</span> ';
+ }
+ }
tagspan += '</span>';
}
--- a/tests/test-hgweb.t Sun Apr 03 23:42:05 2011 +0900
+++ b/tests/test-hgweb.t Sun Apr 03 23:44:28 2011 +0900
@@ -383,6 +383,10 @@
background-color: #d5dde6;
border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4;
}
+ span.logtags span.bookmarktag {
+ background-color: #afdffa;
+ border-color: #ccecff #46ace6 #46ace6 #ccecff;
+ }
/* Graph */
div#wrapper {