diff options
author | Unknwon <u@gogs.io> | 2017-03-22 12:58:12 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-22 12:58:12 -0400 |
commit | bb86d66496078b8c2fb242b6286d682ff9d5aa2f (patch) | |
tree | b14d0d4d2934c6d1b77f828d6d24dc7f31407fcf | |
parent | aba87895426663fe166e4d81b81883f45ce957ce (diff) |
repo: rename PageIsViewCode -> PageIsViewFiles
Also highlight 'Files' tab when use editor.
-rw-r--r-- | cmd/web.go | 6 | ||||
-rw-r--r-- | routers/repo/commit.go | 2 | ||||
-rw-r--r-- | routers/repo/release.go | 2 | ||||
-rw-r--r-- | routers/repo/view.go | 2 | ||||
-rw-r--r-- | templates/repo/header.tmpl | 2 |
5 files changed, 8 insertions, 6 deletions
@@ -534,7 +534,7 @@ func runWeb(ctx *cli.Context) error { m.Get("/edit/*", repo.EditRelease) m.Post("/edit/*", bindIgnErr(form.EditRelease{}), repo.EditReleasePost) }, repo.MustBeNotBare, reqRepoWriter, func(ctx *context.Context) { - ctx.Data["PageIsViewCode"] = true + ctx.Data["PageIsViewFiles"] = true }) // FIXME: Should use ctx.Repo.PullRequest to unify template, currently we have inconsistent URL @@ -569,6 +569,8 @@ func runWeb(ctx *cli.Context) error { ctx.NotFound() return } + + ctx.Data["PageIsViewFiles"] = true }) }, reqSignIn, context.RepoAssignment()) @@ -586,7 +588,7 @@ func runWeb(ctx *cli.Context) error { m.Get("/all", repo.AllBranches) m.Post("/delete/*", reqSignIn, reqRepoWriter, repo.DeleteBranchPost) }, repo.MustBeNotBare, func(ctx *context.Context) { - ctx.Data["PageIsViewCode"] = true + ctx.Data["PageIsViewFiles"] = true }) m.Group("/wiki", func() { diff --git a/routers/repo/commit.go b/routers/repo/commit.go index a2752fdd..409cee85 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -22,7 +22,7 @@ const ( ) func RefCommits(ctx *context.Context) { - ctx.Data["PageIsViewCode"] = true + ctx.Data["PageIsViewFiles"] = true switch { case len(ctx.Repo.TreePath) == 0: Commits(ctx) diff --git a/routers/repo/release.go b/routers/repo/release.go index 6329de9d..5c6ba4ea 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -47,7 +47,7 @@ func calReleaseNumCommitsBehind(repoCtx *context.Repository, release *models.Rel func Releases(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.release.releases") - ctx.Data["PageIsViewCode"] = true + ctx.Data["PageIsViewFiles"] = true ctx.Data["PageIsReleaseList"] = true tagsResult, err := ctx.Repo.GitRepo.GetTagsAfter(ctx.Query("after"), 10) diff --git a/routers/repo/view.go b/routers/repo/view.go index 2b166520..8b68d188 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -224,7 +224,7 @@ func setEditorconfigIfExists(ctx *context.Context) { } func Home(ctx *context.Context) { - ctx.Data["PageIsViewCode"] = true + ctx.Data["PageIsViewFiles"] = true if ctx.Repo.Repository.IsBare { ctx.HTML(200, BARE) diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 45feff48..2193d0a5 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -49,7 +49,7 @@ {{if not .IsDiffCompare}} <div class="ui tabs container"> <div class="ui tabular menu navbar"> - <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}"> + <a class="{{if .PageIsViewFiles}}active{{end}} item" href="{{.RepoLink}}"> <i class="octicon octicon-file-text"></i> {{.i18n.Tr "repo.files"}} </a> {{if .Repository.EnableIssues}} |