From: Leandro Lucarella Date: Sun, 10 Aug 2008 04:52:13 +0000 (-0300) Subject: Make the comment author a link only if the comment has a link attribute X-Git-Url: https://git.llucax.com/software/blitiri.git/commitdiff_plain/2d920637ac90aad15317607d7d4dd96c41a61c15 Make the comment author a link only if the comment has a link attribute --- diff --git a/blitiri.cgi b/blitiri.cgi index 79e4171..d48b8eb 100755 --- a/blitiri.cgi +++ b/blitiri.cgi @@ -140,7 +140,7 @@ default_comment_header = """

Comment #%(number)d

-by %(author)s +by %(linked_author)s on %(year)04d-%(month)02d-%(day)02d %(hour)02d:%(minute)02d

@@ -444,8 +444,14 @@ class Templates (object): 'art_footer', default_article_footer, article.to_vars()) def get_comment_header(self, comment): + vars = comment.to_vars() + if comment.link: + vars['linked_author'] = '%s' \ + % (comment.link, comment.author) + else: + vars['linked_author'] = comment.author return self.get_template( - 'com_header', default_comment_header, comment.to_vars()) + 'com_header', default_comment_header, vars) def get_comment_footer(self, comment): return self.get_template(