##// END OF EJS Templates
gitweb: Display branch and tag labels...
Josef "Jeff" Sipek -
r4538:4272ae76 default
parent child Browse files
Show More
@@ -133,6 +133,16 b' class hgweb(object):'
133 return [dict(file=r[0], node=hex(r[1]))]
133 return [dict(file=r[0], node=hex(r[1]))]
134 return []
134 return []
135
135
136 def taglistdict(self,node):
137 return [{"name":i} for i in self.repo.nodetags(node)]
138
139 def branchlistdict(self,node):
140 l=[]
141 for t, tn in self.repo.branchtags().items():
142 if tn == node:
143 l.append({"name":t})
144 return l
145
136 def showtag(self, t1, node=nullid, **args):
146 def showtag(self, t1, node=nullid, **args):
137 for t in self.repo.nodetags(node):
147 for t in self.repo.nodetags(node):
138 yield self.t(t1, tag=t, **args)
148 yield self.t(t1, tag=t, **args)
@@ -211,7 +221,9 b' class hgweb(object):'
211 "date": ctx.date(),
221 "date": ctx.date(),
212 "files": self.listfilediffs(ctx.files(), n),
222 "files": self.listfilediffs(ctx.files(), n),
213 "rev": i,
223 "rev": i,
214 "node": hex(n)})
224 "node": hex(n),
225 "tags": self.taglistdict(n),
226 "branches": self.branchlistdict(n)})
215
227
216 for e in l:
228 for e in l:
217 yield e
229 yield e
@@ -274,7 +286,9 b' class hgweb(object):'
274 date=ctx.date(),
286 date=ctx.date(),
275 files=self.listfilediffs(ctx.files(), n),
287 files=self.listfilediffs(ctx.files(), n),
276 rev=ctx.rev(),
288 rev=ctx.rev(),
277 node=hex(n))
289 node=hex(n),
290 tags=self.taglistdict(n),
291 branches=self.branchlistdict(n))
278
292
279 if count >= self.maxchanges:
293 if count >= self.maxchanges:
280 break
294 break
@@ -314,7 +328,9 b' class hgweb(object):'
314 desc=ctx.description(),
328 desc=ctx.description(),
315 date=ctx.date(),
329 date=ctx.date(),
316 files=files,
330 files=files,
317 archives=self.archivelist(hex(n)))
331 archives=self.archivelist(hex(n)),
332 tags=self.taglistdict(n),
333 branches=self.branchlistdict(n))
318
334
319 def filelog(self, fctx):
335 def filelog(self, fctx):
320 f = fctx.path()
336 f = fctx.path()
@@ -482,7 +498,9 b' class hgweb(object):'
482 upparity=parity.next(),
498 upparity=parity.next(),
483 fentries=filelist,
499 fentries=filelist,
484 dentries=dirlist,
500 dentries=dirlist,
485 archives=self.archivelist(hex(node)))
501 archives=self.archivelist(hex(node)),
502 tags=self.taglistdict(node),
503 branches=self.branchlistdict(node))
486
504
487 def tags(self):
505 def tags(self):
488 i = self.repo.tagslist()
506 i = self.repo.tagslist()
@@ -545,7 +563,8 b' class hgweb(object):'
545 l = [] # build a list in forward order for efficiency
563 l = [] # build a list in forward order for efficiency
546 for i in xrange(start, end):
564 for i in xrange(start, end):
547 ctx = self.repo.changectx(i)
565 ctx = self.repo.changectx(i)
548 hn = hex(ctx.node())
566 n = ctx.node()
567 hn = hex(n)
549
568
550 l.insert(0, self.t(
569 l.insert(0, self.t(
551 'shortlogentry',
570 'shortlogentry',
@@ -554,7 +573,9 b' class hgweb(object):'
554 desc=ctx.description(),
573 desc=ctx.description(),
555 date=ctx.date(),
574 date=ctx.date(),
556 rev=i,
575 rev=i,
557 node=hn))
576 node=hn,
577 tags=self.taglistdict(n),
578 branches=self.branchlistdict(n)))
558
579
559 yield l
580 yield l
560
581
@@ -1,5 +1,5 b''
1 <div>
1 <div>
2 <a class="title" href="{url}rev/#node|short#{sessionvars%urlparameter}"><span class="age">#date|age# ago</span>#desc|strip|firstline|escape#</a>
2 <a class="title" href="{url}rev/#node|short#{sessionvars%urlparameter}"><span class="age">#date|age# ago</span>#desc|strip|firstline|escape#<span class="logtags"> {branches%branchtag}{tags%tagtag}</span></a>
3 </div>
3 </div>
4 <div class="title_text">
4 <div class="title_text">
5 <div class="log_link">
5 <div class="log_link">
@@ -14,7 +14,7 b''
14 </div>
14 </div>
15
15
16 <div>
16 <div>
17 <a class="title" href="{url}raw-rev/#node|short#">#desc|strip|escape|firstline#</a>
17 <a class="title" href="{url}raw-rev/#node|short#">#desc|strip|escape|firstline# <span class="logtags">{branches%branchtag}{tags%tagtag}</span></a>
18 </div>
18 </div>
19 <div class="title_text">
19 <div class="title_text">
20 <table cellspacing="0">
20 <table cellspacing="0">
@@ -23,7 +23,6 b''
23 <tr><td>changeset {rev}</td><td style="font-family:monospace">{node|short}</td></tr>
23 <tr><td>changeset {rev}</td><td style="font-family:monospace">{node|short}</td></tr>
24 #parent%changesetparent#
24 #parent%changesetparent#
25 #child%changesetchild#
25 #child%changesetchild#
26 #changesettag#
27 </table></div>
26 </table></div>
28
27
29 <div class="page_body">
28 <div class="page_body">
@@ -18,7 +18,7 b' manifest |'
18 <a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> #archives%archiveentry#<br/>
18 <a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> #archives%archiveentry#<br/>
19 </div>
19 </div>
20
20
21 <div class="title" >#path|escape#</div>
21 <div class="title">#path|escape# <span class="logtags">{branches%branchtag}{tags%tagtag}</span></div>
22 <table cellspacing="0">
22 <table cellspacing="0">
23 <tr class="parity#upparity#">
23 <tr class="parity#upparity#">
24 <td style="font-family:monospace">drwxr-xr-x</td>
24 <td style="font-family:monospace">drwxr-xr-x</td>
@@ -41,14 +41,14 b' tags = tags.tmpl'
41 tagentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>#tag|escape#</b></a></td><td class="link"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/#node|short#{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>'
41 tagentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>#tag|escape#</b></a></td><td class="link"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/#node|short#{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>'
42 branchentry = '<tr class="parity{parity}"><td class="age"><i>{date|age} ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></td><td>{branch|escape}</td><td class="link"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/{node|short}{sessionvars%urlparameter}">manifest</a></td></tr>'
42 branchentry = '<tr class="parity{parity}"><td class="age"><i>{date|age} ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></td><td>{branch|escape}</td><td class="link"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/{node|short}{sessionvars%urlparameter}">manifest</a></td></tr>'
43 diffblock = '<pre>#lines#</pre>'
43 diffblock = '<pre>#lines#</pre>'
44 changelogtag = '<tr><th class="tag">tag:</th><td class="tag">#tag|escape#</td></tr>'
45 changesettag = '<tr><td>tag</td><td>#tag|escape#</td></tr>'
46 filediffparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
44 filediffparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
47 filelogparent = '<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="{url}file/{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
45 filelogparent = '<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="{url}file/{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
48 filediffchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
46 filediffchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
49 filelogchild = '<tr><td align="right">child #rev#:&nbsp;</td><td><a href="{url}file{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
47 filelogchild = '<tr><td align="right">child #rev#:&nbsp;</td><td><a href="{url}file{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
50 shortlog = shortlog.tmpl
48 shortlog = shortlog.tmpl
51 shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author|obfuscate#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>'
49 tagtag = '<span class="tagtag" title="{name}">{name}</span> '
50 branchtag = '<span class="branchtag" title="{name}">{name}</span> '
51 shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b> <span class="logtags">{branches%branchtag}{tags%tagtag}</span></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>'
52 filelogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>'
52 filelogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>'
53 archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> '
53 archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> '
54 indexentry = '<tr class="parity#parity#"><td><a class="list" href="#url#{sessionvars%urlparameter}"><b>#name|escape#</b></a></td><td>#description#</td><td>#contact|obfuscate#</td><td class="age">#lastchange|age# ago</td><td class="indexlinks"><a class="rss_logo" href="#url#rss-log">RSS</a> #archives%archiveentry#</td></tr>'
54 indexentry = '<tr class="parity#parity#"><td><a class="list" href="#url#{sessionvars%urlparameter}"><b>#name|escape#</b></a></td><td>#description#</td><td>#contact|obfuscate#</td><td class="age">#lastchange|age# ago</td><td class="indexlinks"><a class="rss_logo" href="#url#rss-log">RSS</a> #archives%archiveentry#</td></tr>'
@@ -48,3 +48,19 b' a.rss_logo {'
48 }
48 }
49 a.rss_logo:hover { background-color:#ee5500; }
49 a.rss_logo:hover { background-color:#ee5500; }
50 pre { margin: 0; }
50 pre { margin: 0; }
51 span.logtags span {
52 padding: 0px 4px;
53 font-size: 10px;
54 font-weight: normal;
55 border: 1px solid;
56 background-color: #ffaaff;
57 border-color: #ffccff #ff00ee #ff00ee #ffccff;
58 }
59 span.logtags span.tagtag {
60 background-color: #ffffaa;
61 border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
62 }
63 span.logtags span.branchtag {
64 background-color: #aaffaa;
65 border-color: #ccffcc #00cc33 #00cc33 #ccffcc;
66 }
General Comments 0
You need to be logged in to leave comments. Login now