Mercurial > hg > mercurial-source
changeset 13794:5c18a0bca26f stable
hgweb: add bookmark labels to monoblue theme (based on 270f57d35525)
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 30 Mar 2011 02:22:15 +0900 |
parents | 794f4476b974 |
children | 0bc7b1661177 c5709dfa5c1e 2347feb35691 |
files | mercurial/hgweb/webcommands.py mercurial/templates/monoblue/changelogentry.tmpl mercurial/templates/monoblue/changeset.tmpl mercurial/templates/monoblue/graph.tmpl mercurial/templates/monoblue/manifest.tmpl mercurial/templates/monoblue/map mercurial/templates/static/style-monoblue.css |
diffstat | 7 files changed, 21 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -159,6 +159,7 @@ rev=ctx.rev(), node=hex(n), tags=webutil.nodetagsdict(web.repo, n), + bookmarks=webutil.nodebookmarksdict(web.repo, n), inbranch=webutil.nodeinbranch(web.repo, ctx), branches=webutil.nodebranchdict(web.repo, ctx)) @@ -362,6 +363,7 @@ dentries=dirlist, archives=web.archivelist(hex(node)), tags=webutil.nodetagsdict(web.repo, node), + bookmarks=webutil.nodebookmarksdict(web.repo, node), inbranch=webutil.nodeinbranch(web.repo, ctx), branches=webutil.nodebranchdict(web.repo, ctx)) @@ -490,6 +492,7 @@ rev=i, node=hn, tags=webutil.nodetagsdict(web.repo, n), + bookmarks=webutil.nodebookmarksdict(web.repo, n), inbranch=webutil.nodeinbranch(web.repo, ctx), branches=webutil.nodebranchdict(web.repo, ctx))) @@ -651,6 +654,8 @@ "child": webutil.children(iterfctx), "desc": iterfctx.description(), "tags": webutil.nodetagsdict(repo, iterfctx.node()), + "bookmarks": webutil.nodebookmarksdict( + repo, iterfctx.node()), "branch": webutil.nodebranchnodefault(iterfctx), "inbranch": webutil.nodeinbranch(repo, iterfctx), "branches": webutil.nodebranchdict(repo, iterfctx)})
--- a/mercurial/templates/monoblue/changelogentry.tmpl +++ b/mercurial/templates/monoblue/changelogentry.tmpl @@ -1,4 +1,4 @@ -<h3 class="changelog"><a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3> +<h3 class="changelog"><a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3> <ul class="changelog-entry"> <li class="age">{date|age}</li> <li>by <span class="name">{author|obfuscate}</span> <span class="revdate">[{date|rfc822date}] rev {rev}</span></li>
--- a/mercurial/templates/monoblue/changeset.tmpl +++ b/mercurial/templates/monoblue/changeset.tmpl @@ -36,7 +36,7 @@ <h2 class="no-link no-border">changeset</h2> - <h3 class="changeset"><a href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3> + <h3 class="changeset"><a href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3> <p class="changeset-age"><span>{date|age}</span></p> <dl class="overview">
--- a/mercurial/templates/monoblue/graph.tmpl +++ b/mercurial/templates/monoblue/graph.tmpl @@ -82,7 +82,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] + '">'; @@ -97,6 +97,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/monoblue/manifest.tmpl +++ b/mercurial/templates/monoblue/manifest.tmpl @@ -35,7 +35,7 @@ </ul> <h2 class="no-link no-border">files</h2> - <p class="files">{path|escape} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></p> + <p class="files">{path|escape} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></p> <table> <tr class="parity{upparity}">
--- a/mercurial/templates/monoblue/map +++ b/mercurial/templates/monoblue/map @@ -180,6 +180,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="nowrap">{date|age}</td> @@ -187,7 +188,7 @@ <td> <a href="{url}rev/{node|short}{sessionvars%urlparameter}"> {desc|strip|firstline|escape|nonempty} - <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="nowrap">
--- a/mercurial/templates/static/style-monoblue.css +++ b/mercurial/templates/static/style-monoblue.css @@ -246,6 +246,10 @@ background-color: #d5dde6; border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4; } +span.logtags span.bookmarktag { + background-color: #afdffa; + border-color: #ccecff #46ace6 #46ace6 #ccecff; +} div.diff pre { margin: 10px 0 0 0;