aboutsummaryrefslogtreecommitdiff
path: root/routers/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-04-06 17:27:57 -0400
committerUnknwon <u@gogs.io>2017-04-06 17:27:57 -0400
commit90b9f7e08ca2e027cc587199537aa653ddd94d91 (patch)
tree0dbd625cd1eb929250befa07f18a0517ae23a5d1 /routers/repo
parent2c404daca612b43bd6b0b720d3e732d9550c0eab (diff)
pkg/setting: rename {AppUrl, AppSubUrl} -> {AppURL, AppSubURL}
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/commit.go12
-rw-r--r--routers/repo/editor.go2
-rw-r--r--routers/repo/issue.go6
-rw-r--r--routers/repo/pull.go12
-rw-r--r--routers/repo/repo.go4
-rw-r--r--routers/repo/setting.go12
6 files changed, 24 insertions, 24 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index 9723b7f1..992b35f5 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -171,11 +171,11 @@ func Diff(ctx *context.Context) {
ctx.Data["Diff"] = diff
ctx.Data["Parents"] = parents
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
- ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", commitID)
+ ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", commitID)
if commit.ParentCount() > 0 {
- ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", parents[0])
+ ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", parents[0])
}
- ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "raw", commitID)
+ ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", commitID)
ctx.HTML(200, DIFF)
}
@@ -232,8 +232,8 @@ func CompareDiff(ctx *context.Context) {
ctx.Data["Commit"] = commit
ctx.Data["Diff"] = diff
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
- ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", afterCommitID)
- ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", beforeCommitID)
- ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "raw", afterCommitID)
+ ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", afterCommitID)
+ ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", beforeCommitID)
+ ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", afterCommitID)
ctx.HTML(200, DIFF)
}
diff --git a/routers/repo/editor.go b/routers/repo/editor.go
index a8ce490a..69c36b87 100644
--- a/routers/repo/editor.go
+++ b/routers/repo/editor.go
@@ -110,7 +110,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
ctx.Data["MarkdownFileExts"] = strings.Join(setting.Markdown.FileExtensions, ",")
ctx.Data["LineWrapExtensions"] = strings.Join(setting.Repository.Editor.LineWrapExtensions, ",")
ctx.Data["PreviewableFileModes"] = strings.Join(setting.Repository.Editor.PreviewableFileModes, ",")
- ctx.Data["EditorconfigURLPrefix"] = fmt.Sprintf("%s/api/v1/repos/%s/editorconfig/", setting.AppSubUrl, ctx.Repo.Repository.FullName())
+ ctx.Data["EditorconfigURLPrefix"] = fmt.Sprintf("%s/api/v1/repos/%s/editorconfig/", setting.AppSubURL, ctx.Repo.Repository.FullName())
ctx.HTML(200, EDIT_FILE)
}
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 875ff8fe..61401b43 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -116,8 +116,8 @@ func issues(ctx *context.Context, isPullList bool) {
// Must sign in to see issues about you.
if viewType != "all" && !ctx.IsSigned {
- ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
- ctx.Redirect(setting.AppSubUrl + "/user/login")
+ ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL)
+ ctx.Redirect(setting.AppSubURL + "/user/login")
return
}
@@ -653,7 +653,7 @@ func viewIssue(ctx *context.Context, isPullList bool) {
ctx.Data["NumParticipants"] = len(participants)
ctx.Data["Issue"] = issue
ctx.Data["IsIssueOwner"] = ctx.Repo.IsWriter() || (ctx.IsSigned && issue.IsPoster(ctx.User.ID))
- ctx.Data["SignInLink"] = setting.AppSubUrl + "/user/login?redirect_to=" + ctx.Data["Link"].(string)
+ ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + ctx.Data["Link"].(string)
ctx.HTML(200, ISSUE_VIEW)
}
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 6ff313b7..b88500e8 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -371,9 +371,9 @@ func ViewPullFiles(ctx *context.Context) {
ctx.Data["Reponame"] = pull.HeadRepo.Name
headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name)
- ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "src", endCommitID)
- ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "src", startCommitID)
- ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "raw", endCommitID)
+ ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", endCommitID)
+ ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", startCommitID)
+ ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", endCommitID)
}
ctx.Data["RequireHighlightJS"] = true
@@ -573,9 +573,9 @@ func PrepareCompareDiff(
ctx.Data["IsImageFile"] = headCommit.IsImageFile
headTarget := path.Join(headUser.Name, repo.Name)
- ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "src", headCommitID)
- ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "src", prInfo.MergeBase)
- ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "raw", headCommitID)
+ ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", headCommitID)
+ ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", prInfo.MergeBase)
+ ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", headCommitID)
return false
}
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index bdc471fe..3f99f53c 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -132,7 +132,7 @@ func CreatePost(ctx *context.Context, f form.CreateRepo) {
})
if err == nil {
log.Trace("Repository created [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
- ctx.Redirect(setting.AppSubUrl + "/" + ctxUser.Name + "/" + repo.Name)
+ ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + repo.Name)
return
}
@@ -204,7 +204,7 @@ func MigratePost(ctx *context.Context, f form.MigrateRepo) {
})
if err == nil {
log.Trace("Repository migrated [%d]: %s/%s", repo.ID, ctxUser.Name, f.RepoName)
- ctx.Redirect(setting.AppSubUrl + "/" + ctxUser.Name + "/" + f.RepoName)
+ ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + f.RepoName)
return
}
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index 6a049ead..f9dc4180 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -189,7 +189,7 @@ func SettingsPost(ctx *context.Context, f form.RepoSetting) {
}
log.Trace("Repository converted from mirror to regular: %s/%s", ctx.Repo.Owner.Name, repo.Name)
ctx.Flash.Success(ctx.Tr("repo.settings.convert_succeed"))
- ctx.Redirect(setting.AppSubUrl + "/" + ctx.Repo.Owner.Name + "/" + repo.Name)
+ ctx.Redirect(setting.AppSubURL + "/" + ctx.Repo.Owner.Name + "/" + repo.Name)
case "transfer":
if !ctx.Repo.IsOwner() {
@@ -228,7 +228,7 @@ func SettingsPost(ctx *context.Context, f form.RepoSetting) {
}
log.Trace("Repository transfered: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newOwner)
ctx.Flash.Success(ctx.Tr("repo.settings.transfer_succeed"))
- ctx.Redirect(setting.AppSubUrl + "/" + newOwner + "/" + repo.Name)
+ ctx.Redirect(setting.AppSubURL + "/" + newOwner + "/" + repo.Name)
case "delete":
if !ctx.Repo.IsOwner() {
@@ -307,7 +307,7 @@ func SettingsCollaboration(ctx *context.Context) {
func SettingsCollaborationPost(ctx *context.Context) {
name := strings.ToLower(ctx.Query("collaborator"))
if len(name) == 0 || ctx.Repo.Owner.LowerName == name {
- ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
+ ctx.Redirect(setting.AppSubURL + ctx.Req.URL.Path)
return
}
@@ -315,7 +315,7 @@ func SettingsCollaborationPost(ctx *context.Context) {
if err != nil {
if errors.IsUserNotExist(err) {
ctx.Flash.Error(ctx.Tr("form.user_not_exist"))
- ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
+ ctx.Redirect(setting.AppSubURL + ctx.Req.URL.Path)
} else {
ctx.Handle(500, "GetUserByName", err)
}
@@ -325,7 +325,7 @@ func SettingsCollaborationPost(ctx *context.Context) {
// Organization is not allowed to be added as a collaborator
if u.IsOrganization() {
ctx.Flash.Error(ctx.Tr("repo.settings.org_not_allowed_to_be_collaborator"))
- ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
+ ctx.Redirect(setting.AppSubURL + ctx.Req.URL.Path)
return
}
@@ -339,7 +339,7 @@ func SettingsCollaborationPost(ctx *context.Context) {
}
ctx.Flash.Success(ctx.Tr("repo.settings.add_collaborator_success"))
- ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
+ ctx.Redirect(setting.AppSubURL + ctx.Req.URL.Path)
}
func ChangeCollaborationAccessMode(ctx *context.Context) {