aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-09-19 19:02:40 -0400
committer无闻 <joe2010xtmf@163.com>2014-09-19 19:02:40 -0400
commit6a7bd097fe2b3e894830fc3fdb60dde5594b61d6 (patch)
tree64a9ea617ba1f704139881c3960fa2425dad9018 /models
parent4f74b4e6578be4251af65cd08daa37c884e431a0 (diff)
parent0055cbd3651ebde0f8b6cc70c9c44de56dc38830 (diff)
Merge pull request #463 from chadoe/urlroot
Allow Gogs to run from a suburl behind a reverse proxy.
Diffstat (limited to 'models')
-rw-r--r--models/action.go2
-rw-r--r--models/user.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/models/action.go b/models/action.go
index a6b22b16..596f51af 100644
--- a/models/action.go
+++ b/models/action.go
@@ -137,7 +137,7 @@ func updateIssuesCommit(userId, repoId int64, repoUserName, repoName string, com
return err
}
- url := fmt.Sprintf("/%s/%s/commit/%s", repoUserName, repoName, c.Sha1)
+ url := fmt.Sprintf("%s/%s/%s/commit/%s", setting.AppRootSubUrl, repoUserName, repoName, c.Sha1)
message := fmt.Sprintf(`<a href="%s">%s</a>`, url, c.Message)
if _, err = CreateComment(userId, issue.RepoId, issue.Id, 0, 0, COMMIT, message, nil); err != nil {
diff --git a/models/user.go b/models/user.go
index b3ea8161..1bed8109 100644
--- a/models/user.go
+++ b/models/user.go
@@ -82,14 +82,14 @@ type User struct {
// DashboardLink returns the user dashboard page link.
func (u *User) DashboardLink() string {
if u.IsOrganization() {
- return "/org/" + u.Name + "/dashboard/"
+ return setting.AppRootSubUrl + "/org/" + u.Name + "/dashboard/"
}
- return "/"
+ return setting.AppRootSubUrl + "/"
}
// HomeLink returns the user home page link.
func (u *User) HomeLink() string {
- return "/user/" + u.Name
+ return setting.AppRootSubUrl + "/user/" + u.Name
}
// AvatarLink returns user gravatar link.