diff options
Diffstat (limited to 'modules/context')
-rw-r--r-- | modules/context/api.go | 8 | ||||
-rw-r--r-- | modules/context/auth.go | 16 | ||||
-rw-r--r-- | modules/context/context.go | 2 | ||||
-rw-r--r-- | modules/context/org.go | 2 | ||||
-rw-r--r-- | modules/context/repo.go | 4 |
5 files changed, 16 insertions, 16 deletions
diff --git a/modules/context/api.go b/modules/context/api.go index 2823d696d2..7706e9c499 100644 --- a/modules/context/api.go +++ b/modules/context/api.go @@ -47,16 +47,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/modules/context/auth.go b/modules/context/auth.go index 0e5ae93a87..372bcb187a 100644 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -26,7 +26,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,14 +38,14 @@ 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)) + if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LandingPageHome { + 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 } @@ -66,8 +66,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") @@ -79,8 +79,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/modules/context/context.go b/modules/context/context.go index 0535da995a..57a9195306 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -159,7 +159,7 @@ func Contexter() macaron.Handler { Org: &Organization{}, } // 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/modules/context/org.go b/modules/context/org.go index d31d9773a0..cfe9a26220 100644 --- a/modules/context/org.go +++ b/modules/context/org.go @@ -95,7 +95,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/modules/context/repo.go b/modules/context/repo.go index 6135ac46ae..338a78cb93 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -117,7 +117,7 @@ func RetrieveBaseRepo(ctx *Context, repo *models.Repository) { // 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 @@ -331,7 +331,7 @@ func RepoAssignment(args ...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}" } |