Thu Feb 1 17:30:50 UTC 2007 VMiklos <vmiklos@frugalware.org>
* new optional config varuable: author_links
it is disabled by default and an example for cia is included
{
hunk ./config.py.sample 77
+
+ # If you want to generate links from patch author names, define the url
+ # here. Example for CIA:
+ #author_links = "http://cia.navi.cx/stats/author/%(author)s"
+
hunk ./darcsweb.cgi 487
+def gen_authorlink(author, shortauthor=None):
+ if not config.author_links:
+ if shortauthor:
+ return shortauthor
+ else:
+ return author
+ if not shortauthor:
+ shortauthor = author
+ return '<a href="' + config.author_links % { 'author': author } + '">%s</a>' % shortauthor
hunk ./darcsweb.cgi 1149
- 'author': shorten_str(p.shortauthor, 26),
+ 'author': gen_authorlink(p.author, shorten_str(p.shortauthor, 26)),
hunk ./darcsweb.cgi 1209
- 'author': p.shortauthor,
+ 'author': gen_authorlink(p.author, p.shortauthor),
hunk ./darcsweb.cgi 1619
- 'author': p.author,
+ 'author': gen_authorlink(p.author),
hunk ./darcsweb.cgi 2082
- 'author': shorten_str(p.shortauthor, 26),
+ 'author': gen_authorlink(p.author, shorten_str(p.shortauthor, 26)),
hunk ./darcsweb.cgi 2370
+ if "author_links" in dir(base):
+ config.author_links = base.author_links
+ else:
+ config.author_links = None
}