Mon Sep 19 06:20:23 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Fix some UTF8 handling in annotate, and add tooltips.
This patch fixes some of the UTF8 handling in different annotate parts.
Accidentally, it also includes a small modification to show for each line of
the annotate the last modification time, date and author as a tooltip. It'd be
nice to put this in a different patch.
{
hunk ./darcsweb.cgi 686
- annotate.fname = file.getAttribute("name")
+ annotate.fname = fixu8(file.getAttribute("name"))
hunk ./darcsweb.cgi 689
- annotate.created_as = createinfo.getAttribute("original_name")
+ annotate.created_as = fixu8(createinfo.getAttribute("original_name"))
hunk ./darcsweb.cgi 692
- annotate.creator_hash = creator.getAttribute("hash")
+ annotate.creator_hash = fixu8(creator.getAttribute("hash"))
hunk ./darcsweb.cgi 696
- annotate.lastchange_hash = lastpatch.getAttribute("hash")
- annotate.lastchange_author = lastpatch.getAttribute("author")
+ annotate.lastchange_hash = fixu8(lastpatch.getAttribute("hash"))
+ annotate.lastchange_author = fixu8(lastpatch.getAttribute("author"))
hunk ./darcsweb.cgi 701
- annotate.lastchange_name = lastname
+ annotate.lastchange_name = fixu8(lastname)
+
+ lastdate = lastpatch.getAttribute("date")
+ lastdate = time.strptime(lastdate, "%Y%m%d%H%M%S")
+ lastdate = time.strftime("%Y-%m-%d %H:%M:%S", lastdate)
+ annotate.lastchange_date = fixu8(lastdate)
hunk ./darcsweb.cgi 720
+ pdate = patch.getAttribute("date")
+ pdate = time.strptime(pdate, "%Y%m%d%H%M%S")
+ pdate = time.strftime("%Y-%m-%d %H:%M:%S", pdate)
hunk ./darcsweb.cgi 728
+ pdate = annotate.lastchange_date
hunk ./darcsweb.cgi 740
- line.text = text
- line.phash = phash
- line.pauthor = pauthor
+ line.text = fixu8(text)
+ line.phash = fixu8(phash)
+ line.pauthor = fixu8(pauthor)
+ line.pdate = fixu8(pdate)
hunk ./darcsweb.cgi 967
- text = fixu8(escape(l.text))
+ text = escape(l.text)
hunk ./darcsweb.cgi 969
+ title = "%s by %s" % (l.pdate, escape(l.pauthor) )
hunk ./darcsweb.cgi 977
-<a href="%(link)s" class="linenr">%(c)4d</a> \
-<a href="%(link)s" class="line">%(text)s</a>\
+<a href="%(link)s" title="%(title)s" class="linenr">%(c)4d</a> \
+<a href="%(link)s" title="%(title)s" class="line">%(text)s</a>\
hunk ./darcsweb.cgi 983
+ 'title': title,
hunk ./darcsweb.cgi 1457
-
hunk ./darcsweb.cgi 1468
- 'name': ann.lastchange_name,
- 'fname': fname,
+ 'name': escape(ann.lastchange_name),
+ 'fname': escape(fname),
}