Changeset - f26acc1b27e2
[Not reviewed]
beta
0 7 0
Marcin Kuzminski - 14 years ago 2012-01-09 03:00:12
marcin@python-works.com
added repository name into issue tracker link to support different projects issues tracker mapping
7 files changed with 28 insertions and 20 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -77,9 +77,9 @@ proxypass_auth_enabled = false
 
url_pat = (?:^#|\s#)(\w+)
 

	
 
## server url to the issue, each {id} will be replaced with id
 
## fetched from the regex
 
## fetched from the regex and {repo} is replaced with repository name
 

	
 
issue_server = https://myissueserver.com/issue/{id}
 
issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 

	
 
## prefix to add to link to indicate it's an url
 
## #314 will be replaced by <issue_prefix><id>
production.ini
Show inline comments
 
@@ -77,9 +77,9 @@ proxypass_auth_enabled = false
 
#url_pat = (?:^#|\s#)(\w+)
 

	
 
## server url to the issue, each {id} will be replaced with id
 
## fetched from the regex
 
## fetched from the regex and {repo} is replaced with repository name
 

	
 
#issue_server = https://myissueserver.com/issue/{id}
 
#issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 

	
 
## prefix to add to link to indicate it's an url
 
## #314 will be replaced by <issue_prefix><id>
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -77,9 +77,9 @@ proxypass_auth_enabled = false
 
#url_pat = (?:^#|\s#)(\w+)
 

	
 
## server url to the issue, each {id} will be replaced with id
 
## fetched from the regex
 
## fetched from the regex and {repo} is replaced with repository name
 

	
 
#issue_server = https://myissueserver.com/issue/{id}
 
#issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 

	
 
## prefix to add to link to indicate it's an url
 
## #314 will be replaced by <issue_prefix><id>
rhodecode/lib/helpers.py
Show inline comments
 
@@ -739,22 +739,24 @@ def urlify_text(text_):
 

	
 
    def url_func(match_obj):
 
        url_full = match_obj.groups()[0]
 
        return '<a href="%(url)s">%(url)s</a>' % ({'url':url_full})
 
        return '<a href="%(url)s">%(url)s</a>' % ({'url': url_full})
 

	
 
    return literal(url_pat.sub(url_func, text_))
 

	
 
def urlify_commit(text_):
 

	
 
def urlify_commit(text_, repository=None):
 
    import re
 
    import traceback
 
    
 

	
 
    try:
 
        conf = config['app_conf']
 
        
 

	
 
        URL_PAT = re.compile(r'%s' % conf.get('url_pat'))
 
        
 

	
 
        if URL_PAT:
 
            ISSUE_SERVER = conf.get('issue_server')
 
            ISSUE_SERVER_LNK = conf.get('issue_server_link')
 
            ISSUE_PREFIX = conf.get('issue_prefix')
 

	
 
            def url_func(match_obj):
 
                issue_id = match_obj.groups()[0]
 
                tmpl = (
 
@@ -762,13 +764,17 @@ def urlify_commit(text_):
 
                '%(issue-prefix)s%(id-repr)s'
 
                '</a>'
 
                )
 
                url = ISSUE_SERVER_LNK.replace('{id}', issue_id)
 
                if repository:
 
                    url = url.replace('{repo}', repository)
 

	
 
                return tmpl % (
 
                    {
 
                     'cls':'issue-tracker-link',
 
                     'url':ISSUE_SERVER.replace('{id}',issue_id),
 
                     'id-repr':issue_id,
 
                     'issue-prefix':ISSUE_PREFIX,
 
                     'serv':ISSUE_SERVER,
 
                     'cls': 'issue-tracker-link',
 
                     'url': url,
 
                     'id-repr': issue_id,
 
                     'issue-prefix': ISSUE_PREFIX,
 
                     'serv': ISSUE_SERVER_LNK,
 
                    }
 
                )
 
            return literal(URL_PAT.sub(url_func, text_))
 
@@ -778,10 +784,12 @@ def urlify_commit(text_):
 

	
 
    return text_
 

	
 

	
 
def rst(source):
 
    return literal('<div class="rst-block">%s</div>' %
 
                   MarkupRenderer.rst(source))
 

	
 

	
 
def rst_w_mentions(source):
 
    """
 
    Wrapped rst renderer with @mention highlighting
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -59,7 +59,7 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
                            <div class="date">${cs.date}</div>
 
						</div>
 
						<div class="mid">
 
                            <div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message))}</div>
 
                            <div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div>
 
                            <div class="expand ${'tablerow%s' % (cnt%2)}">&darr; ${_('show more')} &darr;</div>
 
						</div>	
 
						<div class="right">
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -49,7 +49,7 @@
 
	                     <span>${h.person(c.changeset.author)}</span><br/>
 
	                     <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
 
	                 </div>
 
	                 <div class="message">${h.urlify_commit(h.wrap_paragraphs(c.changeset.message))}</div>
 
	                 <div class="message">${h.urlify_commit(h.wrap_paragraphs(c.changeset.message),c.repo_name)}</div>
 
	             </div>
 
	             <div class="right">
 
		             <div class="changes">
rhodecode/templates/changeset/changeset_range.html
Show inline comments
 
@@ -41,7 +41,7 @@
 
                <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</td>
 
                <td><div class="author">${h.person(cs.author)}</div></td>
 
                <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
 
                <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message))}</div></td>
 
                <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td>
 
                </tr>
 
            %endfor
 
            </table>
0 comments (0 inline, 0 general)