diff options
Diffstat (limited to 'pkg/context')
-rw-r--r-- | pkg/context/api.go | 8 | ||||
-rw-r--r-- | pkg/context/auth.go | 14 | ||||
-rw-r--r-- | pkg/context/context.go | 2 | ||||
-rw-r--r-- | pkg/context/org.go | 2 | ||||
-rw-r--r-- | pkg/context/repo.go | 4 |
5 files changed, 15 insertions, 15 deletions
diff --git a/pkg/context/api.go b/pkg/context/api.go index ffaddd33..623bc1aa 100644 --- a/pkg/context/api.go +++ b/pkg/context/api.go @@ -48,16 +48,16 @@ func (ctx *APIContext) SetLinkHeader(total, pageSize int) { page := paginater.New(total, pageSize, ctx.QueryInt("page"), 0) links := make([]string, 0, 4) if page.HasNext() { - links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"next\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.Next())) + links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"next\"", setting.AppURL, ctx.Req.URL.Path[1:], page.Next())) } if !page.IsLast() { - links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"last\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.TotalPages())) + links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"last\"", setting.AppURL, ctx.Req.URL.Path[1:], page.TotalPages())) } if !page.IsFirst() { - links = append(links, fmt.Sprintf("<%s%s?page=1>; rel=\"first\"", setting.AppUrl, ctx.Req.URL.Path[1:])) + links = append(links, fmt.Sprintf("<%s%s?page=1>; rel=\"first\"", setting.AppURL, ctx.Req.URL.Path[1:])) } if page.HasPrevious() { - links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"prev\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.Previous())) + links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"prev\"", setting.AppURL, ctx.Req.URL.Path[1:], page.Previous())) } if len(links) > 0 { diff --git a/pkg/context/auth.go b/pkg/context/auth.go index 642a320b..d2bfe603 100644 --- a/pkg/context/auth.go +++ b/pkg/context/auth.go @@ -25,7 +25,7 @@ func Toggle(options *ToggleOptions) macaron.Handler { return func(ctx *Context) { // Cannot view any page before installation. if !setting.InstallLock { - ctx.Redirect(setting.AppSubUrl + "/install") + ctx.Redirect(setting.AppSubURL + "/install") return } @@ -38,13 +38,13 @@ func Toggle(options *ToggleOptions) macaron.Handler { // Check non-logged users landing page. if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LANDING_PAGE_HOME { - ctx.Redirect(setting.AppSubUrl + string(setting.LandingPageURL)) + ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL)) return } // Redirect to dashboard if user tries to visit any non-login page. if options.SignOutRequired && ctx.IsSigned && ctx.Req.RequestURI != "/" { - ctx.Redirect(setting.AppSubUrl + "/") + ctx.Redirect(setting.AppSubURL + "/") return } @@ -65,8 +65,8 @@ func Toggle(options *ToggleOptions) macaron.Handler { return } - 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 } else if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm { ctx.Data["Title"] = ctx.Tr("auth.active_your_account") @@ -78,8 +78,8 @@ func Toggle(options *ToggleOptions) macaron.Handler { // Redirect to log in page if auto-signin info is provided and has not signed in. if !options.SignOutRequired && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) && len(ctx.GetCookie(setting.CookieUserName)) > 0 { - 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 } diff --git a/pkg/context/context.go b/pkg/context/context.go index 4a11ce06..1649dc3d 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -185,7 +185,7 @@ func Contexter() macaron.Handler { } // Compute current URL for real-time change language. - ctx.Data["Link"] = setting.AppSubUrl + strings.TrimSuffix(ctx.Req.URL.Path, "/") + ctx.Data["Link"] = setting.AppSubURL + strings.TrimSuffix(ctx.Req.URL.Path, "/") ctx.Data["PageStartTime"] = time.Now() diff --git a/pkg/context/org.go b/pkg/context/org.go index 55c2ed04..49785674 100644 --- a/pkg/context/org.go +++ b/pkg/context/org.go @@ -91,7 +91,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) { ctx.Data["IsOrganizationOwner"] = ctx.Org.IsOwner ctx.Data["IsOrganizationMember"] = ctx.Org.IsMember - ctx.Org.OrgLink = setting.AppSubUrl + "/org/" + org.Name + ctx.Org.OrgLink = setting.AppSubURL + "/org/" + org.Name ctx.Data["OrgLink"] = ctx.Org.OrgLink // Team. diff --git a/pkg/context/repo.go b/pkg/context/repo.go index 00f0eaa1..a1924954 100644 --- a/pkg/context/repo.go +++ b/pkg/context/repo.go @@ -110,7 +110,7 @@ func (r *Repository) PullRequestURL(baseBranch, headBranch string) string { // composeGoGetImport returns go-get-import meta content. func composeGoGetImport(owner, repo string) string { - return path.Join(setting.Domain, setting.AppSubUrl, owner, repo) + return path.Join(setting.Domain, setting.AppSubURL, owner, repo) } // earlyResponseForGoGetMeta responses appropriate go-get meta with status 200 @@ -311,7 +311,7 @@ func RepoAssignment(pages ...bool) macaron.Handler { if ctx.Query("go-get") == "1" { ctx.Data["GoGetImport"] = composeGoGetImport(owner.Name, repo.Name) - prefix := setting.AppUrl + path.Join(owner.Name, repo.Name, "src", ctx.Repo.BranchName) + prefix := setting.AppURL + path.Join(owner.Name, repo.Name, "src", ctx.Repo.BranchName) ctx.Data["GoDocDirectory"] = prefix + "{/dir}" ctx.Data["GoDocFile"] = prefix + "{/dir}/{file}#L{line}" } |