Mercurial > kallithea
diff rhodecode/lib/helpers.py @ 1878:287eff9614fa beta
changelog: make messages be links again, and somewhat co-exist with issue tracker links (those are bold now)
author | Aras Pranckevicius <aras@unity3d.com> |
---|---|
date | Mon, 09 Jan 2012 22:40:10 +0200 |
parents | f26acc1b27e2 |
children | 0614862a20ec |
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py Mon Jan 09 09:37:15 2012 +0200 +++ b/rhodecode/lib/helpers.py Mon Jan 09 22:40:10 2012 +0200 @@ -744,10 +744,13 @@ return literal(url_pat.sub(url_func, text_)) -def urlify_commit(text_, repository=None): +def urlify_commit(text_, repository=None, link_=None): import re import traceback + if link_: + link_ = '<a href="' + link_ + '">' + try: conf = config['app_conf'] @@ -768,6 +771,9 @@ if repository: url = url.replace('{repo}', repository) + if link_: + tmpl = '</a>' + tmpl + link_ + return tmpl % ( { 'cls': 'issue-tracker-link', @@ -777,11 +783,16 @@ 'serv': ISSUE_SERVER_LNK, } ) - return literal(URL_PAT.sub(url_func, text_)) + newtext = URL_PAT.sub(url_func, text_) + if link_: + newtext = link_ + newtext + '</a>' + return literal(newtext) except: log.error(traceback.format_exc()) pass + + return text_