diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -46,6 +46,8 @@ port = 5000 use = egg:rhodecode full_stack = true static_files = true +# Optional Languages +# en, fr, pt_BR, zh_CN, zh_TW lang = en cache_dir = %(here)s/data index_dir = %(here)s/data/index @@ -78,7 +80,8 @@ default_encoding = utf8 issue_pat = (?:\s*#)(\d+) ## server url to the issue, each {id} will be replaced with match -## fetched from the regex and {repo} is replaced with repository name +## fetched from the regex and {repo} is replaced with full repository name +## including groups {repo_name} is replaced with just name of repo issue_server_link = https://myissueserver.com/{repo}/issue/{id} diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -46,6 +46,8 @@ port = 8001 use = egg:rhodecode full_stack = true static_files = true +# Optional Languages +# en, fr, pt_BR, zh_CN, zh_TW lang = en cache_dir = %(here)s/data index_dir = %(here)s/data/index @@ -78,7 +80,8 @@ default_encoding = utf8 issue_pat = (?:\s*#)(\d+) ## server url to the issue, each {id} will be replaced with match -## fetched from the regex and {repo} is replaced with repository name +## fetched from the regex and {repo} is replaced with full repository name +## including groups {repo_name} is replaced with just name of repo issue_server_link = https://myissueserver.com/{repo}/issue/{id} diff --git a/rhodecode/config/deployment.ini_tmpl b/rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl +++ b/rhodecode/config/deployment.ini_tmpl @@ -80,7 +80,8 @@ default_encoding = utf8 issue_pat = (?:\s*#)(\d+) ## server url to the issue, each {id} will be replaced with match -## fetched from the regex and {repo} is replaced with repository name +## fetched from the regex and {repo} is replaced with full repository name +## including groups {repo_name} is replaced with just name of repo issue_server_link = https://myissueserver.com/{repo}/issue/{id} diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -44,6 +44,7 @@ from rhodecode.lib.utils2 import str2boo from rhodecode.lib.markup_renderer import MarkupRenderer from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError from rhodecode.lib.vcs.backends.base import BaseChangeset +from rhodecode.model.db import URL_SEP log = logging.getLogger(__name__) @@ -885,7 +886,6 @@ def urlify_commit(text_, repository=None return ''.join(links) - # urlify changesets - extrac revisions and make link out of them text_ = urlify_changesets(escaper(text_), repository) @@ -912,7 +912,8 @@ def urlify_commit(text_, repository=None url = ISSUE_SERVER_LNK.replace('{id}', issue_id) if repository: url = url.replace('{repo}', repository) - + repo_name = repository.split(URL_SEP)[-1] + url = url.replace('{repo_name}', repo_name) return tmpl % { 'pref': pref, 'cls': 'issue-tracker-link', diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -47,7 +47,7 @@ from rhodecode.lib.caching_query import from rhodecode.model.meta import Base, Session import hashlib - +URL_SEP = '/' log = logging.getLogger(__name__) #============================================================================== @@ -523,7 +523,7 @@ class Repository(Base, BaseModel): @classmethod def url_sep(cls): - return '/' + return URL_SEP @classmethod def get_by_repo_name(cls, repo_name): @@ -776,7 +776,7 @@ class RepoGroup(Base, BaseModel): @classmethod def url_sep(cls): - return '/' + return URL_SEP @classmethod def get_by_group_name(cls, group_name, cache=False, case_insensitive=False):