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 21 insertions and 13 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -74,15 +74,15 @@ proxypass_auth_enabled = false
 
## pattern to get the issues from commit messages
 
## default one used here is #1234
 

	
 
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>
 

	
 
issue_prefix = #
 

	
production.ini
Show inline comments
 
@@ -74,15 +74,15 @@ proxypass_auth_enabled = false
 
## pattern to get the issues from commit messages
 
## default one used here is #1234
 

	
 
#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>
 

	
 
#issue_prefix = #
 

	
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -74,15 +74,15 @@ proxypass_auth_enabled = false
 
## pattern to get the issues from commit messages
 
## default one used here is #1234
 

	
 
#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>
 

	
 
#issue_prefix = #
 

	
rhodecode/lib/helpers.py
Show inline comments
 
@@ -740,51 +740,59 @@ 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 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 = (
 
                ' <a class="%(cls)s" href="%(url)s">'
 
                '%(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),
 
                     'url': url,
 
                     'id-repr':issue_id,
 
                     'issue-prefix':ISSUE_PREFIX,
 
                     'serv':ISSUE_SERVER,
 
                     'serv': ISSUE_SERVER_LNK,
 
                    }
 
                )
 
            return literal(URL_PAT.sub(url_func, text_))
 
    except:
 
        log.error(traceback.format_exc())
 
        pass
 

	
 
    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
 

	
 
    :param source:
 
    """
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -56,13 +56,13 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
								</div>
 
								<div title="${cs.author}" class="user">${h.person(cs.author)}</div>
 
							</div>
 
                            <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">
 
									<div id="${cs.raw_id}_changes_info" class="changes">
 
                                        <span id="${cs.raw_id}" class="changed_total tooltip" title="${_('Affected number of files, click to show more details')}">${len(cs.affected_files)}</span>
 
									</div>					
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -46,13 +46,13 @@
 
	                     <div class="gravatar">
 
	                         <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/>
 
	                     </div>
 
	                     <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">
 
                        % if len(c.changeset.affected_files) <= c.affected_files_cut_off:	             
 
		                 <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span>
 
		                 <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span>
rhodecode/templates/changeset/changeset_range.html
Show inline comments
 
@@ -38,13 +38,13 @@
 
            %for cs in c.cs_ranges:
 
                <tr>
 
                <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),14)}"/></div></td>
 
                <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>
 
	        </div>
 
	        <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
 
	        <div class="cs_files">
0 comments (0 inline, 0 general)