diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-09-19 20:11:34 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-09-19 20:11:34 -0400 |
commit | 7ba9257a7ff659417501baf7358216555cebcd86 (patch) | |
tree | ffc842cec4165d1069220ae16e08a0b824952f4b /modules/base | |
parent | 6a7bd097fe2b3e894830fc3fdb60dde5594b61d6 (diff) | |
download | gitea-7ba9257a7ff659417501baf7358216555cebcd86.tar.gz gitea-7ba9257a7ff659417501baf7358216555cebcd86.zip |
Add suburl support
Diffstat (limited to 'modules/base')
-rw-r--r-- | modules/base/markdown.go | 2 | ||||
-rw-r--r-- | modules/base/template.go | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go index 2aa81005bf..a3db15df1a 100644 --- a/modules/base/markdown.go +++ b/modules/base/markdown.go @@ -113,7 +113,7 @@ func RenderSpecialLink(rawBytes []byte, urlPrefix string) []byte { ms := MentionPattern.FindAll(line, -1) for _, m := range ms { line = bytes.Replace(line, m, - []byte(fmt.Sprintf(`<a href="%s/user/%s">%s</a>`, setting.AppRootSubUrl, m[1:], m)), -1) + []byte(fmt.Sprintf(`<a href="%s/user/%s">%s</a>`, setting.AppSubUrl, m[1:], m)), -1) } } diff --git a/modules/base/template.go b/modules/base/template.go index dd883ea360..ec41914937 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -82,8 +82,8 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{ "AppName": func() string { return setting.AppName }, - "AppRootSubUrl": func() string { - return setting.AppRootSubUrl + "AppSubUrl": func() string { + return setting.AppSubUrl }, "AppVer": func() string { return setting.AppVer @@ -210,7 +210,7 @@ func ActionDesc(act Actioner) string { content := act.GetContent() switch act.GetOpType() { case 1: // Create repository. - return fmt.Sprintf(TPL_CREATE_REPO, setting.AppRootSubUrl, actUserName, actUserName, repoLink, repoName) + return fmt.Sprintf(TPL_CREATE_REPO, setting.AppSubUrl, actUserName, actUserName, repoLink, repoName) case 5: // Commit repository. var push *PushCommits if err := json.Unmarshal([]byte(content), &push); err != nil { @@ -223,20 +223,20 @@ func ActionDesc(act Actioner) string { if push.Len > 3 { buf.WriteString(fmt.Sprintf(`<div><a href="{{AppRootSubUrl}}/%s/%s/commits/%s" rel="nofollow">%d other commits >></a></div>`, actUserName, repoName, branch, push.Len)) } - return fmt.Sprintf(TPL_COMMIT_REPO, setting.AppRootSubUrl, actUserName, actUserName, repoLink, branch, branch, repoLink, repoLink, + return fmt.Sprintf(TPL_COMMIT_REPO, setting.AppSubUrl, actUserName, actUserName, repoLink, branch, branch, repoLink, repoLink, buf.String()) case 6: // Create issue. infos := strings.SplitN(content, "|", 2) - return fmt.Sprintf(TPL_CREATE_ISSUE, setting.AppRootSubUrl, actUserName, actUserName, repoLink, infos[0], repoLink, infos[0], + return fmt.Sprintf(TPL_CREATE_ISSUE, setting.AppSubUrl, actUserName, actUserName, repoLink, infos[0], repoLink, infos[0], AvatarLink(email), infos[1]) case 8: // Transfer repository. newRepoLink := content + "/" + repoName - return fmt.Sprintf(TPL_TRANSFER_REPO, setting.AppRootSubUrl, actUserName, actUserName, repoLink, newRepoLink, newRepoLink) + return fmt.Sprintf(TPL_TRANSFER_REPO, setting.AppSubUrl, actUserName, actUserName, repoLink, newRepoLink, newRepoLink) case 9: // Push tag. - return fmt.Sprintf(TPL_PUSH_TAG, setting.AppRootSubUrl, actUserName, actUserName, repoLink, branch, branch, repoLink, repoLink) + return fmt.Sprintf(TPL_PUSH_TAG, setting.AppSubUrl, actUserName, actUserName, repoLink, branch, branch, repoLink, repoLink) case 10: // Comment issue. infos := strings.SplitN(content, "|", 2) - return fmt.Sprintf(TPL_COMMENT_ISSUE, setting.AppRootSubUrl, actUserName, actUserName, repoLink, infos[0], repoLink, infos[0], + return fmt.Sprintf(TPL_COMMENT_ISSUE, setting.AppSubUrl, actUserName, actUserName, repoLink, infos[0], repoLink, infos[0], AvatarLink(email), infos[1]) default: return "invalid type" |