summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-03-12 16:01:23 -0400
committerUnknwon <u@gogs.io>2015-03-12 16:01:23 -0400
commit0720d3988f3e088e527dd857756d6598694494a7 (patch)
tree2a8985de89e3bece27ec7990d52c5e3cfcf03429 /models/action.go
parent6b70a0c0d926fd128063ab387820cee31890e556 (diff)
downloadgitea-0720d3988f3e088e527dd857756d6598694494a7.tar.gz
gitea-0720d3988f3e088e527dd857756d6598694494a7.zip
#988: GetRepoLink already contains AppSubUrl
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/models/action.go b/models/action.go
index f872104eb2..f97ecfcde3 100644
--- a/models/action.go
+++ b/models/action.go
@@ -97,8 +97,15 @@ func (a Action) GetRepoName() string {
return a.RepoName
}
+func (a Action) GetRepoPath() string {
+ return path.Join(a.RepoUserName, a.RepoName)
+}
+
func (a Action) GetRepoLink() string {
- return path.Join(setting.AppSubUrl, a.RepoUserName, a.RepoName)
+ if len(setting.AppSubUrl) > 0 {
+ return path.Join(setting.AppSubUrl, a.GetRepoPath())
+ }
+ return "/" + a.GetRepoPath()
}
func (a Action) GetBranch() string {